2009/05/27

Get windows login name?

To get windows login name, you can type this in dos prompt:
echo %username%

To get windows login name in sql, you can type this:
exec master..xp_cmdshell 'echo %USERNAME%'

No comments:

Post a Comment