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 2000 Forums
 Transact-SQL (2000)
 dbtask with global resultset

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 test

for looping in vb
if 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 :)
Go to Top of Page

dasu
Posting Yak Master

104 Posts

Posted - 2004-08-23 : 23:07:12
i donot know if globalresult set available or not
i want capture the info into some global variable(capable of holding record sets) from select statemment
can u suggest me the solution for above thing
Go to Top of Page

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 test
select * from ##tembpTable

in .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 :)
Go to Top of Page

Tracey
Starting Member

40 Posts

Posted - 2004-08-24 : 22:51:13
I guess you(DASU)talking about DTS package?
Go to Top of Page
   

- Advertisement -