Hey all,
A nice easy BCP question for y'all...
I'm currently running:
DECLARE @.sql varchar(2000)
SET @.sql = 'BCP master..sysobjects OUT C:\sysobjects.csv -c -t, -T -S' + @.@.ServerName
EXEC master..xp_cmdshell @.sql
Which works fine!
But how on earth do I save it to my local PC?
May sound silly, but this is one of my first adventures into BCP and I'd rather not "pollute" the server with my test files!
Thankyall!Maybe if you ran the bcp command from your local command line? There is no real reason you need xp_cmdshell.|||indeed. another possibility is to write the file to a share (but then you are susceptible to network glitches of course)
BCP master..sysobjects OUT \\SOME_OTHER_SERVER\sysobjects.csv ...|||There is no real reason you need xp_cmdshell.
Can I have a hit off of that?
This is the way I always do this
Unless I'm having a problem, then I do command line to get a better error message
George, what do you mean by pollute?
You can use xp_... to delete the damn files as well|||The guys downstairs get antsy when I leave csv files on the server that I maintain.
They polluted one of our production servers with an image of a laptop once (15Gb when we had 15.1Gb free!) and ever since then are very quick to point out when I leave a 0.5Mb csv on a production server.
anyhow, enough office politics.
I wouldn't know what to do from the command line - I tried running the above straight in (ok, I had 11 seconds left of my working day - I wasn't thorough (or bothered)) and I just got a "BCP is not a recognized function" (or similar).
Anyhow, it's pretty much a non-issue I suppose because I just have to remember to delete them, or as Brett suggested, I will go digging for the xp_.. to delete the bugger when I have some play time.
Thanks all :)|||oh never mind|||The guys downstairs get antsy when I leave csv files on the server that I maintain.
They polluted one of our production servers with an image of a laptop once (15Gb when we had 15.1Gb free!) and ever since then are very quick to point out when I leave a 0.5Mb csv on a production server.
Scrubs
This message is too short|||Anyhow, it's pretty much a non-issue I suppose because I just have to remember to delete them, or as Brett suggested, I will go digging for the xp_.. to delete the bugger when I have some play time.
It's called DOS youngster and the command is DEL. Kids today and their GUIs.
anyhow, enough office politics.
just remember one thing...
crush your enemies, drive them before you, and hear the lamentations of their women|||Sean, I learned a lot in DOS... But it's been far too long since I've had to use it!
Nothing would sodding run through the GUI on my Windows 3.0 PC ;)
Dir /w :D
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment