Link to home
Start Free TrialLog in
Avatar of WeTi
WeTi

asked on

Help with scripting the SQL and show result

Dear expert, I want to write a script that first it does a SQLquery, and then it will count the query. for exemple: query will show a result of 145 row of data. I want first to show that this SQLquery is done and run in current date, if it's failed it will show the error message, then I want show the result of 145 number.

Is this possible to do? Thanks.
ASKER CERTIFIED SOLUTION
Avatar of Vitor Montalvão
Vitor Montalvão
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of WeTi
WeTi

ASKER

What is the output for @@ROWCOUNT? A number?
Yes. Just a number.
I've used PRINT command but you can also use SELECT @@ROWCOUNT.
It really depends on how you're going to use it.
Avatar of WeTi

ASKER

Then I want this number to show in a xml file... this will be abit harder, and I also want this xml to show if error it will print out red text in the table.
I can only answer the SQL Server part as I'm not used to work with XML.
I would suggest you to open a new question in XML topic so the right Experts can help you achieve what you want.