Change "datetime" to CONVERT( varchar, Current_Timestamp, 120 ). Look in
Books Online for a suitable format. You may want to use REPLACE to
change the dashes, colons and spaces to something a little more file
name friendly.
marie price wrote:
> hello all,
>
> I a trying to run an extract using a job, the file must have the date
> appended to it, any idea on how I can do that?
>
>
> exec master..xp_cmdshell
>
> 'bcp "select id+name + paddress from haltondb.marie.dailyimport" queryout
> "\\hrpalarm\DailyImport\Dailyimport.txt"+datetime -c -T'
>
>
>
>
> ---------------------------------------------------------------------
> TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
> Website : http://www.LazyDBA.com
> To unsubscribe: http://www.lazydba.com/unsubscribe.html
>
>
>
MS Sql Server LazyDBA home page