Quantcast
Channel: CodeSection,代码区,SQL Server(mssql)数据库 技术分享 - CodeSec
Viewing all articles
Browse latest Browse all 3160

My goal is to send, aside the connection string the & ldquo& ...

$
0
0

I have a connection string (SQL Server):

Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;

My goal is to send inside the connection string the "pc name".

This is so I can later Audit it, or to later see the information in log file from which computer the user has been connected to the SQL Server.

You can have Workstation ID in the connection string. Whatever you put in there is shown in SQL Server Profiler in column HostName .

In my testing I found that if you do not specify Workstation ID in the connection string you will still get the the name of the client computer automatically.


Viewing all articles
Browse latest Browse all 3160

Trending Articles