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 |
|
dasu
Posting Yak Master
104 Posts |
Posted - 2004-08-23 : 10:42:13
|
| hi, every one i am very happy with ur solutions. now again i got a problem like this can u suggest me proper solution please i have a table which has two fields and two records like this table: test fields: id , name records 123 dasu 124 ditch like that what i want is 1. select id,name from test this is sql task i want to store this info into global result set record wise 2.i want take the global reslt set and i want looping entire result set this should be in vb script so 1 and 2 steps are imp for my package if any body please suggest me proper solution thank u regards dasu.g |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2004-08-23 : 11:09:23
|
| what do you mean by global result set???you can insert your data into a global temp table:select id,name into ##globalTempTable from testfor looping in vbif you're using .net you can do:dataset ds;dataAdapter.Fill(ds)and loop the dataset.and if you want to loop in VB, why not simply use a stored procedure??if above isn't what you want, give us more info.Go with the flow & have fun! Else fight the flow :) |
 |
|
|
dasu
Posting Yak Master
104 Posts |
Posted - 2004-08-23 : 23:07:12
|
| i donot know if globalresult set available or noti want capture the info into some global variable(capable of holding record sets) from select statemmentcan u suggest me the solution for above thing |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2004-08-24 : 03:59:28
|
| ok, but global where? in sql server or VB?in sql server a global table is selected like this:SELECT Id, name into ##tembpTable FROM testselect * from ##tembpTablein .net you can use static dataset which can be "global". same in VB only with recordset.as i understand your problem, you simply need to select the records and loop through them in VB?so do "SELECT Id, name FROM test"save into a recordset or dataset and loop through it...in .net use:foreach(DataRow row in ds.Tables[0].Rows){// do stuff}in VB use:while(!rs.EOF){// do stuff}if that's not what you want, we'll need some more information....Go with the flow & have fun! Else fight the flow :) |
 |
|
|
Tracey
Starting Member
40 Posts |
Posted - 2004-08-24 : 22:51:13
|
| I guess you(DASU)talking about DTS package? |
 |
|
|
|
|
|