all groups > sql server dts > september 2005 >
You're in the

sql server dts

group:

windows logged on username



windows logged on username Andre
9/27/2005 1:58:51 PM
sql server dts: SQL 2k sp4

As part of a DTS package, I want to use the name of the currently logged on
Windows user to populate a UserName field in my table. Can anyone tell me
how I can do this - get the name of the currently logged on user? I'm
figuring it can be done in an ActiveX step but don't know how.

Thanks in advance.

Andre

Re: windows logged on username Andre
9/27/2005 2:10:05 PM
Forget it, I just figured it out. Here's how in case anyone is interested.



Function Main()

Dim oWshNetwork

Set oWshNetwork = CreateObject("WScript.Network")

MsgBox("Current User Name: " & UCase(oWshNetwork.UserName))

Main = DTSTaskExecResult_Success
End Function

AddThis Social Bookmark Button