Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Create Table syntax
Message
De
04/06/2012 11:29:26
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2008
Application:
Desktop
Divers
Thread ID:
01545225
Message ID:
01545234
Vues:
38
Create table CATMaster (CATID int identity(1,1), Category char(2), diff char(1), ALC varchar(5), Keyword varchar(25),
Keyword2 Varchar(25), keyopt char(1), script varchar(500), stem varchar(500), respa varchar(115),
respb varchar(115),respc varchar(115), respd varchar(115), scripttime varchar(2), testtype char(1),
EntBy Char(3), EntDate date, RevBy char(3), RevDate date, Completed char(1))


>Can you post your new code? Are you sure the last ) is no longer missing?
>
>>now it says "The specified data type is not valid. [ Data type (if known) = char ]"
>>
>>
>>
>>>>Hello all
>>>>
>>>>ok, it's been a while since I had to deal with straight T-SQL and I'm trying to create a table
>>>>
>>>>Create table CATMaster (CATID int identity(1,1), Category varchar(2), diff varchar(1), ALC varchar(5), Keyword varchar(25),
>>>> Keyword2 Varchar(25), keyopt varchar(1), script varchar(500), stem varchar(500), respa varchar(115),
>>>> respb varchar(115),respc varchar(115), respd varchar(115), scripttime varchar(2), testtype varchar(1),
>>>> EntBy VarChar(3), EntDate date, RevBy Varchar(3), RevDate date, Completed varchar(1)
>>>>
>>>>It keeps telling me "The specified data type is not valid. [ Data type (if known) = varchar ]"
>>>>
>>>>Ok, I'm confused. What am I not seeing?
>>>>
>>>>Thanks
>>>
>>>You're missing last ). Also, there is no point of creating varchar(1) fields. CHAR(1) are better for this case (I actually start creating varchar from 5 and up). So, I would write the above as
>>>
>>>Create table CATMaster (CATID int identity(1,1), Category char(2), [diff] char(1), ALC varchar(5), Keyword varchar(25),
>>>  Keyword2 Varchar(25), keyopt char(1), script varchar(500), stem varchar(500), respa varchar(115),
>>>  respb varchar(115),respc varchar(115), respd varchar(115), scripttime char(2), testtype char(1), 
>>>  EntBy Char(3), EntDate date, RevBy char(3), RevDate date, Completed char(1))
>>>
>>>
>>>Also, are you using SQL 2008?
"You don't manage people. You manage things - people you lead" Adm. Grace Hopper
Pflugerville, between a Rock and a Weird Place
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform