sqlcmd

SQL Server: BCP vs SQLCMD - what is more efficient?

I'm writing a program in c# to export SQL Server data from one database and importing it in another. Since these two servers are not connected I need to choose a method such as bcp. What are the differences between these two? Is one more efficient than the other? And in what scenarios? What are the known limitations/compatibility issu...

trying to run sqlcmd fails, unable to establish connection?

When I try to run sqlcmd (from the cmd prompt) I get the following error: HResult 0x2, Level 16, State 1 Named Pipes Provider: Could not open a connection to SQL Server [2]. Sqlcmd: Error: Microsoft SQL Server Native Client 10.0 : A network-related or in stance-specific error has occurred while establishing a connection to SQL ...

Using double quotes in a T-SQL script fails in SQLCMD, but not SSMO

Executing the following script via sqlcmd fails. However, executing it via ssmo or SQL Server Management Studio works. sqlcmd -S . -d test -i input.sql input.sql: CREATE FUNCTION test() RETURNS @t TABLE ("ID" INT) AS BEGIN RETURN END Even when I put SQL Server Management Studio into sqlcmd mode, it still fails. This i...