December 8, 2010 at 11:38 pm
Hi,
DECLARE @FILE VARCHAR(50)
DECALRE @x VARCHAR(8000)
SET @FILE='C:\ABC_'+(SELECT CONVERT(VARCHAR(20),GETDATE(),12))
SET @x ='bcp "select * from employee" queryout C:\ABC_101209.TXT ' -T -w
EXEC MASTER..xp_cmdshell @x
I would like to define the outputfile dynamically (C:\ABC_101209)
after the file name which should be in the form of YYMMDD .
Every time I execute the file has to be with the extension of yymmdd format.
December 9, 2010 at 12:30 am
This was removed by the editor as SPAM
December 9, 2010 at 12:46 am
Hi,
It's not working.Is there a way to rename the file.
Thanks,
Nagesh
December 9, 2010 at 1:20 am
This was removed by the editor as SPAM
December 9, 2010 at 3:11 am
Hi Stewart,
It's working now.Even the first statement also working.
Thansk a bunch.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply