TSQL Function SQL Server 2012 - repost

CLOSED
Bids
14
Avg Bid (USD)
$213
Project Budget (USD)
$30 - $250

Project Description:
Hi,

I need someone to write a TSQL function that returns the name of the ODBC DSN for a given connection.

I can use the queries below, to get information about the connection, but none of these return the DSN name for example.
1. select * from sys.dm_exec_connections
2. select * from sysprocesses
3. select connectionproperty('net_transport')
4. select connectionproperty('protocol_type')

This link shows the C# class that may be able to return this information.
http://msdn.microsoft.com/en-us/library/system.data.odbc.odbcconnection.connectionstring.aspx

So if ...
I use a client to connect to SQL Server using odbc connection with a DSN name of ConnectionA and
YOU use a client to connect to the same SQL Server using odbc connection with a DSN name of ConnectionB,

when you run
SELECT dbo.ufn_GetODBCDSN()
you should get "ConnectionB"

and when I run
SELECT dbo.ufn_GetODBCDSN()
I should get "ConnectionA"...

I am NOT looking for stored procedures like sp_enumdsn or sp_dsninfo...
I only say this as some of the developers here have been suggesting this kind of answers..

So to be clear, I am looking to find out what the CLIENT DSN name was, that the connection is using.
I am NOT looking for DSNs defined on the SERVER.

Could you quote for writing this function (dbo.ufn_GetODBCDSN() ) that I can use from TSQL code that returns the name of the DSN?

Thank you

Skills required:
.NET, C# Programming, Database Administration, SQL
Hire aasimkhalid
Project posted by:
aasimkhalid United Kingdom
Verified
Public Clarification Board
Bids are hidden by the project creator. Log in as the employer to view bids or to bid on this project.
You will not be able to bid on this project if you are not qualified in one of the job categories. To see your qualifications click here.


$ 277
in 10 days
$ 350
in 7 days
$ 200
in 7 days
$ 250
in 5 days
$ 250
in 3 days
$ 226
in 7 days
$ 222
in 5 days
Hire GabrielDreb
$ 190
in 3 days
Hire hoangtqb
$ 222
in 7 days
Hire globsware
$ 88
in 3 days