显示标签为“liketo”的博文。显示所有博文
显示标签为“liketo”的博文。显示所有博文

2012年3月20日星期二

Any way to have a cursor variable reference an *existing* cursor?

(SQL Server 2000, SP3a)
Hello, all!
I have an open global cursor that is created dynamically by stored procedure
A. I'd like
to reference this cursor from stored procedure B. I know the dynamic name o
f the cursor,
but I know of no way to get a "handle" of this cursor so that I can use it f
rom stored
procedure B in a cursor variable.
I had hoped that maybe I could somehow divine the "handle" from sp_describe_
cursor, but I
can't seem to "set" my cursor variable from any of this information. Someth
ing like (once
I retrieve the cursor_handle or something):
set @.MyCursor = cursor @.cursor_handle
Does anyone know of any mechanism I can use to accomplish this?
Thanks!
John PetersonI had hoped that something like this would work:
declare @.CursorName nvarchar(4000) select @.CursorName = 'cur'
execute
(
'
declare ' + @.CursorName + ' cursor forward_only read_only for
select name from sysobjects
'
)
declare @.Cursor cursor
declare @.Query nvarchar(4000)
select @.Query = 'set @.Cursor = ' + @.CursorName
execute [dbo].[sp_executesql] @.Query, N'@.Cursor cursor varying output', @.Cursor =
@.Cursor
output
execute('deallocate ' + @.CursorName)
But, alas, I get this error:
Server: Msg 181, Level 15, State 1, Line 1
Cannot use the OUTPUT option in a DECLARE statement.
Server: Msg 137, Level 15, State 1, Line 1
Must declare the variable '@.Cursor'.
Which I don't fully understand. But, after some fiddling, it's clearly some
thing with the
[sp_executesql] line. No amount of massaging will get this to work -- my gu
ess is that
the structure of [sp_executesql] won't permit a cursor variable to be handle
d. :-(
I'd appreciate any other suggestions!
Regards,
John Peterson
"John Peterson" <j0hnp@.comcast.net> wrote in message
news:uxudcE99DHA.3488@.tk2msftngp13.phx.gbl...
> (SQL Server 2000, SP3a)
> Hello, all!
> I have an open global cursor that is created dynamically by stored procedure A. I
'd
like
> to reference this cursor from stored procedure B. I know the dynamic name of the[
/color]
cursor,
> but I know of no way to get a "handle" of this cursor so that I can use it
from stored
> procedure B in a cursor variable.
> I had hoped that maybe I could somehow divine the "handle" from sp_describe_cursor
, but
I
> can't seem to "set" my cursor variable from any of this information. Something li
ke
(once
> I retrieve the cursor_handle or something):
> set @.MyCursor = cursor @.cursor_handle
> Does anyone know of any mechanism I can use to accomplish this?
> Thanks!
> John Peterson
>

2012年2月16日星期四

Any documentation to set up multi instance cluster

I want to set up 3 active and 1 passive on a 4 node cluster and would like
to see an install guide for something like that. Can anyone redirect me to
one ?
Thanks
Use the guide you found for the first instance, then follow the books online
to install the rest of the instances.
Remember each instance will need an IP and dedicated disk(s).
Cheers,
Rodney R. Fournier
MVP - Windows Server - Clustering
http://www.nw-america.com - Clustering Website
http://www.msmvps.com/clustering - Blog
http://www.clusterhelp.com - Cluster Training
ClusterHelp.com is a Microsoft Certified Gold Partner
"Hassan" <hassan@.hotmail.com> wrote in message
news:eVo9tfnRHHA.3948@.TK2MSFTNGP05.phx.gbl...
>I want to set up 3 active and 1 passive on a 4 node cluster and would like
>to see an install guide for something like that. Can anyone redirect me to
>one ?
> Thanks
>
|||Are you having trouble setting up the cluster or the SQL Server instances?
If you are running N + I, then when you install SQL Server, you only include
two nodes as potential resource owners.
If we designate nodes 1, 2, and 3 as the active nodes and 4 as the passive,
then for instance 1 you would include nodes 1 and 4, for instance 2, nodes 2
and 4, and for instance 3, nodes 3 and 4.
Other than this, the setup for SQL Server is exactly the same as for a
single instanced, 2-node cluster.
Perhaps I am not understanding your question fully.
Here are two references, one for multi-node clusters, and one for SQL Server
failover clustering (the document is for SS2K but applicable for SS2K5; it
also provides a link to SS2K5 related information).
See the Number of Nodes and Failover Plan section:
http://technet2.microsoft.com/WindowsServer/en/library/f41adff5-87df-483e-9edd-8484501d79921033.mspx?mfr=true
SQL Server:
http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/failclus.mspx
http://www.microsoft.com/downloads/details.aspx?FamilyID=818234dc-a17b-4f09-b282-c6830fead499&DisplayLang=en
Sincerely,
Anthony Thomas
"Hassan" <hassan@.hotmail.com> wrote in message
news:eVo9tfnRHHA.3948@.TK2MSFTNGP05.phx.gbl...
> I want to set up 3 active and 1 passive on a 4 node cluster and would like
> to see an install guide for something like that. Can anyone redirect me to
> one ?
> Thanks
>