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 |
raffiq_eddy
Starting Member
12 Posts |
Posted - 2006-07-08 : 01:10:39
|
Hello Expert!I have 2 Database – Access & SQLServer(ver 7)I need to Import Data TblShift from Access to SQLServer – using DTS I’ve done this successfully!Now I want to use parameter so I only importing record within range (e.g. From Date: May-24-2006 to Jun-23-2006)In SQLServer, I have created table to store the date range as following:TblParameterDateFrom: 04/24/2006DateTo: 05/23/2006 How do I use the date range from TblParameter(SQLServer) to import record from TblShift(Access) with DTS?Is this possible, or any better solution?TIARegards, |
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2006-07-08 : 10:12:44
|
In dts you should be able to specify the source as a query.Otherwise you can create a linked table in the access database to the sql server table and use an insert query in access to copy the data.You can do a similar thing in sql server - create a linked server to the access database and insert from a query.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
raffiq_eddy
Starting Member
12 Posts |
Posted - 2006-07-09 : 22:46:02
|
Hi nr,I'm new to SQLServer, pls forgive me if I ask wrong (stupid!) question.I like the 1st solution "In dts you should be able to specify the source as a query"In the Data Transformation Property -> source -> I’m using query as u saidHere is the query sample (source: Access):SELECT * FROM ShiftTransfer But how do I specific the range date from table TblParameter located in sqlServer?I try this but fail:SELECT * FROM ShiftTransferWHERE ShiftDate BETWEEN SQLServer1.dbo.FromDate AND SQLServer1.dbo.ToDate Am I missing something?quote: Originally posted by nr In dts you should be able to specify the source as a query.Otherwise you can create a linked table in the access database to the sql server table and use an insert query in access to copy the data.You can do a similar thing in sql server - create a linked server to the access database and insert from a query.
|
 |
|
|
|
|