dbTalk Databases Forums  

Newb: Managing multiple queries

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss Newb: Managing multiple queries in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Akhenaten
 
Posts: n/a

Default Newb: Managing multiple queries - 12-06-2007 , 12:38 PM






I am currently using enterprise manager to run multiple queries on a
single table in a DB. I refresh these queries every few minutes. Due
to the huge number of them I was looking for a better way (or should I
just say "a way") to manage/save these queries so I can recall them
easier/faster for monitoring purposes. Suggestions?

TIA.

Reply With Quote
  #2  
Old   
Tom van Stiphout
 
Posts: n/a

Default Re: Newb: Managing multiple queries - 12-06-2007 , 10:44 PM






On Thu, 6 Dec 2007 10:38:06 -0800 (PST), Akhenaten
<jonkokko (AT) gmail (DOT) com> wrote:

If I understand you correctly you need an application (Access ADP, or
..NET) to call your queries based on a timer or a button click. SQL
Server tools alone are probably not going to do the trick.

-Tom.



Quote:
I am currently using enterprise manager to run multiple queries on a
single table in a DB. I refresh these queries every few minutes. Due
to the huge number of them I was looking for a better way (or should I
just say "a way") to manage/save these queries so I can recall them
easier/faster for monitoring purposes. Suggestions?

TIA.

Reply With Quote
  #3  
Old   
Plamen Ratchev
 
Posts: n/a

Default Re: Managing multiple queries - 12-06-2007 , 10:45 PM



Hi,

Maybe creating a stored procedure (or more, if the queries are logically
grouped) will help you. Then you would need just to execute the stored
procedures in Query Analyzer (which is the tool intended to run queries
anyway). Alternatively you can save the queries to a script file, and then
open and run in Query Analyzer.

HTH,

Plamen Ratchev
http://www.SQLStudio.com


Reply With Quote
  #4  
Old   
scoots987
 
Posts: n/a

Default Re: Managing multiple queries - 12-09-2007 , 09:58 AM



On Dec 6, 10:45 pm, "Plamen Ratchev" <Pla... (AT) SQLStudio (DOT) com> wrote:
Quote:
Hi,

Maybe creating a stored procedure (or more, if the queries are logically
grouped) will help you. Then you would need just to execute the stored
procedures in Query Analyzer (which is the tool intended to run queries
anyway). Alternatively you can save the queries to a script file, and then
open and run in Query Analyzer.

HTH,

Plamen Ratchevhttp://www.SQLStudio.com
Are there examples of "script files"? I have a few files that are used
for creating databases and tables, but somehow I think there is more
potential in using scripts.

Thanks


Reply With Quote
  #5  
Old   
Plamen Ratchev
 
Posts: n/a

Default Re: Managing multiple queries - 12-10-2007 , 02:08 AM



Under "script files" I meant to save your frequently used SQL code to a
file, preferably with extension ".sql". Since you indicate you already save
your code to files, then you have your script files.

In SQL Server 2005, the SQL Server Management Studio adds a new capability
to organize scripts in projects (very similar to Visual Studio projects). It
is accessible via the File menu in SSMS (File -> New - > Project -> SQL
Server Scripts template).

Script files are good because they can be easily added to a source control
system.

HTH,

Plamen Ratchev
http://www.SQLStudio.com


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.