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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 about stored procedures

Author  Topic 

shm
Yak Posting Veteran

86 Posts

Posted - 2008-10-01 : 09:27:16
hi,
i have not written the stored procedure(sp) till now in this..i have a doubt in that if i pass a parameter to the sp in that can i write a diff select stat and pass the result into the temp table? means if i write 3 diff select stat and from that i want result as a table...i want to know more detail about this....pls help me in this

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-10-01 : 09:42:48
[code]create procedure proc_test
(
@val int
)
as
if @val=1
select col1 from table1
else if @val=2
select col1,col2 from table2
else
select col1,col3,col5 from table3
[/code]

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -