Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Incrementing a variable
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01324913
Message ID:
01324916
Views:
12
>>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
Previous
Reply
Map
View

Click here to load this message in the networking platform