SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 alter table problem.
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Serg
Starting Member

United Kingdom
1 Posts

Posted - 08/15/2012 :  11:22:19  Show Profile  Reply with Quote
Hi all,
I am new in SQL, so my problem is trivial. I try edit table:

aalter TABLE [dbo].[pasta](
[derectives] [int] NULL,
[sample] [nchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[db] [real] NULL,
[surename] [nchar](10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[result] AS ([sample]+[surename])
[capor] as ([derectives]*10)
) ON [PRIMARY]

And all the time get error:
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near '('.

Could you advise that is wrong???

robvolk
Most Valuable Yak

USA
15558 Posts

Posted - 08/15/2012 :  11:31:47  Show Profile  Visit robvolk's Homepage  Reply with Quote
Change ALTER to CREATE. This syntax is incorrect for altering a table.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
47040 Posts

Posted - 08/15/2012 :  11:52:31  Show Profile  Reply with Quote
if you want to alter table you should be using ALTER TABLE...ADD
or ALTER TABLE...ALTER COLUMN based on your requirement

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.12 seconds. Powered By: Snitz Forums 2000