Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Incrementing a variable
Message
 
To
17/06/2008 16:05:43
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01324913
Message ID:
01324914
Views:
11
This message has been marked as the solution to the initial question of the thread.
>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 :-)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform