SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SQLCMD or BCP


SQLCMD or BCP

Author
Message
Bhavesh-257515
Bhavesh-257515
SSC Journeyman
SSC Journeyman (77 reputation)SSC Journeyman (77 reputation)SSC Journeyman (77 reputation)SSC Journeyman (77 reputation)SSC Journeyman (77 reputation)SSC Journeyman (77 reputation)SSC Journeyman (77 reputation)SSC Journeyman (77 reputation)

Group: General Forum Members
Points: 77 Visits: 60
Comments posted to this topic are about the item SQLCMD or BCP
Dr. Diana Dee
Dr. Diana Dee
Hall of Fame
Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)

Group: General Forum Members
Points: 3431 Visits: 143
The sqlcmd reference says that a file from a previous sqlcmd will be overwritten. So please tell me the syntax you were referring to that would append to the file.
Marius Els
Marius Els
Old Hand
Old Hand (340 reputation)Old Hand (340 reputation)Old Hand (340 reputation)Old Hand (340 reputation)Old Hand (340 reputation)Old Hand (340 reputation)Old Hand (340 reputation)Old Hand (340 reputation)

Group: General Forum Members
Points: 340 Visits: 180
I seem to have taken the "append" piece out of the equation Ermm......
Robert-378556
Robert-378556
SSCrazy
SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)

Group: General Forum Members
Points: 2360 Visits: 1010
BCP outputs data to a file, SQLCMD to a file or console, so you can redirect console to a file with > or >>:
rem create output.txt
sqlcmd commands > Output.txt
rem append to output.txt
sqlcmd commands >> Output.txt
RichB
RichB
Hall of Fame
Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)

Group: General Forum Members
Points: 3026 Visits: 1065
so why can't you then append the file bcp outputs to the existing file...?



ben.pittoors
ben.pittoors
SSC-Enthusiastic
SSC-Enthusiastic (189 reputation)SSC-Enthusiastic (189 reputation)SSC-Enthusiastic (189 reputation)SSC-Enthusiastic (189 reputation)SSC-Enthusiastic (189 reputation)SSC-Enthusiastic (189 reputation)SSC-Enthusiastic (189 reputation)SSC-Enthusiastic (189 reputation)

Group: General Forum Members
Points: 189 Visits: 62
I got the question correct. However, and it's not the first time that I have noticed this on sqlservercentral. It's not 'DOS'! DOS died a long time ago. Refer to it as 'windows text console' or 'windows command line shell' instead or even cmd.exe ;-)

It's got nothing to do with DOS anymore; although it is based on the DOS command line shell (command.com) specifications.
Robert-378556
Robert-378556
SSCrazy
SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)

Group: General Forum Members
Points: 2360 Visits: 1010
On the contrary. CMD.exe is DOS. It will execute any well behaved DOS executable, so it provides complete DOC environment. At least 32bit version, 64bit version refuses to run any 16bit application, which DOS applications normally are.
Additionally, it provides DOS compatible text mode console (terminal) for windows applications with all standard devices as stdin, stdout, stderr, nul, prn, lpt1, redirection, etc.

Windows 3.x and older, 95, 98, ME were all graphics shell on top of DOS, while NT series does not depend on DOS.
Christian Buettner-167247
Christian Buettner-167247
SSCertifiable
SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)

Group: General Forum Members
Points: 5321 Visits: 3889
RichardB (11/21/2008)
so why can't you then append the file bcp outputs to the existing file...?

RichardB, you cannot pipe your data out with BCP like with SQLCMD.

Best Regards,

Chris Büttner
ben.pittoors
ben.pittoors
SSC-Enthusiastic
SSC-Enthusiastic (189 reputation)SSC-Enthusiastic (189 reputation)SSC-Enthusiastic (189 reputation)SSC-Enthusiastic (189 reputation)SSC-Enthusiastic (189 reputation)SSC-Enthusiastic (189 reputation)SSC-Enthusiastic (189 reputation)SSC-Enthusiastic (189 reputation)

Group: General Forum Members
Points: 189 Visits: 62
Robert (11/21/2008)
On the contrary. CMD.exe is DOS. It will execute any well behaved DOS executable, so it provides complete DOC environment. At least 32bit version, 64bit version refuses to run any 16bit application, which DOS applications normally are.
Additionally, it provides DOS compatible text mode console (terminal) for windows applications with all standard devices as stdin, stdout, stderr, nul, prn, lpt1, redirection, etc.

Windows 3.x and older, 95, 98, ME were all graphics shell on top of DOS, while NT series does not depend on DOS.


I beg to differ. If anything COMMAND.COM was the command line shell of DOS and CMD.EXE is that of Windows. It may be compatible with some legacy DOS apps (but not that many... hence the existence of dos emulators like DOSBOX etc.) but that doesn't mean it is the same thing.

More info: wikipedia to the rescue
Robert-378556
Robert-378556
SSCrazy
SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)

Group: General Forum Members
Points: 2360 Visits: 1010
You're free do disagree. DOS was an OS at the time and command.com was its command shell. It abstracted access to some devices like printer, serial ports and disks. If provided file system. It had nothing to do with graphics cards, sound cards etc. CMD.EXE does the same thing, provides the DOS environment and a small part of hardware emulation (0xA000-0xFFFF mapping). So, DOS applications using this work perfectly, not knowing they're in windows application. Some applications (mostly games) needed hardware access to graphics and/or sound card, or other. For these you need an application like dosbox to emulate direct hardware access, which works great, runs almost any game without problems even on 64bit system.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search