Click here to Skip to main content
15,794,236 members
Home / Discussions / Database
   

Database

 
GeneralRe: 50 Tables(Urgent) Pin
kirthikirthi12-Jun-06 23:07
kirthikirthi12-Jun-06 23:07 
GeneralRe: 50 Tables(Urgent) Pin
r.stropek12-Jun-06 23:25
r.stropek12-Jun-06 23:25 
GeneralRe: 50 Tables(Urgent) Pin
Mahesh Sapre14-Jun-06 2:43
Mahesh Sapre14-Jun-06 2:43 
QuestionWhy I am getting the error message Server: Msg 245 Pin
kalyan_vb12-Jun-06 11:27
kalyan_vb12-Jun-06 11:27 
AnswerRe: Why I am getting the error message Server: Msg 245 Pin
Colin Angus Mackay12-Jun-06 12:44
Colin Angus Mackay12-Jun-06 12:44 
GeneralRe: Why I am getting the error message Server: Msg 245 [modified] Pin
kalyan_vb12-Jun-06 13:26
kalyan_vb12-Jun-06 13:26 
AnswerRe: Why I am getting the error message Server: Msg 245 Pin
Colin Angus Mackay12-Jun-06 13:45
Colin Angus Mackay12-Jun-06 13:45 
AnswerRe: Why I am getting the error message Server: Msg 245 Pin
r.stropek12-Jun-06 22:28
r.stropek12-Jun-06 22:28 
Hi!

Sorry, I don't think that your query will work. You cannot insert into a table variable from inside a dynamic query. Try the following:

declare @test table ( MyId int )
insert into @test values (5)

declare @stmt varchar(128)
set @stmt = 'insert into @test values (6)'
exec( @stmt )


The dynamically executed statment will not work because it does not know about the table var @test.

Additionally I saw that you forgot the ( ) in your exec-statement. exec @querystring cannot execute a dynamic query; you have to write exec ( @querystring ). Otherwise SQL Server will think you want to execute a stored procedure with the name stored in @querystring. See Transact-SQL-Reference for EXECUTE in Books Online for details.

Regards,
Rainer.


Rainer Stropek
Visit my blog at http://www.cubido.at/rainers
Questionrequired help for sql query Pin
kalyan_vb12-Jun-06 6:25
kalyan_vb12-Jun-06 6:25 
AnswerRe: required help for sql query Pin
Eric Dahlvang12-Jun-06 8:41
Eric Dahlvang12-Jun-06 8:41 
AnswerRe: required help for sql query Pin
r.stropek13-Jun-06 5:09
r.stropek13-Jun-06 5:09 
QuestionDifferent Database Locations Pin
tadhg8812-Jun-06 2:28
tadhg8812-Jun-06 2:28 
AnswerRe: Different Database Locations Pin
Colin Angus Mackay12-Jun-06 2:42
Colin Angus Mackay12-Jun-06 2:42 
QuestionMS-SQL Query result to HTML (how?) Pin
spsharma12-Jun-06 0:15
spsharma12-Jun-06 0:15 
AnswerRe: MS-SQL Query result to HTML (how?) Pin
spsharma12-Jun-06 2:42
spsharma12-Jun-06 2:42 
AnswerRe: MS-SQL Query result to HTML (how?) Pin
vivek-g13-Jun-06 20:37
vivek-g13-Jun-06 20:37 
GeneralRe: MS-SQL Query result to HTML (how?) Pin
spsharma19-Jun-06 0:38
spsharma19-Jun-06 0:38 
Questionsetcount on Pin
vivek-g11-Jun-06 23:31
vivek-g11-Jun-06 23:31 
AnswerRe: setcount on Pin
Frank Kerrigan12-Jun-06 0:21
Frank Kerrigan12-Jun-06 0:21 
AnswerRe: setcount on Pin
sasidar_d12-Jun-06 5:19
sasidar_d12-Jun-06 5:19 
QuestionRetrieve all column if parameter is null Pin
angelagke11-Jun-06 16:58
angelagke11-Jun-06 16:58 
AnswerRe: Retrieve all column if parameter is null Pin
nguyenvhn11-Jun-06 22:29
nguyenvhn11-Jun-06 22:29 
GeneralRe: Retrieve all column if parameter is null Pin
angelagke12-Jun-06 18:52
angelagke12-Jun-06 18:52 
GeneralRe: Retrieve all column if parameter is null Pin
r.stropek12-Jun-06 22:41
r.stropek12-Jun-06 22:41 
GeneralRe: Retrieve all column if parameter is null Pin
angelagke14-Jun-06 17:40
angelagke14-Jun-06 17:40 

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.