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
 General SQL Server Forums
 New to SQL Server Programming
 Using SQL query in DTS

Author  Topic 

hotshot_21
Yak Posting Veteran

97 Posts

Posted - 2006-12-16 : 01:23:58
I want to transfer certain no. of records from on sqlserver to another.and i want to use DTS for this.but if there are say 100 records and if there flag status is 1 only then it shud be transferred otherwise not ,how sud i go abt it?

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2006-12-16 : 08:45:27
select top 100 yourColumns
from YourTable
where YourFlag = 1
order by YourOrderColumns



Go with the flow & have fun! Else fight the flow
blog thingie: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

madhuotp
Yak Posting Veteran

78 Posts

Posted - 2006-12-17 : 12:22:07
u create a View with the following body ;
select top 100 yourColumns
from YourTable
where YourFlag = 1
order by YourOrderColumns

and use this view in DTS

Madhu
Go to Top of Page

hotshot_21
Yak Posting Veteran

97 Posts

Posted - 2006-12-18 : 00:18:55
how do i use DTS in this.How do i include sql query in DTS. Package that is to be run at runtime.
Go to Top of Page

madhuotp
Yak Posting Veteran

78 Posts

Posted - 2006-12-18 : 01:56:45
Use Import/Export wizards and go step by step. Select the above mention view as as source. in the last screen (before click finsh button) u will have an option to save the package. save it and use it

Madhu
Go to Top of Page

hotshot_21
Yak Posting Veteran

97 Posts

Posted - 2006-12-18 : 06:09:25
Got a problem. Iam selecting rows from two table Where Flag is set to 'O' .Now when iam using DTS how do i transfer the data from both tables i.e data from 1st table on Source shud go to 1st table on DEStination Server.& data from 2nd table on source server shud go to 2nd table on Destination server. i want to do it in single DTS package how do i do it?wht query shud i use it?
Go to Top of Page

mwjdavidson
Aged Yak Warrior

735 Posts

Posted - 2006-12-18 : 08:07:59
You need another transformation task. You can use the same source and destination connections for both, but if you want the tasks to run in parallel, you'll need two new connections.

Mark
Go to Top of Page

hotshot_21
Yak Posting Veteran

97 Posts

Posted - 2006-12-19 : 01:01:22
i hav created two new connctions for 2nd table,when i execute the package in SQL enterprise it exectues perfectly.But when i run it in my .aspx page only !st table is getting transffered not the 2nd one.any suggestion
Go to Top of Page
   

- Advertisement -