Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with stored proc

Status
Not open for further replies.

jeffwest1

MIS
Aug 29, 2007
50
NL
I have some code that runs ok in a demo version of my database, but always seems to go wrong when i try to recreate it on the live server.

It always gives me an error of 'error at line 22 syntax error near '='

Below is part of the code with the 'error' line noted, anybody got any ideas??

DECLARE @currKey int
DECLARE @prevKey int
DECLARE @currLine varchar(20)
DECLARE @currline2 varchar(20)
DECLARE @BigLine varchar(200)

SET @currLine = '' ------ Line 22
SET @currline2 = ''
SET @bigLine = ''
SET @prevKey = 0
SET @prevKey = -1



--------------------------------
Luke: But tell me why I can't...
Yoda: No, no, there is no why. Nothing more will I teach you today. Clear your mind of questions.
 
Batches need to be run together. Comma says all are one declare and set is all one line.
Try this:

DECLARE @currKey int,
@prevKey int,
@currLine varchar(20),
@currline2 varchar(20),
@bigbine varchar(200),
-- NOTE I changed to bigline rather the BigLine!!!!!

SET @currLine = '',
@currline2 = '',
@bigLine = '',
@prevKey = 0,
@prevKey = -1
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top