Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Incrementing a variable
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01324913
Message ID:
01324916
Vues:
14
>>I get this error on the block below:
>>
>>Msg 2716, Level 16, State 1, Line 243
>>Column, parameter, or variable #42: Cannot specify a column width on data type int.
>>
>>
>>
>>DECLARE @Count AS INTEGER(4)
>>
>>SET @Count = 0
>>.
>>.
>>.
>>SET @Count = @Count + 1
>>
>
>Integer is one of the types that you don't have to specify length. It is always 4 bytes
>So instead:
>DECLARE @Count AS INTEGER(4)
>just do:
>DECLARE @Count AS INTEGER
>
>Other types that does not require such thing are:
>smallint,
>tinyint,
>datetime,
>smalldatetime,
>text,
>image
>maybe I'm missing some of them right now, but I feel so sleepy :-)

XML ? bit, etc.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform