Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
kenworld
Starting Member
1 Post |
Posted - 2014-11-26 : 08:56:25
|
When I run my SQL Job it's not creating the file on my specified path.JobDECLARE @sql VARCHAR (8000);SELECT @sql = bcp "SELECT * FROM LMP_DAILY.dbo.vw_DirDailyActual ORDER by Date, DirCode" out -o "T:\Shared Information\DB_Admin\dirdailyactual.csv" -T -c'; exec master..xp_cmdshell @sql;It returns the following:usage: bcp {dbtable | query} {in | out | queryout | format} datafile [-m maxerrors] [-f formatfile] [-e errfile] [-F firstrow] [-L lastrow] [-b batchsize] [-n native type] [-c character type] [-w wide character type] [-N keep non-text native] [-V file format version] [-q quoted identifier] [-C code page specifier] [-t field terminator] [-r row terminator]It looks like its a permission issue. I have write permissions to the folder that I'm trying to write too.kenworld |
|
ahmeds08
Aged Yak Warrior
737 Posts |
Posted - 2014-11-27 : 16:06:23
|
can you try thisDECLARE @sql VARCHAR (8000);SELECT @sql = 'bcp "SELECT * FROM LMP_DAILY.dbo.vw_DirDailyActual ORDER by Date, DirCode" queryout T:\Shared Information\DB_Admin\dirdailyactual.csv -T -c'; exec master..xp_cmdshell @sql;Javeed Ahmedhttps://www.linkedin.com/pub/javeed-ahmed/25/5b/95 |
|
|
|
|
|