Showing posts with label logging. Show all posts
Showing posts with label logging. Show all posts

Monday, March 12, 2012

How can I know?

I wanna know how I could know how many users or who are logging into some
database.
thanks in advanceYou can run sp_who2 and count the ones in the specific db. Or you can run a
select against master..sysprocesses and filter on the correct DBID.
Andrew J. Kelly SQL MVP
"hui" <jxmu_lhf71@.163.com> wrote in message
news:ODVQAhnGFHA.2280@.TK2MSFTNGP15.phx.gbl...
>I wanna know how I could know how many users or who are logging into some
> database.
> thanks in advance
>

how can i know

how can I know who is logging into my sqlserver?
thanks
huiHi,
Check out
http://msdn.microsoft.com/library/d...>
ity_2ard.asp
for information about auditing SQL Server activity.
Regards,
Jono|||Alternatively, you can record login attempts (success/failure/all) in
the Windows Event Log and SQL Server error log by selecting the options
from the Security tab of the SQL Server Properties dialog box in SQL
Server Enterprise Manager, as described in the following article:
http://www.databasejournal.com/feat...cle.php/3399241

Monday, February 27, 2012

How can I get the package name within a script?

Greetings,

I need to programmatically grab the name of the executing package so that it can be used in logging. Does someone have a code sample for this?

Thanks!

Use the system variable, PackageName.|||

Thanks.

For those who may benefit from a code sample:

Dim source AsString

Dim vars As Variables

Dts.VariableDispenser.LockOneForRead("System:Stick out tongueackageName", vars)

source = vars("PackageName").Value.ToString()

|||Also the other options (perhaps not for this example) are to use a derived column to add the system variable to the data flow, or in the control flow, using an Execute SQL task, you can map the variable to a parameter in the SQL statement.