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.
| Author |
Topic |
|
argon007
Starting Member
38 Posts |
Posted - 2008-06-01 : 03:01:28
|
[code]ALTER TABLE customersadd column active_flg int(1) [/code]but i got error.quote: Msg 156, Level 15, State 1, Line 2Incorrect syntax near the keyword 'column'.
what should i do?ps. thanks for warning... i won't edit the post after i got the answer anymore. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-06-01 : 03:05:16
|
| Don't specify a size for int. You'll also need to specify NULL or a default value. I've used NULL below, but that might not be what you want.ALTER TABLE customersadd column active_flg int NULLTara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Database maintenance routines:http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx |
 |
|
|
argon007
Starting Member
38 Posts |
Posted - 2008-06-01 : 03:16:13
|
| thank you,tried it, but still the same problem. |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-06-01 : 03:29:52
|
| Oops. Remove the word column.ALTER TABLE customersADD active_flg int NULLTara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Database maintenance routines:http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-06-01 : 03:32:03
|
quote: Originally posted by argon007 thank you,tried it, but still the same problem.
Use like thisALTER TABLE customersADD active_flag int NULL |
 |
|
|
argon007
Starting Member
38 Posts |
Posted - 2008-06-01 : 03:51:18
|
| thank you, got solved. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-06-01 : 04:28:56
|
quote: Originally posted by argon007 thank you, got solved.
You're welcome |
 |
|
|
|
|
|