2012年2月18日星期六

BCP

Hi Guys,
I have data that I need BCP'd out of a database into a file. The BCP
process works, however there is always an additional line at the end of
the created file. This line contains no data, and is caused (I assume),
but a <CR> at the end of the previous line (Row delimiter). This
however causes major problems for the UNIX import application.
Is there a way to remove this last line?
Thanks,
JustinAfter that BCP command, create a new task (if you are within a DTS) which
open the file through FSO and drop that line.
regards
--
current location: alicante (es)
"justin.drennan@.gmail.com" wrote:

> Hi Guys,
> I have data that I need BCP'd out of a database into a file. The BCP
> process works, however there is always an additional line at the end of
> the created file. This line contains no data, and is caused (I assume),
> but a <CR> at the end of the previous line (Row delimiter). This
> however causes major problems for the UNIX import application.
> Is there a way to remove this last line?
> Thanks,
> Justin
>|||And if im not using DTS? Any ideas?|||if you're using a stored procedure you could use the set of system stored
procedures such as sp_OACreate, sp_OAMethod, in order to work with FSO.
Something like that:
DECLARE @.object int
DECLARE @.hr int
EXEC @.hr = sp_OACreate 'Scripting.FileSystemObject', @.object OUT
Hope that helps.
current location: alicante (es)
"justin.drennan@.gmail.com" wrote:

> And if im not using DTS? Any ideas?
>

没有评论:

发表评论