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 |
Shadab Shah
Starting Member
23 Posts |
Posted - 2012-07-30 : 23:13:28
|
Hi All,I am new to SQL Server.Prior to this i had done some programming in C.Consider the below query, select empid from Emp where deptid=2.The output of the above query isempid1345101415181920now i want to store this values in variable and then used the variable in some future query. Since i cannot used array i would like to know what to used. |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
|
Shadab Shah
Starting Member
23 Posts |
Posted - 2012-07-31 : 00:09:09
|
Thanks khtan. It was a good article but did not resolve my query. I am still curious to know what can be done in the above scenario. I had tried using a variable but it stores only the last variable.I would apprciate your time if you try to explain. |
 |
|
LoztInSpace
Aged Yak Warrior
940 Posts |
Posted - 2012-07-31 : 01:59:39
|
What are you going to do with the data? If you're going to use it in another query then you should just incorporate the SQL into the other query.One of the worst things you can do in RDBMS is take copies of data or somehow cache it. It just does not work in that way and you'll be fighting it the whole way.Tell us what you're after and we can help. As an ex C programmer myself I understand your position but you need to get over it. |
 |
|
|
|
|