Click here to Skip to main content
15,913,055 members
Home / Discussions / Database
   

Database

 
GeneralRe: Help with MS SQL Update statement please. Pin
Ashfield30-Jan-08 2:21
Ashfield30-Jan-08 2:21 
GeneralRe: Help with MS SQL Update statement please. Pin
Steven J Jowett30-Jan-08 5:21
Steven J Jowett30-Jan-08 5:21 
GeneralRe: Help with MS SQL Update statement please. Pin
Ashfield30-Jan-08 7:22
Ashfield30-Jan-08 7:22 
QuestionHow Can I execute pl/sql query?? Pin
Vanamaindia29-Jan-08 23:09
Vanamaindia29-Jan-08 23:09 
AnswerRe: How Can I execute pl/sql query?? Pin
andyharman29-Jan-08 23:26
professionalandyharman29-Jan-08 23:26 
GeneralNHibernate data saving problem, help! Pin
Harry Sun29-Jan-08 22:56
Harry Sun29-Jan-08 22:56 
GeneralRe: NHibernate data saving problem, help! Pin
Mark Churchill30-Jan-08 2:10
Mark Churchill30-Jan-08 2:10 
Questionhow to store result of exec(query) values in to a temp table Pin
veereshIndia29-Jan-08 21:04
veereshIndia29-Jan-08 21:04 
Hi All

I have a small problem if any budy know please reply me

I have the following sql code

when i will execute it i will get a some data in a single column
Now i want to insert those data into a temp table.But the problem is
@Role_Idv is a column in table [admin].[cm_tb_005].Which i am passing dynamically.

If iam taking only this much

select tb001_id FROM [admin].[cm_tb_005] WHERE '+ @Role_Idv +'='1''

The above code will not work.If iam doing like this

exec('select tb001_id FROM [admin].[cm_tb_005] WHERE '+ @Role_Idv +'=''1''')

It is working.Now i want to store the resulted values in a temp table.So that i can
select the values from temp table for other purposes.

This is the code which iam trying now which is excuting but how can i store the resultant values in a temp table


SET QUOTED_IDENTIFIER ON
declare @res1 nvarchar(500)
declare @TempMenuId nvarchar(800)
declare @Role_Idv varchar(50)
set @Role_Idv='R25'
DECLARE @TempMenuIdTable TABLE(RowIndex INT IDENTITY,Menu_Id INT )
set @res1='select tb001_id FROM [admin].[cm_tb_005] WHERE '+ @Role_Idv +'=''1'''
select @res1
exec(@res1)

Regard's
Veeresh

i want to join this group

AnswerRe: how to store result of exec(query) values in to a temp table Pin
Ashfield29-Jan-08 21:23
Ashfield29-Jan-08 21:23 
GeneralRe: how to store result of exec(query) values in to a temp table Pin
veereshIndia29-Jan-08 22:15
veereshIndia29-Jan-08 22:15 
QuestionRe: how to store result of exec(query) values in to a temp table Pin
Ashfield29-Jan-08 22:30
Ashfield29-Jan-08 22:30 
GeneralRe: how to store result of exec(query) values in to a temp table Pin
veereshIndia29-Jan-08 22:39
veereshIndia29-Jan-08 22:39 
GeneralRe: how to store result of exec(query) values in to a temp table Pin
veereshIndia30-Jan-08 1:43
veereshIndia30-Jan-08 1:43 
GeneralRe: how to store result of exec(query) values in to a temp table Pin
Ashfield30-Jan-08 2:01
Ashfield30-Jan-08 2:01 
Generalpdf format Pin
sandhya1429-Jan-08 19:39
sandhya1429-Jan-08 19:39 
GeneralRe: pdf format Pin
pmarfleet29-Jan-08 22:04
pmarfleet29-Jan-08 22:04 
GeneralRe: pdf format Pin
sandhya1429-Jan-08 22:19
sandhya1429-Jan-08 22:19 
GeneralRe: pdf format Pin
Pete O'Hanlon29-Jan-08 22:10
mvePete O'Hanlon29-Jan-08 22:10 
QuestionUsing SP In MS SQL Server2000 Pin
Arunika De Jonk29-Jan-08 18:33
Arunika De Jonk29-Jan-08 18:33 
AnswerRe: Using SP In MS SQL Server2000 Pin
Ashfield29-Jan-08 22:09
Ashfield29-Jan-08 22:09 
GeneralRe: Using SP In MS SQL Server2000 Pin
Arunika De Jonk29-Jan-08 22:17
Arunika De Jonk29-Jan-08 22:17 
GeneralRe: Using SP In MS SQL Server2000 Pin
pmarfleet29-Jan-08 22:15
pmarfleet29-Jan-08 22:15 
GeneralRe: Using SP In MS SQL Server2000 Pin
Arunika De Jonk29-Jan-08 22:20
Arunika De Jonk29-Jan-08 22:20 
GeneralRe: Using SP In MS SQL Server2000 Pin
Arunika De Jonk30-Jan-08 1:23
Arunika De Jonk30-Jan-08 1:23 
GeneralAdd columns to a multiple table Pin
MAW3029-Jan-08 15:45
MAW3029-Jan-08 15:45 

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.