| Author |
Topic |
|
lane0618
Posting Yak Master
134 Posts |
Posted - 2002-05-31 : 13:53:26
|
| What is the correct sytax to remove column h32-045 from my features table? The follwing gives me "Incorrect syntax near 'h32-045'"ALTER TABLE features remove 'h32-045'Thanks!Lane |
|
|
Page47
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2002-05-31 : 14:10:15
|
| You might want to try looking up ALTER TABLE in books on line.....<O> |
 |
|
|
setbasedisthetruepath
Used SQL Salesman
992 Posts |
Posted - 2002-05-31 : 14:13:16
|
If I had a column in a table named 'h32-045' I'd go on a shooting spree  quote: What is the correct sytax to remove column h32-045 from my features table? The follwing gives me "Incorrect syntax near 'h32-045'"ALTER TABLE features remove 'h32-045'Thanks!Lane
setBasedIsTheTruepath<O> |
 |
|
|
setbasedisthetruepath
Used SQL Salesman
992 Posts |
Posted - 2002-05-31 : 14:15:03
|
and then i would sharpen one end of the server case and fall on itquote: If I had a column in a table named 'h32-045' I'd go on a shooting spree  quote: What is the correct sytax to remove column h32-045 from my features table? The follwing gives me "Incorrect syntax near 'h32-045'"ALTER TABLE features remove 'h32-045'Thanks!Lane
setBasedIsTheTruepath<O>
setBasedIsTheTruepath<O> |
 |
|
|
Page47
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2002-05-31 : 14:27:15
|
To a with only a hammer, everything looks like a nail....quote: and then i would sharpen one end of the server case and fall on itquote: If I had a column in a table named 'h32-045' I'd go on a shooting spree  quote: What is the correct sytax to remove column h32-045 from my features table? The follwing gives me "Incorrect syntax near 'h32-045'"ALTER TABLE features remove 'h32-045'Thanks!Lane
setBasedIsTheTruepath<O>
setBasedIsTheTruepath<O>
<O> |
 |
|
|
mfemenel
Professor Frink
1421 Posts |
Posted - 2002-05-31 : 15:03:21
|
| try putting the name in brackets [h32-045]Mike"oh, that monkey is going to pay" |
 |
|
|
setbasedisthetruepath
Used SQL Salesman
992 Posts |
Posted - 2002-05-31 : 15:06:36
|
| I think the professor misses the point ... how could anyone possibly support such absurd column names??? We need to stop the bleeding here!setBasedIsTheTruepath<O> |
 |
|
|
mfemenel
Professor Frink
1421 Posts |
Posted - 2002-05-31 : 15:09:49
|
| Actually, I think getting him to delete the column is stopping the bleeding. Retraining and fixing the f'd up column names is more like severing the body parts and reattaching them.Mike"oh, that monkey is going to pay" |
 |
|
|
Page47
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2002-05-31 : 15:12:15
|
| well if we really want to help him drop the column, shouldn't we suggest he remove the illegal syntax?<O> |
 |
|
|
setbasedisthetruepath
Used SQL Salesman
992 Posts |
Posted - 2002-05-31 : 15:12:22
|
| True, true. But a few points should be awarded for attempting DDL instead of just going through EM.So let's poll: what could h32-045 possibly represent?setBasedIsTheTruepath<O> |
 |
|
|
lane0618
Posting Yak Master
134 Posts |
Posted - 2002-05-31 : 15:32:35
|
| Looks like the syntax is:ALTER TABLE features DROP COLUMN [TEST-99]But now I get this error:ALTER TABLE DROP COLUMN TEST-99 failed because DEFAULT CONSTRAINT DF__features__test-9__12C8C788 accesses this column.By the way, I realize the column headings are ridiculous, but I'm working on an existing corporate database so I am not at ease to make whatever changes I want.Thanks,Lane |
 |
|
|
setbasedisthetruepath
Used SQL Salesman
992 Posts |
Posted - 2002-05-31 : 15:36:40
|
Perhaps you shouldn't drop the column after all ... someone likely put that constraint there for a reason.So why did you want to drop this bad boy in the first place? Didn't like the name? setBasedIsTheTruepath<O> |
 |
|
|
lane0618
Posting Yak Master
134 Posts |
Posted - 2002-05-31 : 15:43:58
|
| Nevermind, looks like a default value was to blame.... |
 |
|
|
|