Showing posts with label flat. Show all posts
Showing posts with label flat. Show all posts

Monday, March 26, 2012

How to remove {CR}{LF} and Tab {t} characters from source data?

I have built a SSIS package that reads in data from a SQL Server 2005 source database into a flat file destination. The Row Delimiter is {CR}{LF}. The Column Delimiter is Tab {t}.

The data being read from the SQL Server database contains both {CR}{LF} and Tab {t} characters in various fields on several rows.

How can I process the input data from the SQL Server to remove these characters before passing it to the destination output file?

Sorry if this is obvious to all, but I am only just starting with SSIS...

Many thanks

Adrian

If you have the data in a DT_STR ro DT_WSTR column, you can use the Derived Column transform with a REPLACE() function to replace those characters with empty strings.

Otherwise, you might want to use a Script component.

Thanks
Mark

Monday, March 19, 2012

How to redirect the error of a source Flat file to the Destination Flat file?

Hi all,

I m using SSIS and i am transfering the data from Flat File Source to the OLE DB destination File. The source file contain some corrupt data which i am transfering to the other Flat file destination file.

Debugging is succesful but i am not getting any error output in the Flat file destination file.

i had done exactly which is written in the msdn tutorial of SSIS.

Plz tell me why i am not getting the error output in the destination flat file?

thanx

have you set the Error Output to "Redirect Row" on the task ?

Friday, March 9, 2012

How to read the content of a flat file in Stored procedure

Hi there,
How to read the content of a flat file in Stored procedure into a
variable? I am also trying to find the size of a given flat file into a
variable in stored procedure.
Does anybody have any ideas on these?
Thanks in advance,
-- Sree
*** Sent via Developersdex http://www.examnotes.net ***Perhaps you can use the T-SQL command BULK INSERT. You will have to read
the data into a table.
as far as finding out the file attributes (file size) - perhaps you can use
xp_cmdshell to give you the "dos" level information.
Keith Kratochvil
"sasachi sachi sachi" <sasachi@.getmail.com> wrote in message
news:OYLTC%23UbGHA.404@.TK2MSFTNGP04.phx.gbl...
> Hi there,
> How to read the content of a flat file in Stored procedure into a
> variable? I am also trying to find the size of a given flat file into a
> variable in stored procedure.
> Does anybody have any ideas on these?
> Thanks in advance,
> -- Sree
> *** Sent via Developersdex http://www.examnotes.net ***|||to get the file size use this
declare @.FileName VARCHAR(149)
SELECT @.FileName ='C:\Program Files\Microsoft SQL
Server\MSSQL\readme.txt'
EXEC master..xp_getfiledetails @.FileName
Denis the SQL Menace
http://sqlservercode.blogspot.com/|||EXEC master..xp_getfiledetails @.file
"Keith Kratochvil" wrote:

> Perhaps you can use the T-SQL command BULK INSERT. You will have to read
> the data into a table.
> as far as finding out the file attributes (file size) - perhaps you can us
e
> xp_cmdshell to give you the "dos" level information.
> --
> Keith Kratochvil
>
> "sasachi sachi sachi" <sasachi@.getmail.com> wrote in message
> news:OYLTC%23UbGHA.404@.TK2MSFTNGP04.phx.gbl...
>
>|||Also, yu can access that using xp_cmdshell.
SET @.cmd='DIR '+@.outputfolder
EXEC @.res=master..xp_cmdshell @.cmd
"sasachi sachi sachi"?? ??? ??:

> Hi there,
> How to read the content of a flat file in Stored procedure into a
> variable? I am also trying to find the size of a given flat file into a
> variable in stored procedure.
> Does anybody have any ideas on these?
> Thanks in advance,
> -- Sree
> *** Sent via Developersdex http://www.examnotes.net ***
>