stored procedures and SELECT * FROM table  
Author Message
Chandrashekhar





PostPosted: Wed Apr 07 08:51:07 CDT 2004 Top

SQL Server Developer >> stored procedures and SELECT * FROM table

Hi,

I am trying to create a stored procedure which does a
SELECT * FROM sometable. Next I want to reference certain of the
variables in the result set. How does one get at the data in T-SQL?
Do I need a cursor or a table or something? I'm looking for something
like a recordset in ADO that I can reference, but I'm a little new to
stored procedures.
Thanks, Tony C.

SQL Server259  
 
 
David





PostPosted: Wed Apr 07 08:51:07 CDT 2004 Top

SQL Server Developer >> stored procedures and SELECT * FROM table http://www.sommarskog.se/share_data.html

--
David Portas
SQL Server MVP
--


 
 
Adam





PostPosted: Wed Apr 07 08:57:27 CDT 2004 Top

SQL Server Developer >> stored procedures and SELECT * FROM table You can select into a temp table, but it might be better to post DDL, some
sample data, and what you're trying to accomplish and we can try to help you
come up with a better solution; temp tables should generally be reserved for
very particular cases only...

Here is one way to populate a temp table, in case you decide to go that
route:

SELECT (column list)
INTO #YourTable
FROM SomeTable




>
>
> Hi,
>
> I am trying to create a stored procedure which does a
> SELECT * FROM sometable. Next I want to reference certain of the
> variables in the result set. How does one get at the data in T-SQL?
> Do I need a cursor or a table or something? I'm looking for something
> like a recordset in ADO that I can reference, but I'm a little new to
> stored procedures.
> Thanks, Tony C.
>
>


 
 
Tony





PostPosted: Wed Apr 07 09:14:10 CDT 2004 Top

SQL Server Developer >> stored procedures and SELECT * FROM table Thank you both for the help !!


On Wed, 7 Apr 2004 14:51:16 +0100, "David Portas"


>http://www.sommarskog.se/share_data.html
>
>--
>David Portas
>SQL Server MVP

 
 
Tony





PostPosted: Wed Apr 07 09:41:03 CDT 2004 Top

SQL Server Developer >> stored procedures and SELECT * FROM table I wast just trying to avoid typing out 28 different column names in
the select statement....
- I will try the various angles...





>Thank you both for the help !!
>