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
 insert procedure data to temporary table

Author  Topic 

asif372
Posting Yak Master

100 Posts

Posted - 2011-04-23 : 16:07:27
i have developed a procedure naming i want to insert its data to temporary table i have worked like this but exception coming
"EXECUTE cannot be used as a source when inserting into a table variable.
"


i have worked like this

create proc asas
as
select USERID,CHECKTIME from CheckInout

i call procedure like this

declare @ttt table (USERID int,CHECKTIME datetime)
insert into @ttt
exec asas

kindly help Thanks In Advance

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2011-04-23 : 16:14:30
I'm guessing you're using an old version of sql server. Can't remember when this came in.
You'll probably have to us a temp table rather than a table variable.

==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

asif372
Posting Yak Master

100 Posts

Posted - 2011-04-23 : 16:23:47
i am using sql 2000 kindly help me how to solve this problem using sql 2000 thanks
Go to Top of Page

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2011-04-23 : 16:26:20
Use a temp table rather than a table variable.
create table #ttt (USERID int,CHECKTIME datetime)
insert into #ttt
exec asas


==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

asif372
Posting Yak Master

100 Posts

Posted - 2011-04-25 : 01:37:08
I have Tried This but Same Problem Occurs that execute cannot be use in Insert Function
Go to Top of Page

youky
Starting Member

5 Posts

Posted - 2011-04-25 : 02:34:56
unspammed
Go to Top of Page
   

- Advertisement -