Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

SQL SERVER 2000/2005

Posted on 2009-04-08
9
Medium Priority
?
195 Views
Last Modified: 2012-05-06
I am using query analyzer to run the script .script is so longer.I want to verify or check which stage  has been completed during the script is running like when we take a backup its shows percentage 10,20 and so on .....on the
message window in the query anaylzer

Can I add this information in my script

Thanks
0
Comment
Question by:furqan_trakker
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
  • +1
9 Comments
 
LVL 5

Expert Comment

by:mfhorizon
ID: 24094657
Hi furqan_trakker,

If your script is so longer and you want confirmation of execution in between, assuming that code is 1000 lines, i would select first 100 lines of code with taking care 100th line is with complete syntax and will EXECUTE the script, it will confirm me in the Message Pane below. I will comment these lines and will select next 100 lines with complete syntax and will repeat it until my script is completed.

Other way is you can program a vb form which executes every command and shows you result in a text box....

Hope you will find it well.

Cheers!!
0
 
LVL 12

Accepted Solution

by:
udaya kumar laligondla earned 2000 total points
ID: 24094673
add statements for each stage as
Print "stage A1"
this will print when ever a stage is reached
0
 

Author Comment

by:furqan_trakker
ID: 24094709
Hello mfhorizon
have you taken a backup of a database on query analyzer ?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Expert Comment

by:TejasShahMscIT
ID: 24094769
Hi,

You can write "select 'Upto here' OR PRINT 'Upto here' " to make sure upto which line code has run.

0
 

Author Comment

by:furqan_trakker
ID: 24094850
I have added print statement after some lines of code but messages print all at the same time just
code split into 6 stages

print 'Stage 1 Completed'
print 'Stage 2 Completed' and so on

but its print all after script completed
0
 
LVL 12

Expert Comment

by:udaya kumar laligondla
ID: 24094919
use GO after the print statement
if you have configured some thing else as batch seperated use the same.
0
 
LVL 5

Expert Comment

by:mfhorizon
ID: 24094967
Yes, you must use GO to tell the interpretor to execute next queries...
0
 
LVL 5

Expert Comment

by:mfhorizon
ID: 24094975
Bakckup on query analyzer is simply like this

BACKUP DATABASE [MCI] TO  DISK = N'local_path\backupname.bak' WITH NOFORMAT, NOINIT,  NAME = N'MCI-Full Database Backup', SKIP, NOREWIND, NOUNLOAD,  STATS = 10
GO
0
 
LVL 5

Expert Comment

by:mfhorizon
ID: 24095041
TRY TO CHECK YOU EXISTING SCRIPT SHOULD NOT HAVE "SET ECHO OFF" OR ANY OTHER SQL COMMAND THAT PUTS THE OUTPUT MESSAGE OFF. If you find comment it and the try!!
0

Featured Post

What Is Blockchain Technology?

Blockchain is a technology that underpins the success of Bitcoin and other digital currencies, but it has uses far beyond finance. Learn how blockchain works and why it is proving disruptive to other areas of IT.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

by Mark Wills PIVOT is a great facility and solves many an EAV (Entity - Attribute - Value) type transformation where we need the information held as data within a column to become columns in their own right. Now, in some cases that is relatively…
INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question