Bakersville
asked on
Msg 170, Level 15, State 1, Line 4 Incorrect syntax near max on CREATE in SQLCMD
Hi everyone, i am trying to run the CREATE proceedure on SQLCMD and i have come accross a snagg.
The code is below.
-------
USE [MyDB]
GO
/****** Object: Table [dbo].[MyTable] Script Date: 11/29/2007 13:25:32 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[MyTable](
[Column1] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_ AS NULL,
[Column2] [int] IDENTITY(1,1) NOT NULL,
[Column3] [nvarchar](max) COLLATE SQL_Latin1_General_CP1_CI_ AS NULL
) ON [PRIMARY]
GO
---------
It all is working apart from when i get to
[Column3] [nvarchar](max) COLLATE SQL_Latin1_General_CP1_CI_ AS NULL
Anywhere i use[nvarchar](max) it keeps coming up with the above error, regardless of what table i am trying to crate.
Any help would be very much appriated.
Thank you
Baker
The code is below.
-------
USE [MyDB]
GO
/****** Object: Table [dbo].[MyTable] Script Date: 11/29/2007 13:25:32 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[MyTable](
[Column1] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_
[Column2] [int] IDENTITY(1,1) NOT NULL,
[Column3] [nvarchar](max) COLLATE SQL_Latin1_General_CP1_CI_
) ON [PRIMARY]
GO
---------
It all is working apart from when i get to
[Column3] [nvarchar](max) COLLATE SQL_Latin1_General_CP1_CI_
Anywhere i use[nvarchar](max) it keeps coming up with the above error, regardless of what table i am trying to crate.
Any help would be very much appriated.
Thank you
Baker
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Ignore my previous post, your create statement worked for me as is.
database compatibility setting:
http://msdn2.microsoft.com/En-US/library/ms191137.aspx
http://msdn2.microsoft.com/En-US/library/ms191137.aspx
angelIII,
I tried a switch to compatibility = 80 and it still worked.
Now I'm puzzled.
Mike
I tried a switch to compatibility = 80 and it still worked.
Now I'm puzzled.
Mike
ASKER
Thank you both for your help.
I changed the compatibility to 90 and it works great.
Thanks for your quick responses, means i can get the site live tonight now.
Baker
I changed the compatibility to 90 and it works great.
Thanks for your quick responses, means i can get the site live tonight now.
Baker
>angelIII,
>I tried a switch to compatibility = 80 and it still worked.
>Now I'm puzzled.
>Mike
well, you might have take the wrong database/server ....
>I tried a switch to compatibility = 80 and it still worked.
>Now I'm puzzled.
>Mike
well, you might have take the wrong database/server ....
angelIII,
<well, you might have take the wrong database/server .... >
No, I checked that out. It complained about the COLLATE when I rolled compatibility back to 70, but let the (Max) through.
But at least the problem got fixed :-)
Mike
<well, you might have take the wrong database/server .... >
No, I checked that out. It complained about the COLLATE when I rolled compatibility back to 70, but let the (Max) through.
But at least the problem got fixed :-)
Mike
E.g.
Column3 nvarchar(max) COLLATE SQL_Latin1_General_CP1_CI_