November 30, 2001 at 1:08 pm
Sounds simple enough, huh? I'm running SQL 2000 on a development machine. When I try to delete a column through Enterprise Manager or through script, I get an "incorrect syntax error name of column". I have tried it on a couple different machines, and no go. Thanks for the help.
November 30, 2001 at 1:11 pm
November 30, 2001 at 3:12 pm
Pardon my ignorance, but what ddl?
November 30, 2001 at 5:05 pm
The sql to create the table you are trying to drop the column from. We can recreate on our machines, see if we have the same issue.
Andy
November 30, 2001 at 5:20 pm
Ohhh. The table was created in Enterprise Mgr, so all defaults. The columns were datatype int, allow nulls & database char (10), allow nulls. Everything else was default for the columns. Does that help?
November 30, 2001 at 5:49 pm
Almost. We need the script for it. Right click the table and find the option to generate a script. Save that to disk, open it, copy and paste the test into the reply form here.
Andy
November 30, 2001 at 11:22 pm
is there something strange about the name of the column or any column? like it's got an invalid character in it.
If you use the profiler you can see what enterprise manager is trying to execute and can probably guess what is wrong.
Edited by - nigelrivett on 11/30/2001 11:23:48 PM
Cursors never.
DTS - only when needed and never to control.
December 3, 2001 at 4:44 am
Hi
To delete a column you give
Alter table table1 drop column colname
However if you have any constraint on the column like primary key or any other computation ,based on the column you may not be able to delete the column till you have removed the constraint.
The other thing could be that you probably are using single quotes to enclose the column name,try using double quotes or square brackets
Lata
December 3, 2001 at 10:37 am
December 3, 2001 at 1:31 pm
That the SQL I am trying to use. Tried sq brackets & double quotes. Still get Incorrect syntax error near "name of column".
December 3, 2001 at 1:50 pm
December 3, 2001 at 3:03 pm
I tried to generate it, but I get an error 0. I get that all the tables on my development server. I'll see if I can get them off my production server. Does generating the script do anything to the database itself?
December 3, 2001 at 3:40 pm
No, it just writes the definition to a text file.
Andy
December 3, 2001 at 3:58 pm
Can you just post all the column names? or generate a script for the creation of the table.
Steve Jones
December 3, 2001 at 4:18 pm
The plot thickens. I can delete columns on tables that have been created in other databases. Also, the column will delete when deleting through Visual InterDev. Go figure. Thanks for all your input. I'll have to do some more exploring at this end.
Viewing 15 posts - 1 through 15 (of 17 total)
You must be logged in to reply to this topic. Login to reply