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.
Author |
Topic |
Jomypgeorge
Starting Member
31 Posts |
Posted - 2010-10-28 : 03:21:00
|
Hi friends,i have a problem in stored procedure.in some stored procedures i have to return a dataset with more than one table. By default tables are named as 'table1', 'table2'....is there any way to give some alias name for these tables in select query?.Thanks in advance.... |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-10-28 : 03:25:18
|
Can you give an example of what you mean/trying to do? No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
Jomypgeorge
Starting Member
31 Posts |
Posted - 2010-10-28 : 03:42:10
|
My stored procedure looks like thisCREATE PROCEDURE spdatasetASBEGIN Select 'name' as [Name], '12' as [Number] Select 'name' as [Name], 'address' as [Addresss]ENDGOOn executing this sp from front end, first result is placed in 'table1' and second result in 'table2' can i give these results some meaningful names like 'NumberTable' and 'AddressTable' ? |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-10-28 : 06:14:43
|
select * from(Select 'name' as [Name], '12' as [Number]) as NumberTableselect * from (Select 'name' as [Name], 'address' as [Addresss]) as AddressTableMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|