Showing posts with label analyzer. Show all posts
Showing posts with label analyzer. Show all posts

Friday, March 23, 2012

Running the same query on multiple servers

Hi, I periodically run the same query on multiple servers. Currently I
do this via query analyzer and would like to cut down the time it takes
to switch servers.
Is there a tool I can configure multiple connections on and run the same
query on selected servers.
Thanks
Dilan
create linked servers and run the queries as
select ... from servername.databasename.objectname
Dandy Weyn
[MCSE-MCSA-MCDBA-MCDST-MCT Community Leader]
SQL Server Technologist
http://www.dandyman.net
Check my SQL Server Resource Pages at http://www.dandyman.net/sql
"Dilan A" <dilan.a@.youtelus.net> wrote in message
news:up7hf.129920$S4.96172@.edtnps84...
> Hi, I periodically run the same query on multiple servers. Currently I do
> this via query analyzer and would like to cut down the time it takes to
> switch servers.
> Is there a tool I can configure multiple connections on and run the same
> query on selected servers.
> Thanks
> Dilan
|||Dandy Weyn [Dandyman] wrote:
> create linked servers and run the queries as
> select ... from servername.databasename.objectname
>
Thanks. I neglected to mention that the statements are always almost
updates to existing stored procedures and are supplied by our vendor as
patches. I received them as attachments in emails and have to save them
and then run them on about 8 servers.
Needless to say I am looking to click and go...
|||You can either use DMO or oSql to do this pretty easily. Both methods allow
you to easily connect to another server and issue the same commands. You do
have to write some code but it should only be a few lines and a google
search will most likely find some examples.
Andrew J. Kelly SQL MVP
"Dilan A" <dilan.a@.youtelus.net> wrote in message
news:up7hf.129920$S4.96172@.edtnps84...
> Hi, I periodically run the same query on multiple servers. Currently I do
> this via query analyzer and would like to cut down the time it takes to
> switch servers.
> Is there a tool I can configure multiple connections on and run the same
> query on selected servers.
> Thanks
> Dilan
|||I tend to just use a batch file e.g. create 3 folders Output,Servers,Source
under a main folder (in my example it's DBADeploy). Create a batchfile as
below called deploy.bat in C:\DBADeploy
@.echo off
FOR /F %%f in (C:\DBADeploy\Servers\servers.txt) do
C:\DBADeploy\Source\Update.bat %%f
In the Servers folder create a file called servers.txt which is a list of
the target servers
In the Source folder create a file called update.sql with you code in it
(including USE database statements) and a batch file called Update.bat with
the contents below
@.echo off
set server=%1
set outputtemp=%1
set outputtemp=%outputtemp:\=_%
set outputfile="C:\DBADeploy\Output\%outputtemp%.txt"
osql -S %server% -d master -n -E -w 200 -h-1 -l 15 -i
"C:\DBADeploy\Source\update.sql" -o %outputfile%
echo Completed %1
Once that's setup then anything you want to deploy you can just stick in
update.sql and run deploy.bat and you're done. You can check the output for
each server in the Output folder.
HTH
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Dilan A" <dilan.a@.youtelus.net> wrote in message
news:up7hf.129920$S4.96172@.edtnps84...
> Hi, I periodically run the same query on multiple servers. Currently I do
> this via query analyzer and would like to cut down the time it takes to
> switch servers.
> Is there a tool I can configure multiple connections on and run the same
> query on selected servers.
> Thanks
> Dilan

Tuesday, March 20, 2012

running sql on a different port

sql 2k, sp3a
For security reasons, I changed sql to run on a different port. I'm able to
get into Enterprise Manager and Query Analyzer just fine. However, when I
try to go into Object Manager in QA, I get a message that the connection has
been broken. It never allows me to see the objects. Is this a bug? Is
there a workaround?
As long as sql is running on port 1433 I can get into the object manager
just fine.
Thanks, Andrehave you tried creating an alias in client network utility and using the
alias to connect to the server?
Carlos E. Rojas
SQL Server MVP
Co-Author SQL Server 2000 programming by Example
"Andre" <AndreGetsEnoughSPAM@.nospam.com> wrote in message
news:eY8FrbtAEHA.1700@.TK2MSFTNGP12.phx.gbl...
> sql 2k, sp3a
> For security reasons, I changed sql to run on a different port. I'm able
to
> get into Enterprise Manager and Query Analyzer just fine. However, when I
> try to go into Object Manager in QA, I get a message that the connection
has
> been broken. It never allows me to see the objects. Is this a bug? Is
> there a workaround?
> As long as sql is running on port 1433 I can get into the object manager
> just fine.
> Thanks, Andre
>|||I have that in place.
"Carlos Eduardo Rojas" <carloser@.mindspring.com> wrote in message
news:uL07F9tAEHA.2112@.tk2msftngp13.phx.gbl...
> have you tried creating an alias in client network utility and using the
> alias to connect to the server?
> --
> Carlos E. Rojas
> SQL Server MVP
> Co-Author SQL Server 2000 programming by Example
>
> "Andre" <AndreGetsEnoughSPAM@.nospam.com> wrote in message
> news:eY8FrbtAEHA.1700@.TK2MSFTNGP12.phx.gbl...
able
> to
I
> has
>|||Actually, that worked. I'd created the alias but was still connecting to
'.'. Connecting to the alias was the trick. Thanks!
Andre
"Andre" <AndreGetsEnoughSPAM@.nospam.com> wrote in message
news:OcKVNbuAEHA.1964@.TK2MSFTNGP11.phx.gbl...
> I have that in place.
> "Carlos Eduardo Rojas" <carloser@.mindspring.com> wrote in message
> news:uL07F9tAEHA.2112@.tk2msftngp13.phx.gbl...
> able
when
> I
connection
Is
manager
>

running sql on a different port

sql 2k, sp3a
For security reasons, I changed sql to run on a different port. I'm able to
get into Enterprise Manager and Query Analyzer just fine. However, when I
try to go into Object Manager in QA, I get a message that the connection has
been broken. It never allows me to see the objects. Is this a bug? Is
there a workaround?
As long as sql is running on port 1433 I can get into the object manager
just fine.
Thanks, Andrehave you tried creating an alias in client network utility and using the
alias to connect to the server?
--
Carlos E. Rojas
SQL Server MVP
Co-Author SQL Server 2000 Programming by Example
"Andre" <AndreGetsEnoughSPAM@.nospam.com> wrote in message
news:eY8FrbtAEHA.1700@.TK2MSFTNGP12.phx.gbl...
> sql 2k, sp3a
> For security reasons, I changed sql to run on a different port. I'm able
to
> get into Enterprise Manager and Query Analyzer just fine. However, when I
> try to go into Object Manager in QA, I get a message that the connection
has
> been broken. It never allows me to see the objects. Is this a bug? Is
> there a workaround?
> As long as sql is running on port 1433 I can get into the object manager
> just fine.
> Thanks, Andre
>|||I have that in place.
"Carlos Eduardo Rojas" <carloser@.mindspring.com> wrote in message
news:uL07F9tAEHA.2112@.tk2msftngp13.phx.gbl...
> have you tried creating an alias in client network utility and using the
> alias to connect to the server?
> --
> Carlos E. Rojas
> SQL Server MVP
> Co-Author SQL Server 2000 Programming by Example
>
> "Andre" <AndreGetsEnoughSPAM@.nospam.com> wrote in message
> news:eY8FrbtAEHA.1700@.TK2MSFTNGP12.phx.gbl...
> > sql 2k, sp3a
> >
> > For security reasons, I changed sql to run on a different port. I'm
able
> to
> > get into Enterprise Manager and Query Analyzer just fine. However, when
I
> > try to go into Object Manager in QA, I get a message that the connection
> has
> > been broken. It never allows me to see the objects. Is this a bug? Is
> > there a workaround?
> >
> > As long as sql is running on port 1433 I can get into the object manager
> > just fine.
> >
> > Thanks, Andre
> >
> >
>|||Actually, that worked. I'd created the alias but was still connecting to
'.'. Connecting to the alias was the trick. Thanks!
Andre
"Andre" <AndreGetsEnoughSPAM@.nospam.com> wrote in message
news:OcKVNbuAEHA.1964@.TK2MSFTNGP11.phx.gbl...
> I have that in place.
> "Carlos Eduardo Rojas" <carloser@.mindspring.com> wrote in message
> news:uL07F9tAEHA.2112@.tk2msftngp13.phx.gbl...
> > have you tried creating an alias in client network utility and using the
> > alias to connect to the server?
> >
> > --
> > Carlos E. Rojas
> > SQL Server MVP
> > Co-Author SQL Server 2000 Programming by Example
> >
> >
> > "Andre" <AndreGetsEnoughSPAM@.nospam.com> wrote in message
> > news:eY8FrbtAEHA.1700@.TK2MSFTNGP12.phx.gbl...
> > > sql 2k, sp3a
> > >
> > > For security reasons, I changed sql to run on a different port. I'm
> able
> > to
> > > get into Enterprise Manager and Query Analyzer just fine. However,
when
> I
> > > try to go into Object Manager in QA, I get a message that the
connection
> > has
> > > been broken. It never allows me to see the objects. Is this a bug?
Is
> > > there a workaround?
> > >
> > > As long as sql is running on port 1433 I can get into the object
manager
> > > just fine.
> > >
> > > Thanks, Andre
> > >
> > >
> >
> >
>

Tuesday, February 21, 2012

Running sql jobs

Hi,
I have 2 sql jobs (sql2k sp4). I need to exec from sql query analyzer..
USE msdb
go
EXEC sp_start_job @.job_id = 'FD75FF33-AC18-42DB-A90B-94F6B14A9EA7'
exec sp_start_job @.job_id = 'FF75FF33-AC18-42DB-A90B-94F6B14A9EA7'
I need the first one finish processing then start the second job.
Any ideas?
ThanksYou could create just one job with 2 steps and when the first steps
finished goto the second step.
Charles Deaton
www.SQLSIG.org
mecn wrote:
> Hi,
> I have 2 sql jobs (sql2k sp4). I need to exec from sql query analyzer..
> USE msdb
> go
> EXEC sp_start_job @.job_id = 'FD75FF33-AC18-42DB-A90B-94F6B14A9EA7'
> exec sp_start_job @.job_id = 'FF75FF33-AC18-42DB-A90B-94F6B14A9EA7'
> I need the first one finish processing then start the second job.
> Any ideas?
> Thanks|||I could not make it one job. Business reasons.
Thanks
"Charles Deaton" <sqldba@.comcast.net> wrote in message
news:1163017637.649285.240680@.m73g2000cwd.googlegroups.com...
> You could create just one job with 2 steps and when the first steps
> finished goto the second step.
> Charles Deaton
> www.SQLSIG.org
> mecn wrote:
>|||Create a third job, and set these two jobs as contingent steps.
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
You can't help someone get up a hill without getting a little closer to the
top yourself.
- H. Norman Schwarzkopf
"mecn" <mecn2002@.yahoo.com> wrote in message
news:uYaaCA3AHHA.996@.TK2MSFTNGP02.phx.gbl...
> Hi,
> I have 2 sql jobs (sql2k sp4). I need to exec from sql query analyzer..
> USE msdb
> go
> EXEC sp_start_job @.job_id = 'FD75FF33-AC18-42DB-A90B-94F6B14A9EA7'
> exec sp_start_job @.job_id = 'FF75FF33-AC18-42DB-A90B-94F6B14A9EA7'
> I need the first one finish processing then start the second job.
> Any ideas?
> Thanks
>|||I guess you could check for the execution status of the job, in a loop, usin
g sp_help_job.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"mecn" <mecn2002@.yahoo.com> wrote in message news:uYaaCA3AHHA.996@.TK2MSFTNGP02.phx.gbl...[vb
col=seagreen]
> Hi,
> I have 2 sql jobs (sql2k sp4). I need to exec from sql query analyzer..
> USE msdb
> go
> EXEC sp_start_job @.job_id = 'FD75FF33-AC18-42DB-A90B-94F6B14A9EA7'
> exec sp_start_job @.job_id = 'FF75FF33-AC18-42DB-A90B-94F6B14A9EA7'
> I need the first one finish processing then start the second job.
> Any ideas?
> Thanks
>[/vbcol]|||thanks all, I'll do the test
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:OLcLwd3AHHA.4428@.TK2MSFTNGP04.phx.gbl...[vbcol=seagreen]
>I guess you could check for the execution status of the job, in a loop,
>using sp_help_job.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "mecn" <mecn2002@.yahoo.com> wrote in message
> news:uYaaCA3AHHA.996@.TK2MSFTNGP02.phx.gbl...

Running sql jobs

Hi,
I have 2 sql jobs (sql2k sp4). I need to exec from sql query analyzer..
USE msdb
go
EXEC sp_start_job @.job_id = 'FD75FF33-AC18-42DB-A90B-94F6B14A9EA7'
exec sp_start_job @.job_id = 'FF75FF33-AC18-42DB-A90B-94F6B14A9EA7'
I need the first one finish processing then start the second job.
Any ideas?
Thanks
You could create just one job with 2 steps and when the first steps
finished goto the second step.
Charles Deaton
www.SQLSIG.org
mecn wrote:
> Hi,
> I have 2 sql jobs (sql2k sp4). I need to exec from sql query analyzer..
> USE msdb
> go
> EXEC sp_start_job @.job_id = 'FD75FF33-AC18-42DB-A90B-94F6B14A9EA7'
> exec sp_start_job @.job_id = 'FF75FF33-AC18-42DB-A90B-94F6B14A9EA7'
> I need the first one finish processing then start the second job.
> Any ideas?
> Thanks
|||I could not make it one job. Business reasons.
Thanks
"Charles Deaton" <sqldba@.comcast.net> wrote in message
news:1163017637.649285.240680@.m73g2000cwd.googlegr oups.com...
> You could create just one job with 2 steps and when the first steps
> finished goto the second step.
> Charles Deaton
> www.SQLSIG.org
> mecn wrote:
>
|||Create a third job, and set these two jobs as contingent steps.
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
You can't help someone get up a hill without getting a little closer to the
top yourself.
- H. Norman Schwarzkopf
"mecn" <mecn2002@.yahoo.com> wrote in message
news:uYaaCA3AHHA.996@.TK2MSFTNGP02.phx.gbl...
> Hi,
> I have 2 sql jobs (sql2k sp4). I need to exec from sql query analyzer..
> USE msdb
> go
> EXEC sp_start_job @.job_id = 'FD75FF33-AC18-42DB-A90B-94F6B14A9EA7'
> exec sp_start_job @.job_id = 'FF75FF33-AC18-42DB-A90B-94F6B14A9EA7'
> I need the first one finish processing then start the second job.
> Any ideas?
> Thanks
>
|||thanks all, I'll do the test
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:OLcLwd3AHHA.4428@.TK2MSFTNGP04.phx.gbl...[vbcol=seagreen]
>I guess you could check for the execution status of the job, in a loop,
>using sp_help_job.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "mecn" <mecn2002@.yahoo.com> wrote in message
> news:uYaaCA3AHHA.996@.TK2MSFTNGP02.phx.gbl...

Running sql jobs

Hi,
I have 2 sql jobs (sql2k sp4). I need to exec from sql query analyzer..
USE msdb
go
EXEC sp_start_job @.job_id = 'FD75FF33-AC18-42DB-A90B-94F6B14A9EA7'
exec sp_start_job @.job_id = 'FF75FF33-AC18-42DB-A90B-94F6B14A9EA7'
I need the first one finish processing then start the second job.
Any ideas?
ThanksYou could create just one job with 2 steps and when the first steps
finished goto the second step.
Charles Deaton
www.SQLSIG.org
mecn wrote:
> Hi,
> I have 2 sql jobs (sql2k sp4). I need to exec from sql query analyzer..
> USE msdb
> go
> EXEC sp_start_job @.job_id = 'FD75FF33-AC18-42DB-A90B-94F6B14A9EA7'
> exec sp_start_job @.job_id = 'FF75FF33-AC18-42DB-A90B-94F6B14A9EA7'
> I need the first one finish processing then start the second job.
> Any ideas?
> Thanks|||Create a third job, and set these two jobs as contingent steps.
--
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
You can't help someone get up a hill without getting a little closer to the
top yourself.
- H. Norman Schwarzkopf
"mecn" <mecn2002@.yahoo.com> wrote in message
news:uYaaCA3AHHA.996@.TK2MSFTNGP02.phx.gbl...
> Hi,
> I have 2 sql jobs (sql2k sp4). I need to exec from sql query analyzer..
> USE msdb
> go
> EXEC sp_start_job @.job_id = 'FD75FF33-AC18-42DB-A90B-94F6B14A9EA7'
> exec sp_start_job @.job_id = 'FF75FF33-AC18-42DB-A90B-94F6B14A9EA7'
> I need the first one finish processing then start the second job.
> Any ideas?
> Thanks
>|||I could not make it one job. Business reasons.
Thanks
"Charles Deaton" <sqldba@.comcast.net> wrote in message
news:1163017637.649285.240680@.m73g2000cwd.googlegroups.com...
> You could create just one job with 2 steps and when the first steps
> finished goto the second step.
> Charles Deaton
> www.SQLSIG.org
> mecn wrote:
>> Hi,
>> I have 2 sql jobs (sql2k sp4). I need to exec from sql query analyzer..
>> USE msdb
>> go
>> EXEC sp_start_job @.job_id = 'FD75FF33-AC18-42DB-A90B-94F6B14A9EA7'
>> exec sp_start_job @.job_id = 'FF75FF33-AC18-42DB-A90B-94F6B14A9EA7'
>> I need the first one finish processing then start the second job.
>> Any ideas?
>> Thanks
>|||I guess you could check for the execution status of the job, in a loop, using sp_help_job.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"mecn" <mecn2002@.yahoo.com> wrote in message news:uYaaCA3AHHA.996@.TK2MSFTNGP02.phx.gbl...
> Hi,
> I have 2 sql jobs (sql2k sp4). I need to exec from sql query analyzer..
> USE msdb
> go
> EXEC sp_start_job @.job_id = 'FD75FF33-AC18-42DB-A90B-94F6B14A9EA7'
> exec sp_start_job @.job_id = 'FF75FF33-AC18-42DB-A90B-94F6B14A9EA7'
> I need the first one finish processing then start the second job.
> Any ideas?
> Thanks
>|||thanks all, I'll do the test
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:OLcLwd3AHHA.4428@.TK2MSFTNGP04.phx.gbl...
>I guess you could check for the execution status of the job, in a loop,
>using sp_help_job.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "mecn" <mecn2002@.yahoo.com> wrote in message
> news:uYaaCA3AHHA.996@.TK2MSFTNGP02.phx.gbl...
>> Hi,
>> I have 2 sql jobs (sql2k sp4). I need to exec from sql query analyzer..
>> USE msdb
>> go
>> EXEC sp_start_job @.job_id = 'FD75FF33-AC18-42DB-A90B-94F6B14A9EA7'
>> exec sp_start_job @.job_id = 'FF75FF33-AC18-42DB-A90B-94F6B14A9EA7'
>> I need the first one finish processing then start the second job.
>> Any ideas?
>> Thanks