Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 problem with scalar variable

Author  Topic 

Harsha VR
Starting Member

1 Post

Posted - 2012-05-02 : 06:00:54
while i am trying to update the version details of aras software using the following code...
BEGIN
UPDATE[ARAS]
SET NEW_VERSION=@NEW_VERSION
WHERE CURRENT_STATE IS NULL AND IS_CURRENT=@IS_CURRENT
AND SOURCE_ID=@ID
END


but it showing error as 'must declare the scalar variable"@NEW_VERSION"...

DonAtWork
Master Smack Fu Yak Hacker

2167 Posts

Posted - 2012-05-02 : 06:34:45
The error is telling you what you must do. @NEW_VERSION is a variable that you have to define. The same goes for @IS_CURRENT and @ID.











How to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

For ultra basic questions, follow these links.
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp
Go to Top of Page

vijays3
Constraint Violating Yak Guru

354 Posts

Posted - 2012-05-02 : 10:28:23
quote:
Originally posted by Harsha VR

while i am trying to update the version details of aras software using the following code...
BEGIN
UPDATE[ARAS]
SET NEW_VERSION=@NEW_VERSION
WHERE CURRENT_STATE IS NULL AND IS_CURRENT=@IS_CURRENT
AND SOURCE_ID=@ID
END


but it showing error as 'must declare the scalar variable"@NEW_VERSION"...


You need to declare the values for all variable which are being used in your query as suggested by DonAtWork.
Go to Top of Page
   

- Advertisement -