Monday, March 26, 2012
Normal Procedure for shutdown SQL Server
I have a cluster Active/Passive cluster setting, Win2003. I would like to
know the normal procedures for shuting down the SQL Server on both nodes. Is
that needed to disable the passive node before using SQL Manager to shutdown
SQL Server?Please kindly advise!
Many thanks!
From,
Henry
Hi
Do not use SQL Manager to do anything with clustered SQL servers.
You must use Cluster Administrator to take a group offline or bring it
online again.
If you use SQL Manager, you in effect cause a failover.
Regards
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Henry" wrote:
> Dear Sir,
> I have a cluster Active/Passive cluster setting, Win2003. I would like to
> know the normal procedures for shuting down the SQL Server on both nodes. Is
> that needed to disable the passive node before using SQL Manager to shutdown
> SQL Server?Please kindly advise!
> Many thanks!
> From,
> Henry
>
sql
Friday, March 23, 2012
Non-sync initialization
Dear friends
I read about 'NoSync' initialization.I tried out in my system.That time after executing Sp_Scriptpublicationcustomprocs,Stored procedures are propagated to subscriber.Replication was working fine.But afterwards I got some problem.So I reinstall my SQL Server I agin tried 'NoSync' initialization.This time Stored procedure is getting created on Publisher database not in subscriber.Can you tell me what may be the reason
I have two other doubts also
1)Sometimes I am getting error in subscriber.'The process couldn't connect to Distributor'.How to configure distributor in this case?
in configure publishing,distributor wizard I won't able to do anything like that change distributor login or something
2)How to delete Distributor database from a server.once it's get created if wan't also I won't able to delete it
3)If I am using SQL Server 2005 Peer to peer Replication whether it will be reliable for load balancing.My All servers will be in one office only.Or clustering may be better technology for load balancing.if it is like that can you tell me why it is?
Expecting reply
Filson
If it worked for you the first time, it should work for you the second time If you received an error, you have to tell us otherwise we won't know where to start.
Regarding "the process could not connect to Distributor" msg, you say "sometimes", or do you mean "all the time"? If it's sometimes, then you need to check your network connection or domain security. All replication does is try to make a connection, if it can't, it will fail.
If you want to remove replication, follow the steps in Books Online for remove replication. If you get into a state where you can't get out of, try running "sp_removedbreplication".
Peer to Peer is an excellent solution for load balancing, it's one of several. there are many docs on the net describing pros and cons of each.
Wednesday, March 7, 2012
nodes does not seem to work when xml value is created through a select
While
DECLARE @.x xml
SET @.x = '<ROOT><a>111</a><a>222</a><a>333</a><a>444</a></ROOT>'
SELECT (select @.x).query('//a')
works fine, a very similar query
DECLARE @.x xml
SET @.x = '<ROOT><a>111</a><a>222</a><a>333</a><a>444</a></ROOT>'
SELECT t.c.query('.') from (select @.x).nodes('//a') t(c)
fails with
Msg 102, Level 15, State 1, Line 3
Incorrect syntax near '.'.
Anyone knows whether this is expected/documented behaviour?
Thanks
PeterDerived table syntax in FROM clause requires table alias to follow it
(unlike scalar sub-query in SELECT).
You can achieve what you want with CROSS APPLY:
DECLARE @.x xml
SET @.x = '<ROOT><a>111</a><a>222</a><a>333</a><a>444</a></ROOT>'
SELECT t2.c.query('.') from (select @.x) t1(x) CROSS APPLY t1.x.nodes('//a')
t2(c)
Best regards,
Eugene
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Peter" <pgp.coppens@.gmail.com> wrote in message
news:1138820267.235233.39270@.f14g2000cwb.googlegroups.com...
> Dear all,
> While
> DECLARE @.x xml
> SET @.x = '<ROOT><a>111</a><a>222</a><a>333</a><a>444</a></ROOT>'
> SELECT (select @.x).query('//a')
> works fine, a very similar query
> DECLARE @.x xml
> SET @.x = '<ROOT><a>111</a><a>222</a><a>333</a><a>444</a></ROOT>'
> SELECT t.c.query('.') from (select @.x).nodes('//a') t(c)
> fails with
> Msg 102, Level 15, State 1, Line 3
> Incorrect syntax near '.'.
> Anyone knows whether this is expected/documented behaviour?
> Thanks
> Peter
>|||That helps,
Thanks,
Peter.
nodes does not seem to work when xml value is created through a select
While
DECLARE @.x xml
SET @.x = '<ROOT><a>111</a><a>222</a><a>333</a><a>444</a></ROOT>'
SELECT (select @.x).query('//a')
works fine, a very similar query
DECLARE @.x xml
SET @.x = '<ROOT><a>111</a><a>222</a><a>333</a><a>444</a></ROOT>'
SELECT t.c.query('.') from (select @.x).nodes('//a') t(c)
fails with
Msg 102, Level 15, State 1, Line 3
Incorrect syntax near '.'.
Anyone knows whether this is expected/documented behaviour?
Thanks
Peter
Derived table syntax in FROM clause requires table alias to follow it
(unlike scalar sub-query in SELECT).
You can achieve what you want with CROSS APPLY:
DECLARE @.x xml
SET @.x = '<ROOT><a>111</a><a>222</a><a>333</a><a>444</a></ROOT>'
SELECT t2.c.query('.') from (select @.x) t1(x) CROSS APPLY t1.x.nodes('//a')
t2(c)
Best regards,
Eugene
This posting is provided "AS IS" with no warranties, and confers no rights.
"Peter" <pgp.coppens@.gmail.com> wrote in message
news:1138820267.235233.39270@.f14g2000cwb.googlegro ups.com...
> Dear all,
> While
> DECLARE @.x xml
> SET @.x = '<ROOT><a>111</a><a>222</a><a>333</a><a>444</a></ROOT>'
> SELECT (select @.x).query('//a')
> works fine, a very similar query
> DECLARE @.x xml
> SET @.x = '<ROOT><a>111</a><a>222</a><a>333</a><a>444</a></ROOT>'
> SELECT t.c.query('.') from (select @.x).nodes('//a') t(c)
> fails with
> Msg 102, Level 15, State 1, Line 3
> Incorrect syntax near '.'.
> Anyone knows whether this is expected/documented behaviour?
> Thanks
> Peter
>
|||That helps,
Thanks,
Peter.
Saturday, February 25, 2012
No. of records returned by a query.
i want to run a query on sql server based on whether the no. of records returned by another query is 0 or >0. what will be the sql code for this.Assume your SELECT statement is called Q. Than you can write
if (select count(*) from (Q) q)>0
BEGIN
SELECT 'Your TRUE block'
END
ELSE
BEGIN
SELECT 'Your block for count(*) = 0'
END|||...or, if you have already run your select statement as part of your procedure, use this so you don't have to execute it a second time:
if @.@.ROWCOUNT > 0
BEGIN
SELECT 'Your TRUE block'
END
ELSE
BEGIN
SELECT 'Your block for count(*) = 0'
END
@.@.ROWCOUNT stores the number of records returned by the last executed statement. If you don't use the value immediately, you will need to store it in a variable because it will change with your next statement.
blindman