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

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 of the 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 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 something with the
[sp_executesql] line. No amount of massaging will get this to work -- my guess is that
the structure of [sp_executesql] won't permit a cursor variable to be handled. :-(
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
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 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 Peterson
>

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年3月19日星期一

any way to do record login failures?

sql2000 sp3a
i'd like to keep track of login failures in a table in addition to the
sql log. is there any way to do this?
i've created an alert for error 18456, login failed for user '%ls'.
if i configure the alert to call a job, how do i get that error message
into the job so that i can insert it into a table?
also, i'd like to record the hostname or ip address of the client
machine from which the login failure occurs. i know sysprocesses has
that info once a user gets logged in, but where is that info if the
login fails?Another option is to use a trace (or profiler) to monitor
for failed logins. You can import the trace file into a
table.
The IP and Host name won't be directly available for failed
logins. Host name isn't that reliable anyway as it's
controlled by the client. For the ip address, you would need
to capture this using a network tool.
-Sue
On Wed, 02 Jun 2004 09:04:30 -0500, ch <ch@.dontemailme.com>
wrote:
>sql2000 sp3a
>i'd like to keep track of login failures in a table in addition to the
>sql log. is there any way to do this?
>i've created an alert for error 18456, login failed for user '%ls'.
>if i configure the alert to call a job, how do i get that error message
>into the job so that i can insert it into a table?
>also, i'd like to record the hostname or ip address of the client
>machine from which the login failure occurs. i know sysprocesses has
>that info once a user gets logged in, but where is that info if the
>login fails?

2012年3月6日星期二

Any other patch need to installed besides SP3a?

Hi,
I installed SP3a for MS SQL 2000. Do I need to install any other tools to prevent from hacking?
e.g. IIS Lockdown Tool for windows 2000 server IIS 5
Thanks for advice
You should check all your servers with these security tools.
http://www.microsoft.com/downloads/d...displaylang=en
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"Tom" <kerocow@.yahoo.com> wrote in message
news:EEC32889-130C-4327-8AA2-A1F41BFD1430@.microsoft.com...
> Hi,
> I installed SP3a for MS SQL 2000. Do I need to install any other tools to
prevent from hacking?
> e.g. IIS Lockdown Tool for windows 2000 server IIS 5
> Thanks for advice
|||Tom,
You might want to install the MS03-031 security update.
http://www.microsoft.com/technet/sec.../MS03-031.mspx
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Tom wrote:
> Hi,
> I installed SP3a for MS SQL 2000. Do I need to install any other tools to prevent from hacking?
> e.g. IIS Lockdown Tool for windows 2000 server IIS 5
> Thanks for advice
|||Thanks for help

Any other patch need to installed besides SP3a?

Hi,
I installed SP3a for MS SQL 2000. Do I need to install any other tools to pr
event from hacking?
e.g. IIS Lockdown Tool for Windows 2000 server IIS 5
Thanks for adviceYou should check all your servers with these security tools.
CDE4D933600&displaylang=en" target="_blank">http://www.microsoft.com/downloads/...&displaylang=en
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"Tom" <kerocow@.yahoo.com> wrote in message
news:EEC32889-130C-4327-8AA2-A1F41BFD1430@.microsoft.com...
> Hi,
> I installed SP3a for MS SQL 2000. Do I need to install any other tools to
prevent from hacking?
> e.g. IIS Lockdown Tool for Windows 2000 server IIS 5
> Thanks for advice|||Tom,
You might want to install the MS03-031 security update.
http://www.microsoft.com/technet/se...n/MS03-031.mspx
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Tom wrote:
> Hi,
> I installed SP3a for MS SQL 2000. Do I need to install any other tools to
prevent from hacking?
> e.g. IIS Lockdown Tool for Windows 2000 server IIS 5
> Thanks for advice|||Thanks for help

2012年2月25日星期六

any issues with sql2k on win2k3?

we're about to upgrade from
win2000, sql2000 sp3a standard edition, dual p3 900mhz, 2gb ram
to
win2003, sql2000 sp3a standard edition, dual xeon 3ghz hyperthreaded,
2gb ram
the only issue i could find at microsoft was the sql install issue
where win2003 wants sql sp3. any other issues to watch for?
do some people claim better performance by limiting sql server to use
only the two physical processors instead of the two physical processors
and the two logical processors?
"ch" <ch@.dontemailme.com> wrote in message
news:41A36D56.E36EF4A7@.dontemailme.com...
> we're about to upgrade from
> win2000, sql2000 sp3a standard edition, dual p3 900mhz, 2gb ram
> to
> win2003, sql2000 sp3a standard edition, dual xeon 3ghz hyperthreaded,
> 2gb ram
> the only issue i could find at microsoft was the sql install issue
> where win2003 wants sql sp3. any other issues to watch for?
I think you're covered, operating systems are comparable? In otherwords,
Windows 2000 Standard and Windows 2003 Standard?

> do some people claim better performance by limiting sql server to use
> only the two physical processors instead of the two physical processors
> and the two logical processors?
I prefer not to tinker with processor settings, rather allow the operating
system to manage the processors. in addition, Windows Server 2003 and SQL
Server 2000 does a fairly good job of dynamic memory and interfacing with
the processors. You could always run some benchmarks as there are always
certain situations, applications, etc where manual intervention may be
warranted.
Steve

any issues with sql2k on win2k3?

we're about to upgrade from
win2000, sql2000 sp3a standard edition, dual p3 900mhz, 2gb ram
to
win2003, sql2000 sp3a standard edition, dual xeon 3ghz hyperthreaded,
2gb ram
the only issue i could find at microsoft was the sql install issue
where win2003 wants sql sp3. any other issues to watch for?
do some people claim better performance by limiting sql server to use
only the two physical processors instead of the two physical processors
and the two logical processors?"ch" <ch@.dontemailme.com> wrote in message
news:41A36D56.E36EF4A7@.dontemailme.com...
> we're about to upgrade from
> win2000, sql2000 sp3a standard edition, dual p3 900mhz, 2gb ram
> to
> win2003, sql2000 sp3a standard edition, dual xeon 3ghz hyperthreaded,
> 2gb ram
> the only issue i could find at microsoft was the sql install issue
> where win2003 wants sql sp3. any other issues to watch for?
I think you're covered, operating systems are comparable? In otherwords,
Windows 2000 Standard and Windows 2003 Standard?

> do some people claim better performance by limiting sql server to use
> only the two physical processors instead of the two physical processors
> and the two logical processors?
I prefer not to tinker with processor settings, rather allow the operating
system to manage the processors. in addition, Windows Server 2003 and SQL
Server 2000 does a fairly good job of dynamic memory and interfacing with
the processors. You could always run some benchmarks as there are always
certain situations, applications, etc where manual intervention may be
warranted.
Steve

any issues with sql2k on win2k3?

we're about to upgrade from
win2000, sql2000 sp3a standard edition, dual p3 900mhz, 2gb ram
to
win2003, sql2000 sp3a standard edition, dual xeon 3ghz hyperthreaded,
2gb ram
the only issue i could find at microsoft was the sql install issue
where win2003 wants sql sp3. any other issues to watch for?
do some people claim better performance by limiting sql server to use
only the two physical processors instead of the two physical processors
and the two logical processors?"ch" <ch@.dontemailme.com> wrote in message
news:41A36D56.E36EF4A7@.dontemailme.com...
> we're about to upgrade from
> win2000, sql2000 sp3a standard edition, dual p3 900mhz, 2gb ram
> to
> win2003, sql2000 sp3a standard edition, dual xeon 3ghz hyperthreaded,
> 2gb ram
> the only issue i could find at microsoft was the sql install issue
> where win2003 wants sql sp3. any other issues to watch for?
I think you're covered, operating systems are comparable? In otherwords,
Windows 2000 Standard and Windows 2003 Standard?
> do some people claim better performance by limiting sql server to use
> only the two physical processors instead of the two physical processors
> and the two logical processors?
I prefer not to tinker with processor settings, rather allow the operating
system to manage the processors. in addition, Windows Server 2003 and SQL
Server 2000 does a fairly good job of dynamic memory and interfacing with
the processors. You could always run some benchmarks as there are always
certain situations, applications, etc where manual intervention may be
warranted.
Steve