Groups | Blog | Home
all groups > sql server dts > october 2004 >

sql server dts : DTS: SQL Syntax Error


Steve
10/21/2004 9:23:50 AM
Hi,

I have created automated partitoned tables. When the DTS package runs a
table is created automtaically with week# as extension.
For example customers43 this week. And next week when the package runs
customers44 is created. Now I want to insert the data in the partiotned table
weekly.
I am using following syntax to Bulk insert the data in the newly created
table(Using execute SQL task to do this). But I am getting error.


declare @a varchar(25)

select @a = name from sysobjects where name like 'customers%'
and crdate > getdate() - .5

BULK INSERT Costco_Demo..@a FROM 'C:\FolderA\cust.txt'

Can someone please fix the syntax.


Thanks

Allan Mitchell
10/21/2004 9:28:09 PM
You will need to build the whole statement dynamically and then execute it.

You could also set the DestinationObjectName property of the DataPump task
to be your new table as all the attributes will be the same right?

--
--

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


[quoted text, click to view]

AddThis Social Bookmark Button