?
Solved

Syntax Error 7.0 - COLLATE

Posted on 2003-03-31
3
Medium Priority
?
943 Views
Last Modified: 2012-06-27
Can you tell me why I am getting this syntax error when I try to use COLLATE in creating a table? Thanks!
Kathy

CREATE TABLE [dbo].[ArchiveLog] (
     [Id] [int] NOT NULL ,
     [ArchiveDate] [datetime] NOT NULL ,
     [ArchiveRunDate] [datetime] NOT NULL ,
     [Flag] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
     [Success] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]


Server: Msg 170, Level 15, State 1, Line 5
Line 5: Incorrect syntax near 'COLLATE'.
0
Comment
Question by:ktylerconk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 7

Expert Comment

by:mnye
ID: 8241599
that table creates fine on my system.  Check your availiable collations on your system

SELECT *
FROM ::fn_helpcollations()


that selects all valid collations.  make sure the one you are trying to use is availiable.

the syntax is correct, its probably just an option you have set on your installation that you have to change,

hth
late
matt
0
 
LVL 32

Expert Comment

by:Brendt Hess
ID: 8241867
SQL Server 7.0 doesn't support COLLATE.  That is new in SQL Server 2000.
0
 
LVL 4

Accepted Solution

by:
TheSpirit earned 200 total points
ID: 8244228
I guess you created this script on a SQL2000 server and are now applying it to a SQL7 server... as bhess1 says SQL7 does not support COLLATE, in SQL2000 you can specify a default collation at install time then override this down to column level when you create objects (tables ect) to get the script to work you need to modify it as follows


CREATE TABLE [dbo].[ArchiveLog] (
    [Id] [int] NOT NULL ,
    [ArchiveDate] [datetime] NOT NULL ,
    [ArchiveRunDate] [datetime] NOT NULL ,
    [Flag] [char] (1) NOT NULL ,
    [Success] [varchar] (255) NULL
) ON [PRIMARY]
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question