Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Alter Table error

Author  Topic 

kathyc2003
Starting Member

15 Posts

Posted - 2007-08-28 : 18:12:28
Hello,

I have written the query below to add a field to my sport
table called 'list', but am getting the error outlined below.
What have I done wrong?

$query = "ALTER TABLE sport ADD COLUMN list TEXT(3)";
$result = odbc_exec($iConnect, $query) or die('Select failed!');


Warning: odbc_exec() [function.odbc-exec]: SQL error: [Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the keyword 'COLUMN'., SQL state 37000 in SQLExecDirect in E:\inetpub\scripts\athlete\aa_sports_table.php on line 57
Select failed!

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-08-28 : 18:34:59
$query = "ALTER TABLE sport ADD list VARCHAR(3)";
$result = odbc_exec($iConnect, $query) or die('Select failed!');



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page
   

- Advertisement -