Wednesday, March 28, 2012

Importing text file

Hi all,
I'm importing a text-file into a SQL table, The catch is, I want to run a UDF on one of the columns before it gets added to the table... I would like to do the importing, and conversion in one step, and i'd prefer to do this using bulk insert, or bcp if I
have to, as this will run frequently on the data. ANY help will be greatly appreciated.
Rival
Your best bet would be to use SQL Server Data Transforation Services (DTS),
as you would be able to perform the transformations required and import all
in one step. For more information refer to Data Transformation Services in
SQL Server Books Online (BOL). A good DTS reference site is www.sqldts.com.
--
PETER WARD
WARDY Inc.
www.wardyinc.com
"Rival" <anonymous@.discussions.microsoft.com> wrote in message
news:5D60CE30-BFA2-4F13-BE8D-64059DE91D82@.microsoft.com...
> Hi all,
> I'm importing a text-file into a SQL table, The catch is, I want to run a
UDF on one of the columns before it gets added to the table... I would like
to do the importing, and conversion in one step, and i'd prefer to do this
using bulk insert, or bcp if I have to, as this will run frequently on the
data. ANY help will be greatly appreciated.
|||Rival,
Bear in mind that some UDFs will not be set based, ie they will operate row
by row and will be poor performers. Look into DTS, or bcp into a staging
table and then run a single INSERT...SELECT statement to your destination.
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
"Rival" <anonymous@.discussions.microsoft.com> wrote in message
news:5D60CE30-BFA2-4F13-BE8D-64059DE91D82@.microsoft.com...
> Hi all,
> I'm importing a text-file into a SQL table, The catch is, I want to run a
UDF on one of the columns before it gets added to the table... I would like
to do the importing, and conversion in one step, and i'd prefer to do this
using bulk insert, or bcp if I have to, as this will run frequently on the
data. ANY help will be greatly appreciated.
sql

No comments:

Post a Comment