Thursday, March 8, 2012

cannot create a simple table

hello im brand new to SQL server but im very well versed in access so i know
how sql works, to aid me in my transition im the microsoft press SQLServer
2000 book and am trying to follow the simple instructions to create a table,
the script is very simple:
use northwind
create table investors
{
IvestorID int not null,
FirstName varchar(30) not null,
LastName varchar(30) not null
}
and ive made sure that ive copied it exactly but its still not working. IM
using the personal edition to get to grips with it before using the one at
work. Im logged in using windows authentication as the user Laptop/Dr patel
which is my username, and should have full database admin rights however i
get the following result when i run the above sql:
[Microsoft][ODBC SQL Server Driver]Syntax error or access violation
what am i doing wrong?use northwind
GO
create table investors
(
IvestorID int not null,
FirstName varchar(30) not null,
LastName varchar(30) not null
)
Your curly {} brackets were wrong.
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"DowningDevelopments" <DowningDevelopments@.discussions.microsoft.com> wrote
in message news:90D63350-D145-4C98-9194-439CD14CC778@.microsoft.com...
> hello im brand new to SQL server but im very well versed in access so i
> know
> how sql works, to aid me in my transition im the microsoft press SQLServer
> 2000 book and am trying to follow the simple instructions to create a
> table,
> the script is very simple:
> use northwind
> create table investors
> {
> IvestorID int not null,
> FirstName varchar(30) not null,
> LastName varchar(30) not null
> }
> and ive made sure that ive copied it exactly but its still not working. IM
> using the personal edition to get to grips with it before using the one at
> work. Im logged in using windows authentication as the user Laptop/Dr
> patel
> which is my username, and should have full database admin rights however i
> get the following result when i run the above sql:
>
> [Microsoft][ODBC SQL Server Driver]Syntax error or access violatio
n
> what am i doing wrong?
>|||Noooo, I figured it had to be something stupid like that!!!
thanks Mike
"Mike Epprecht (SQL MVP)" wrote:

> use northwind
> GO
> create table investors
> (
> IvestorID int not null,
> FirstName varchar(30) not null,
> LastName varchar(30) not null
> )
> Your curly {} brackets were wrong.
> Regards
> --
> Mike Epprecht, Microsoft SQL Server MVP
> Zurich, Switzerland
> IM: mike@.epprecht.net
> MVP Program: http://www.microsoft.com/mvp
> Blog: http://www.msmvps.com/epprecht/
> "DowningDevelopments" <DowningDevelopments@.discussions.microsoft.com> wrot
e
> in message news:90D63350-D145-4C98-9194-439CD14CC778@.microsoft.com...
>
>

No comments:

Post a Comment