Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12»»

SQLCMD or BCP Expand / Collapse
Author
Message
Posted Thursday, November 20, 2008 11:28 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, June 29, 2011 6:09 AM
Points: 29, Visits: 60
Comments posted to this topic are about the item SQLCMD or BCP
Post #606311
Posted Friday, November 21, 2008 12:03 AM
Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Thursday, September 25, 2014 1:21 PM
Points: 3,143, Visits: 139
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.
Post #606317
Posted Friday, November 21, 2008 12:08 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Monday, September 22, 2014 12:09 PM
Points: 217, Visits: 171
I seem to have taken the "append" piece out of the equation ......
Post #606320
Posted Friday, November 21, 2008 1:12 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Today @ 7:45 AM
Points: 1,253, Visits: 919
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
Post #606346
Posted Friday, November 21, 2008 2:44 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, October 7, 2014 8:38 AM
Points: 1,070, Visits: 908
so why can't you then append the file bcp outputs to the existing file...?


Post #606374
Posted Friday, November 21, 2008 4:31 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, June 13, 2013 2:18 AM
Points: 124, Visits: 55
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.
Post #606408
Posted Friday, November 21, 2008 5:36 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Today @ 7:45 AM
Points: 1,253, Visits: 919
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.
Post #606435
Posted Friday, November 21, 2008 5:38 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Tuesday, October 7, 2014 2:56 AM
Points: 2,842, Visits: 3,876
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
Post #606438
Posted Friday, November 21, 2008 6:07 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, June 13, 2013 2:18 AM
Points: 124, Visits: 55
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
Post #606451
Posted Friday, November 21, 2008 8:44 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Today @ 7:45 AM
Points: 1,253, Visits: 919
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.
Post #606586
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse