Click here to Skip to main content
15,918,516 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi All,

My following alter table command is failing with error
Msg 102, Level 15, State 1, Line 2
Incorrect syntax near '('.



command:
SQL
ALTER TABLE [dbo].[OU]
ADD (Description nvarchar(100), UserGroupName nvarchar(100))


Can nayone tell me what is my mistake?

Thanks,
Nagendra.
Posted

here is tutorial to alter a table...

http://www.gigasters.com/post.aspx?postid=18[^]
 
Share this answer
 
v2
Hi ,
Check this
SQL
ALTER TABLE [dbo].[OU]
ADD [Description] nvarchar(100), UserGroupName nvarchar(100)

Best Regards
M.Mitwalli
 
Share this answer
 
Remove circular brackets all together.

Try:
SQL
ALTER TABLE 
    [dbo].[OU]
ADD 
   Description nvarchar(100), 
   UserGroupName nvarchar(100)


See examples here: MSDN: ALTER TABLE[^]
 
Share this answer
 
Comments
nagendrathecoder 14-May-12 3:00am    
I got that myself, thanks. :)
Sandeep Mewara 14-May-12 8:40am    
Ok.
I got the mistake

correct command is
SQL
ALTER TABLE [dbo].[OU]
ADD Description nvarchar(100), UserGroupName nvarchar(100)


I had given extra brackets earlier.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900