Wednesday, March 21, 2012

Issues with getting SQL SERVER Express to understand a variable decleration and set

Here is the begning part of the stored procedure

ALTERPROCEDURE [dbo].[purchaseStock]

@.stock_idint,

@.user_namevarchar(50),

@.amount_requestint

AS

DECLARE @.UserIduniqueidentifier

DECLARE @.walletdouble

SET @.UserId=SELECT UserIdFROM aspnet_UsersWHERE UserName= @.user_name

The exact error I get is

Msg 156, Level 15, State 1, Procedure purchaseStock, Line 10

Incorrect syntax near the keyword 'SET'.

That is common T-SQL what gives?

Double is not a datatype in SQL Server. Use Decimal instead.

No comments:

Post a Comment