.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

messages from sqlcmd

Posted By:      Posted Date: September 01, 2010    Points: 0   Category :Sql Server
Would someone please explain this behavior? I'm trying to understand why the messages are coming back the way they are in the following examples. Create a simple table to which we will be inserting some values. create table test_table ( col1 int ) Next, create a sql script that inserts a bunch of integers to the above table. insert into test_table values(1) insert into test_table_ values(2) insert into test_table_ values(3) insert into test_table_ values(4) And save this file. I saved it as c:\dba\admin\test_script.sql Next, run this script from a command window using sqlcmd as follows. sqlcmd -S <your_server> -d <your_db> -i c:\dba\admin\test_script.sql   What message do you get back in the command window? I get "(1 rows affected)" for the first insert statement in the script, but nothing about the other 3 inserts. However, when I select from the table, I do see that all 4 insert statments happened. So, why am I seeing an incomplete message? Now, for the heck of it, I put a "GO" between the insert statements in test_script.sql like so. insert into test_table values(1) go insert into test_table values(2) go insert into test_table values(3) go insert into test_table values(4) Now, run the sqlcmd again like so, sqlcmd -S <your_server> -d <your_db> -i c:\dba\admin\test_script.sql What messages do you get? I get 4 lines of

View Complete Post

More Related Resource Links

SQLCMD: Changed Database Context messages

Is there a way to suppress the "Changed Database Context to " messages in SQLCMD?  For example, I get the following: 1> use master2> goChanged database context to 'master'.1>I am trying to migrate some legacy batch files that called isql and used the output files.  These extra "Changed Database Context to " messages are causing our scripts to break, and I was hoping to avoid having to write something extra to handle these messages.Thanks.

User messages without hard coding


Hi All,


How to manage user messages to avoid hardcoding messages accross the web application.





Test Run: Testing Silverlight Apps Using Messages


Silverlight greatly simplifies the process of building rich Web applications, and we'll walk through an example of using Messages as a quick method of interactively testing simple Silverlight apps.

James McCaffrey

MSDN Magazine March 2010

The Polyglot Programmer: Concurrency with Channels, Domains and Messages


Axum is not a general-purpose language like C# or VB, but one aimed squarely at the problem of concurrency, designed from the outset to be part of a suite of languages that collectively cooperate to solve a business problem.

Ted Neward

MSDN Magazine September 2009

.NET Matters: Handling Messages in Console Apps


Many developers who use the Microsoft .NET Framework think that application type is tied to the libraries that can be used in that application. Stephen Toub clarifies.

Stephen Toub

MSDN Magazine June 2007

Mobility: Add Keyboard Support to Compact Framework Apps by Trapping Windows Messages


The Compact Framework Control class doesn't provide direct access to Windows messages. However, with P/Invoke, a few lines of native code, and the Compact Framework MessageWindow class, it's still possible to access underlying Windows messages. This can be used to work around any .NET Framework features, including keyboard support, that are not included in the Compact Framework.

Alan Pulliam

MSDN Magazine April 2004

MSMQ and .NET: Send MSMQ Messages Securely Across the Internet with HTTP and SOAP


When creating a distributed system you frequently need to provide for communication between two entities that are not in sync. Microsoft Message Queue Server (MSMQ) provides the kind of store-and-forward messaging in a pre-built infrastructure that can help you address these kinds of messaging needs. In the past, MSMQ was accessed using a COM wrapper. Now there's a .NET wrapper that lets you accomplish your messaging goals easily from your Framework-based code. To illustrate the use of the wrapper, the author builds a messaging application, sends MSMQ messages over the Web, and discusses messaging security.

David S. Platt

MSDN Magazine December 2003

House of Web Services: Accessing Raw SOAP Messages in ASP.NET Web Services


Web Services exchange XML messages. Most of today's Web Service toolkits do their best to hide this fact from developers, by exposing a Web Service's behavior as method invocations against objects instead.

Tim Ewald

MSDN Magazine March 2003

DIME: Sending Files, Attachments, and SOAP Messages Via Direct Internet Message Encapsulation


Direct Internet Message Encapsulation (DIME) is a new specification for sending and receiving SOAP messages along with additional attachments, like binary files, XML fragments, and even other SOAP messages, using standard transport protocols like HTTP. In this article, the author explains what DIME is and how it differs from MIME encapsulation. A detailed description of the message format and how it is parsed, as well as working with SOAP and extending it with WSDL, is also included.

Jeannine Hall Gailey

MSDN Magazine December 2002

Quick Error messages with Global.asax

The article Quick Error messages with Global.asax was added by lykasd on Wednesday, August 11, 2010.

Error pages without any effort void Application_Error(object sender, EventArgs e) { Server.Transfer("/error.aspx"); //Displays the error page } In error.aspx add this to the content area. p>We&#39;re sorry, but the %=Server.GetLastError

What is the most efficient way to transmit XML messages in WCF?


Hi Folks,

What is the most efficient way to transmit messages in WCF?
I've done a few basic walkthroughs of WCF and upon analyzing the XML transmission I saw that they were very large by default. Containing what appears to me, as a lot of unnecessary information, for my needs.

I'm looking for a way to send the shortest messages possible.
How can I trim as much as possible from the XML?
Can I remove all the header information...

What approach to you suggest for sending the shortest messages possible using XML in WCF?


SQLCMD: supress "Changed database context to . . ."

Product:  2008 SQL Server Standard Edition. Shell:     SQLCMD (i.e. sqlcmd -i"test.sql")Script (test.sql):   use Master;   print $(SQLCMDERRORLEVEL)The screen output is always:   Changed database context to 'Master'   0However I want the above output to be (only):   0I have tried calling SQLCMD with the -m command line parameter set to each of the {-m-1, -m 0, -m 1} settings, but none work. I have tried: set SQLCMDERRORLEVEL = each of {-1,0,1,25), but none workAnybody know the secret?Thanks in advance,Jerry

sqlcmd, cannot connect to server

I have SQL Server installed on a machine called SQLDEV. I log on to that machine and I run the command sqlcmd -s SQLDEV -Q "select * from <db>.<schema>.<some_table> -E This command works and returns a result set.   Next, I go to a different machine. On that machine I can use SQL Mgmt Studio to log on to SQLDEV using window authentication. However, if I run the same command as above, I get some kind of a connection error. The error says, ".... When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections .....   Any suggestions/ideas why I am getting this error?
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend