Re: SQL Server DTS From Sybase
From: Allan Mitchell (allan_at_no-spam.sqldts.com)
Date: 12/02/04
- Next message: Ed: "Re: DTS import - all data not imported"
- Previous message: Kayda: "SQL Server DTS From Sybase"
- In reply to: Kayda: "SQL Server DTS From Sybase"
- Next in thread: Kayda: "Re: SQL Server DTS From Sybase"
- Reply: Kayda: "Re: SQL Server DTS From Sybase"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 2 Dec 2004 21:52:14 -0000
The way I would do it is
1. Build a DataPump between objects of the same structure that you will be
using
2. Add an ExecuteSQL task to create the new table
3. Add An Active Script task to the start
4. Use this article to figure out how to dynamically use Dates
How can I change the filename for a text file connection?
(http://www.sqldts.com/default.aspx?200)
5. Assign the new Table name using dates to the SourceObjectName of the
DataPump task and the new table to the DestinationObjectName of the DataPump
task
Changing the DataPump Source and Destination Tables
(http://www.sqldts.com/default.aspx?213)
-- -- Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) www.SQLDTS.com - The site for all your DTS needs. www.konesans.com - Consultancy from the people who know "Kayda" <shop@pacifictabla.com> wrote in message news:2642ccfe.0412021331.79cec058@posting.google.com... > Hi: > I want to import data from a Sybase database via a SQL Server DTS package. > The database views in Sybase I will be importing from all have different > names according to the date of the data in that view. For example: > > database.dbo.SybaseView20041122 > > only has data for Nov. 22, 2004. I want to put all the data from these > tables on a daily basis into a table called "DataFromYesterday". So in the > previous example the package would run on Nov. 23, 2004 and figure out > what > the view name is for yesterday and put the data into the table I just > metioned. > > If the data were in SQL Server already, I would simply set up a DTS > package > and use a query to select the data: > > declare @V1 varchar(4000) > declare @sql varchar(4000) > select @V1 = 'SQLServerDB.dbo.SQLTable' + convert(varchar(8), getdate()-1, > 112) > select @sql = 'SELECT * FROM ' + @V1 > > EXEC (@sql) > > This would dynamically figure out the table name and get the data from > yesterday, which would be contained in the table > "SQLServerDB.dbo.SQLTable20041201". I then output to a table called > "DataFromYesterday". > > However, when I try to use the same method in a DTS package from Sybase I > get an error, saying "datatype INT not compatible with datetime", or > something like that. > > Is it possible to do this and import the data from Sybase? > > Thanks!
- Next message: Ed: "Re: DTS import - all data not imported"
- Previous message: Kayda: "SQL Server DTS From Sybase"
- In reply to: Kayda: "SQL Server DTS From Sybase"
- Next in thread: Kayda: "Re: SQL Server DTS From Sybase"
- Reply: Kayda: "Re: SQL Server DTS From Sybase"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|