Click here to Skip to main content
15,926,281 members
Home / Discussions / Database
   

Database

 
Questionwhat's wrong with this simple SQL statement? Pin
devvvy10-Feb-03 2:39
devvvy10-Feb-03 2:39 
AnswerRe: what's wrong with this simple SQL statement? Pin
Mazdak10-Feb-03 4:16
Mazdak10-Feb-03 4:16 
GeneralRe: what's wrong with this simple SQL statement? Pin
devvvy10-Feb-03 10:50
devvvy10-Feb-03 10:50 
AnswerRe: what's wrong with this simple SQL statement? Pin
Chris Meech10-Feb-03 4:34
Chris Meech10-Feb-03 4:34 
GeneralRe: what's wrong with this simple SQL statement? Pin
devvvy10-Feb-03 10:52
devvvy10-Feb-03 10:52 
AnswerRe: what's wrong with this simple SQL statement? Pin
Julio Martínez10-Feb-03 5:46
Julio Martínez10-Feb-03 5:46 
AnswerRe: what's wrong with this simple SQL statement? Pin
Bruce Duncan10-Feb-03 6:48
Bruce Duncan10-Feb-03 6:48 
GeneralRe: what's wrong with this simple SQL statement? Pin
devvvy10-Feb-03 11:17
devvvy10-Feb-03 11:17 
Hey, this solved the problem, thankyou. It will be very hard to find this bug

I've got a new one for you - I think you will solve this with ease:


CREATE PROC dbo.DADA(....) AS
...
... Body of a stored procedure ...
...
DECLARE @token VARCHAR(15)
SET @token=NULL
SET @strSQL = 'SELECT @token=strToken FROM ' + @temp_table_name + ' WHERE rowindex=' + CAST(@index AS VARCHAR(10))
SET @strSQL = CAST(@strSQL AS nvarchar(1000))
EXEC (@strSQL)
...
... Body of a stored procedure ...
...
GO

The error message from Query Analyzer: "Must declare the variable '@token'"

As u can see from the code fragment, @token has been declared.



norm
GeneralRe: what's wrong with this simple SQL statement? Pin
Bruce Duncan11-Feb-03 7:30
Bruce Duncan11-Feb-03 7:30 
GeneralRe: what's wrong with this simple SQL statement? Pin
devvvy11-Feb-03 15:30
devvvy11-Feb-03 15:30 
GeneralQuery From Column Name Pin
Mazdak9-Feb-03 23:33
Mazdak9-Feb-03 23:33 
GeneralRe: Query From Column Name Pin
karl_w10-Feb-03 6:27
karl_w10-Feb-03 6:27 
GeneralKeeping Database Connection Open Pin
ChrisDM9-Feb-03 2:21
ChrisDM9-Feb-03 2:21 
GeneralProblem with running stored procedure Pin
Mazdak8-Feb-03 1:41
Mazdak8-Feb-03 1:41 
QuestionWhat is wrong with these SQL statements?? Pin
IrishSonic8-Feb-03 0:37
IrishSonic8-Feb-03 0:37 
AnswerRe: What is wrong with these SQL statements?? Pin
Mazdak8-Feb-03 2:51
Mazdak8-Feb-03 2:51 
GeneralRe: What is wrong with these SQL statements?? Pin
karl_w8-Feb-03 3:01
karl_w8-Feb-03 3:01 
GeneralRe: What is wrong with these SQL statements?? Pin
Mazdak8-Feb-03 3:53
Mazdak8-Feb-03 3:53 
GeneralRe: What is wrong with these SQL statements?? Pin
IrishSonic8-Feb-03 6:49
IrishSonic8-Feb-03 6:49 
GeneralDELETE STILL NOT WORKING FOR ME... Pin
IrishSonic8-Feb-03 7:14
IrishSonic8-Feb-03 7:14 
GeneralRe: DELETE STILL NOT WORKING FOR ME... Pin
karl_w8-Feb-03 10:12
karl_w8-Feb-03 10:12 
QuestionWhat database am I using? Pin
David Salter7-Feb-03 11:21
David Salter7-Feb-03 11:21 
AnswerRe: What database am I using? Pin
Bruce Duncan8-Feb-03 0:29
Bruce Duncan8-Feb-03 0:29 
GeneralRe: What database am I using? Pin
David Salter9-Feb-03 7:45
David Salter9-Feb-03 7:45 
GeneralSystem.Data.DataTable write synchronization Pin
Bill Baldasti6-Feb-03 11:41
Bill Baldasti6-Feb-03 11:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.