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

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?

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 one known SQL to change a sp.....

I know this may sound strange (me2) but a developer is convinced that the
SQL server is changing their stored procedure. Would SQL internally for any
reasons change code of a sp to optimize or anything?
CREATE PROCEDURE dbo.pr_Update_tblDepartment_Step1
AS
-- Update records in tblDepartment with changed records in tblTempDept
UPDATE dbo.qry_Update_tblDeparment_Step1
SET strDescription = [qry_Update_tblDeparment_Step1].[Description]
FROM dbo.qry_Update_tblDeparment_Step1
GO
--> CHANGES TO not use the view:
CREATE PROCEDURE dbo.pr_Update_tblDepartment_Step1
AS
-- Update records in tblDepartment with changed records in tblTempDept
UPDATE dbo.tblDepartment
SET strDescription = [qry_Update_tblDeparment_Step1].[Description]
FROM dbo.qry_Update_tblDeparment_Step1
GO
--> For reference here is the view used for the update.
CREATE VIEW dbo.qry_Update_tblDeparment_Step1
AS
SELECT dbo.tblTempDept.Description, dbo.tblDepartment.strDescription,
dbo.tblTempDept.Dept_No, dbo.tblDepartment.strDeptName
FROM dbo.tblTempDept INNER JOIN
dbo.tblDepartment ON dbo.tblTempDept.Dept_No =
dbo.tblDepartment.strDeptName AND
dbo.tblTempDept.Description <>
dbo.tblDepartment.strDescription
No
SQL Server is too 'stupid' to do that. It takes what you give it, stores it,
figures out how to execute it an executes it. Nothing else.
Put a comment line in with a manually incremented version number and see it
that changes. Maybe there is some code in an application that does it.
Regards
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"CD" <mcdye1@.hotmail.REMOVETHIS.com> wrote in message
news:e3rlxqeRFHA.3684@.TK2MSFTNGP10.phx.gbl...
>I know this may sound strange (me2) but a developer is convinced that the
>SQL server is changing their stored procedure. Would SQL internally for
>any reasons change code of a sp to optimize or anything?
> CREATE PROCEDURE dbo.pr_Update_tblDepartment_Step1
> AS
> -- Update records in tblDepartment with changed records in tblTempDept
> UPDATE dbo.qry_Update_tblDeparment_Step1
> SET strDescription = [qry_Update_tblDeparment_Step1].[Description]
> FROM dbo.qry_Update_tblDeparment_Step1
> GO
> --> CHANGES TO not use the view:
> CREATE PROCEDURE dbo.pr_Update_tblDepartment_Step1
> AS
> -- Update records in tblDepartment with changed records in tblTempDept
> UPDATE dbo.tblDepartment
> SET strDescription = [qry_Update_tblDeparment_Step1].[Description]
> FROM dbo.qry_Update_tblDeparment_Step1
> GO
>
> --> For reference here is the view used for the update.
> CREATE VIEW dbo.qry_Update_tblDeparment_Step1
> AS
> SELECT dbo.tblTempDept.Description, dbo.tblDepartment.strDescription,
> dbo.tblTempDept.Dept_No, dbo.tblDepartment.strDeptName
> FROM dbo.tblTempDept INNER JOIN
> dbo.tblDepartment ON dbo.tblTempDept.Dept_No =
> dbo.tblDepartment.strDeptName AND
> dbo.tblTempDept.Description <>
> dbo.tblDepartment.strDescription
>
>
|||ever investigated database change management?
regards,
Mark Baekdal
http://www.dbghost.com
http://www.innovartis.co.uk
+44 (0)208 241 1762
Build, Comparison and Synchronization from Source Control = Database change
management for SQL Server
"CD" wrote:

> I know this may sound strange (me2) but a developer is convinced that the
> SQL server is changing their stored procedure. Would SQL internally for any
> reasons change code of a sp to optimize or anything?
> CREATE PROCEDURE dbo.pr_Update_tblDepartment_Step1
> AS
> -- Update records in tblDepartment with changed records in tblTempDept
> UPDATE dbo.qry_Update_tblDeparment_Step1
> SET strDescription = [qry_Update_tblDeparment_Step1].[Description]
> FROM dbo.qry_Update_tblDeparment_Step1
> GO
> --> CHANGES TO not use the view:
> CREATE PROCEDURE dbo.pr_Update_tblDepartment_Step1
> AS
> -- Update records in tblDepartment with changed records in tblTempDept
> UPDATE dbo.tblDepartment
> SET strDescription = [qry_Update_tblDeparment_Step1].[Description]
> FROM dbo.qry_Update_tblDeparment_Step1
> GO
>
> --> For reference here is the view used for the update.
> CREATE VIEW dbo.qry_Update_tblDeparment_Step1
> AS
> SELECT dbo.tblTempDept.Description, dbo.tblDepartment.strDescription,
> dbo.tblTempDept.Dept_No, dbo.tblDepartment.strDeptName
> FROM dbo.tblTempDept INNER JOIN
> dbo.tblDepartment ON dbo.tblTempDept.Dept_No =
> dbo.tblDepartment.strDeptName AND
> dbo.tblTempDept.Description <>
> dbo.tblDepartment.strDescription
>
>

2012年2月25日星期六

Any one known SQL to change a sp.....

I know this may sound strange (me2) but a developer is convinced that the
SQL server is changing their stored procedure. Would SQL internally for any
reasons change code of a sp to optimize or anything?
CREATE PROCEDURE dbo.pr_Update_tblDepartment_Step1
AS
-- Update records in tblDepartment with changed records in tblTempDept
UPDATE dbo.qry_Update_tblDeparment_Step1
SET strDescription = [qry_Update_tblDeparment_Step1].[Description]
FROM dbo.qry_Update_tblDeparment_Step1
GO
--> CHANGES TO not use the view:
CREATE PROCEDURE dbo.pr_Update_tblDepartment_Step1
AS
-- Update records in tblDepartment with changed records in tblTempDept
UPDATE dbo.tblDepartment
SET strDescription = [qry_Update_tblDeparment_Step1].[Description]
FROM dbo.qry_Update_tblDeparment_Step1
GO
--> For reference here is the view used for the update.
CREATE VIEW dbo.qry_Update_tblDeparment_Step1
AS
SELECT dbo.tblTempDept.Description, dbo.tblDepartment.strDescription,
dbo.tblTempDept.Dept_No, dbo.tblDepartment.strDeptName
FROM dbo.tblTempDept INNER JOIN
dbo.tblDepartment ON dbo.tblTempDept.Dept_No =
dbo.tblDepartment.strDeptName AND
dbo.tblTempDept.Description <>
dbo.tblDepartment.strDescriptionNo
SQL Server is too 'stupid' to do that. It takes what you give it, stores it,
figures out how to execute it an executes it. Nothing else.
Put a comment line in with a manually incremented version number and see it
that changes. Maybe there is some code in an application that does it.
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"CD" <mcdye1@.hotmail.REMOVETHIS.com> wrote in message
news:e3rlxqeRFHA.3684@.TK2MSFTNGP10.phx.gbl...
>I know this may sound strange (me2) but a developer is convinced that the
>SQL server is changing their stored procedure. Would SQL internally for
>any reasons change code of a sp to optimize or anything?
> CREATE PROCEDURE dbo.pr_Update_tblDepartment_Step1
> AS
> -- Update records in tblDepartment with changed records in tblTempDept
> UPDATE dbo.qry_Update_tblDeparment_Step1
> SET strDescription = [qry_Update_tblDeparment_Step1].[Description
]
> FROM dbo.qry_Update_tblDeparment_Step1
> GO
> --> CHANGES TO not use the view:
> CREATE PROCEDURE dbo.pr_Update_tblDepartment_Step1
> AS
> -- Update records in tblDepartment with changed records in tblTempDept
> UPDATE dbo.tblDepartment
> SET strDescription = [qry_Update_tblDeparment_Step1].[Description
]
> FROM dbo.qry_Update_tblDeparment_Step1
> GO
>
> --> For reference here is the view used for the update.
> CREATE VIEW dbo.qry_Update_tblDeparment_Step1
> AS
> SELECT dbo.tblTempDept.Description, dbo.tblDepartment.strDescription,
> dbo.tblTempDept.Dept_No, dbo.tblDepartment.strDeptName
> FROM dbo.tblTempDept INNER JOIN
> dbo.tblDepartment ON dbo.tblTempDept.Dept_No =
> dbo.tblDepartment.strDeptName AND
> dbo.tblTempDept.Description <>
> dbo.tblDepartment.strDescription
>
>|||ever investigated database change management?
regards,
Mark Baekdal
http://www.dbghost.com
http://www.innovartis.co.uk
+44 (0)208 241 1762
Build, Comparison and Synchronization from Source Control = Database change
management for SQL Server
"CD" wrote:

> I know this may sound strange (me2) but a developer is convinced that the
> SQL server is changing their stored procedure. Would SQL internally for a
ny
> reasons change code of a sp to optimize or anything?
> CREATE PROCEDURE dbo.pr_Update_tblDepartment_Step1
> AS
> -- Update records in tblDepartment with changed records in tblTempDept
> UPDATE dbo.qry_Update_tblDeparment_Step1
> SET strDescription = [qry_Update_tblDeparment_Step1].[Descriptio
n]
> FROM dbo.qry_Update_tblDeparment_Step1
> GO
> --> CHANGES TO not use the view:
> CREATE PROCEDURE dbo.pr_Update_tblDepartment_Step1
> AS
> -- Update records in tblDepartment with changed records in tblTempDept
> UPDATE dbo.tblDepartment
> SET strDescription = [qry_Update_tblDeparment_Step1].[Descriptio
n]
> FROM dbo.qry_Update_tblDeparment_Step1
> GO
>
> --> For reference here is the view used for the update.
> CREATE VIEW dbo.qry_Update_tblDeparment_Step1
> AS
> SELECT dbo.tblTempDept.Description, dbo.tblDepartment.strDescription,
> dbo.tblTempDept.Dept_No, dbo.tblDepartment.strDeptName
> FROM dbo.tblTempDept INNER JOIN
> dbo.tblDepartment ON dbo.tblTempDept.Dept_No =
> dbo.tblDepartment.strDeptName AND
> dbo.tblTempDept.Description <>
> dbo.tblDepartment.strDescription
>
>