Author |
Topic |
biz
Starting Member
4 Posts |
Posted - 2008-11-18 : 04:46:33
|
I have a question as when create command is given with constraint added as GO CREATE TABLE [dbo].[Site]( [ID] [int] IDENTITY(1,1) NOT NULL, [MonitorTime] [datetime] NULL, [Status] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [SiteName] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [RoundTripTime] [varchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [RateLocation] [decimal](18, 2) NULL, CONSTRAINT [PK_Site] PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY]
GO SET ANSI_PADDING OFF
i am getting error as 1)Incorrect syntax near 'max'. 2)Line 11: Incorrect syntax near '('.
It will be great if anyone can help me out |
|
NeilG
Aged Yak Warrior
530 Posts |
Posted - 2008-11-18 : 04:53:46
|
Is there a reason that you're adding the constraint in seperate and not in the table creation section |
 |
|
biz
Starting Member
4 Posts |
Posted - 2008-11-18 : 05:17:47
|
yes, since the constraints are many so done it separately if same query can be modified please provide the solution |
 |
|
NeilG
Aged Yak Warrior
530 Posts |
Posted - 2008-11-18 : 05:49:24
|
It's actually running correctly for me and returning no errors, not sure what is happening there are you running the script as a whole script and not seperating between the table and then the constraint |
 |
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2008-11-18 : 08:24:53
|
Advice: If you need help with SQL Server 2000, don't post questions in the SQL Server 2008 Forums.
- Jeff http://weblogs.sqlteam.com/JeffS |
 |
|
sakets_2000
Master Smack Fu Yak Hacker
1472 Posts |
Posted - 2008-11-18 : 09:52:17
|
Are ALLOW_ROW_LOCKS,ALLOW_PAGE_LOCKS keywords which can be used in sql 2000 ? |
 |
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2008-11-18 : 10:43:49
|
varchar(max) is not a valid datatype in SQL Server 2000
[RoundTripTime] [varchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
CODO ERGO SUM |
 |
|
biz
Starting Member
4 Posts |
Posted - 2008-11-19 : 01:01:49
|
Thanks for the help , actually i am executing the query in ms-sql server 2000 |
 |
|
|