473,387 Members | 1,549 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Echo sql which has been run

I am relatively new to SQL Server.

I have a command file with the following contents :
osql -E -i%1.sql -d%2 -oq:\%1.log

The sql script file has a number of insert/update statements.
The log file produced looks something like this :

1> 2> (1 row affected)
1> 2> (1 row affected)
1> 2> (0 rows affected)

Is there any setting which can be turned on such that the log file
produced from this command file will echo the statement and then
the number of rows which are affected.

TIA.
Jul 20 '05 #1
1 7043

"Michael McGarrigle" <mj*@barwonwater.vic.gov.au> wrote in message
news:9d**************************@posting.google.c om...
I am relatively new to SQL Server.

I have a command file with the following contents :
osql -E -i%1.sql -d%2 -oq:\%1.log

The sql script file has a number of insert/update statements.
The log file produced looks something like this :

1> 2> (1 row affected)
1> 2> (1 row affected)
1> 2> (0 rows affected)

Is there any setting which can be turned on such that the log file
produced from this command file will echo the statement and then
the number of rows which are affected.

TIA.


You can try adding -e -n to your command line. It works best if each
statement is in its own batch:

update...
go
insert...
go

Like that, you get each statement with the rowcount immediately after it. If
all statements are in one batch, you'll get all the statements together then
all the rowcounts together. That might be OK for you anyway, of course.

Simon
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: lawrence | last post by:
Right now, over at www.monkeyclaus.org, the following script is getting to the 9th run through and dying after the line: echo "..."; You'll admit that is a strange place to die. I've hit...
3
by: Michael Flanagan | last post by:
Of course "echo" is working, but I've got a case where php doesn't seem to be sending out the result of an "echo." I'm probably doing something wrong, but I can't see it. I've got the following...
6
by: Marco | last post by:
I have a couple pages that have tables, whats best use echo to produce the full table with the variables or is it best to just make the table in plain html and use <?php echo ('$va'l); ?> when i...
9
by: Domestos | last post by:
Here an unusual one... Say i am writing a few lines of code in php script as so... <?php echo '<table>'; echo '<tr>'; echo '<td> blah blah </td>'; echo '</tr>'; echo '</table>';
9
by: windandwaves | last post by:
Hi Folk My question is: echo all the time vs echo at the end - what is faster Let me explain I used to write pages like this: echo "<head> ";
25
by: Jon Slaughter | last post by:
I have some code that loads up some php/html files and does a few things to them and ultimately returns an html file with some php code in it. I then pass that file onto the user by using echo. Of...
4
by: rawky1976 | last post by:
Hi, I have a hyperlink which goes to the page below and passes the PK_ID from a query into 'userid'. From this we query the DB and then echo a table with a form; only the textboxes are already...
1
by: sheel331 | last post by:
Hello, I am new to coding in PHP, and had a question about a simple thing: I am trying to echo out the elements of an array for a sidenav in one of my HTML pages, and I can't seem to figure out...
11
by: Twayne | last post by:
Hi, Irrelevant question time, probably: Is there any advantage/reason to use one format over the other for the following two types of echo statements? 1. echo "error is " . $error; 2. ...
32
by: Request-1 | last post by:
hi folks, html coder here, new and terrified * of php!! aaaaaa! i'm trying to bury a JS script to rotate a photo, in a page i converted from html to php. the conversion went well, it was to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.