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 ***
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment