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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Adding a column to a table

Author  Topic 

trackjunkie
Starting Member

31 Posts

Posted - 2009-04-22 : 10:54:33
I'm very new at this so be patient and detailed in any answers please...

I added a table to my database and now need to add one more column. I right clicked on the table and picked "edit" I got a window with code to create the table and modified it to "Alter" the table and add a column. Here is the code and error I'm getting:

USE [Flex_App]
GO

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER TABLE[dbo].[Flex_RoutingData](

ADD QCSheetNumber INT Null

) ON [PRIMARY]

Here are my error messages:

Msg 102, Level 15, State 1, Line 1
Incorrect syntax near '('.
Msg 102, Level 15, State 1, Line 3
Incorrect syntax near 'QCSheetNumber'.

I based my code on info I found many places on line and have no idea what is wrong. I let most of it alone, just changed "Create" to "Alter" and inserted the ADD statement. I also tried "ADD COLUMN" instead of just ADD

Thanks for any help.





madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-04-22 : 11:04:04

ALTER TABLE [dbo].[Flex_RoutingData] ADD QCSheetNumber INT Null

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -