Altova DatabaseSpy 2024 Professional Edition

The instructions below show you how to add a new column to the table tblVeterinarians, using a SQL script typed manually. The new column should be called "Email" and its data type should be varchar(50).

 

Note:Entering a SQL statement is just one of the ways to add columns to an existing table. For other ways to add a column, see Creating Columns.

To create the new column:

1.Open the "ZooDB" project created previously and double-click the dbs_ic_connected ZooDBConnect data source to connect to it.

2. Click the SQL Editor ic_new-sql-editor toolbar button to open a new SQL Editor window.

3.Start typing "alt". The auto-completion helper pops up.

dbs_autocompletion_tutorial1

4.Press Enter. The word "ALTER" appears in the SQL Editor.

5.Start typing "tab" and add the word "TABLE" after "ALTER". Your SQL statement should now be "ALTER TABLE".

6.Press Space, and then press Ctrl+Space to manually trigger auto-completion.

7.Select "tblVeterinarians" from the list and press Space.

dbs_autocompletion_tutorial2

8.Continue creating the SQL statement until you have typed the following text:

ALTER TABLE [tblVeterinarians] ADD Email VARCHAR (50)

9.Execute the SQL statement by clicking the Execute ic_execute-sql button or pressing F5.

 

You have now created the new Email column. To view it in the Online Browser, click the Refresh database ic_refresh-datasource button.

© 2017-2023 Altova GmbH