Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > BOOK: Beginning Visual C#
|
BOOK: Beginning Visual C#
This is the forum to discuss the Wrox book Beginning Visual C#, Revised Edition of Beginning C# for .NET v1.0 by Karli Watson, David Espinosa, Zach Greenvoss, Jacob Hammer Pedersen, Christian Nagel, Jon D. Reid, Matthew Reynolds, Morgan Skinner, Eric White; ISBN: 9780764543821
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Visual C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 8th, 2004, 07:43 PM
Authorized User
 
Join Date: Jul 2004
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default Kinda Angry...SQL error I can't solve

I'm kinda angry since the sql problem I am trying to solve was what I downloaded from the book I am using - Visual C# .NET: A Guide for VB6 Developers. (ISBN 1-86100-717-5)CHAPTER 9 - Oh I'm sure I am doing something wrong. I am trying to run this script from the Query Analyzer:

CREATE TABLE [reviewers] (
    [rev_id] [int] IDENTITY (1, 1) NOT NULL ,
    [rev_lname] [varchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
    [rev_fname] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
    [phone] [char] (12) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
    [email] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
    [address] [char] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
    [city] [char] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
    [state] [char] (2) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
    [zip] [char] (5) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
    CONSTRAINT [PK_reviewers] PRIMARY KEY CLUSTERED
    (
        [rev_id]
    ) ON [PRIMARY]
) ON [PRIMARY]
GO


CREATE TABLE [reviews] (
    [reviews_id] [int] IDENTITY (1, 1) NOT NULL ,
    [rev_id] [int] NOT NULL ,
    [title_id] [tid] NOT NULL ,
    [complete] [bit] NOT NULL CONSTRAINT [DF_reviews_complete] DEFAULT (0),
    [dateExpected] [datetime] NULL ,
    CONSTRAINT [PK_reviews] PRIMARY KEY CLUSTERED
    (
        [reviews_id]
    ) ON [PRIMARY]
) ON [PRIMARY]
GO

I get the following error:

Server: Msg 170, Level 15, State 1, Line 3
Line 3: Incorrect syntax near 'COLLATE'.

Any ideas? This stuff needs to be updated to the PUBS database so that I can finish the C# project in the book, (the project is being developed as I progress thru the book so this is a real show stopper!)

Cmarek
__________________
Cmarek
 
Old September 8th, 2004, 11:05 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

I run this & had no problem!

Always:),
Hovik Melkomian.
 
Old September 9th, 2004, 04:06 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

What version of SQL Server do you have? COLLATE is only supported on SQL 2000. You can remove all the COLLATE statements and it will run just fine.
 
Old September 9th, 2004, 09:24 AM
Authorized User
 
Join Date: Jul 2004
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am using sgl server 7. Yep, that was it

Cmarek





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to solve this error? ramk_1978 Classic ASP Components 1 June 27th, 2006 02:51 AM
Can any one help to solve the Thread error here vivekshah C# 1 April 12th, 2006 05:10 AM
Can anyone help me to solve this error vikaspa VB How-To 1 October 5th, 2005 04:43 AM
Error that I could not solve sajjad27 VS.NET 2002/2003 0 August 17th, 2003 11:40 PM
Unable to solve error!! nvillare Classic ASP Basics 1 July 31st, 2003 01:53 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.