Re: SQL Server 2005 Connection Only By ODBC



Joe K. (JoeK@xxxxxxxxxxxxxxxxxxxxxxxxx) writes:
I have a SQL Server 2005 database server that has a SQL user account
that I would like to restrict it from connecting with SSMS only
connecting with ODBC.

Is there something I can do with the user account that allow it only to
connect by ODBC?

You could set up a logon trigger that checks
sys.dm_exec_sessions.client_interface_name and raise an error if the
value is not ODBC.

However, I'm not sure that I see the point in restricting a user to only
use a certain protocol. He will not be able to connect from SSMS which
uses ADO .Net, but he will be able to use OSQL-32 or the old Query
Analyzer, which both use ODBC.

Is there something within SQL Server 2005 (SSMS), that can tell me how the
user account was connection to SQL Server instance? (SSMS,ODBC,.etc)

Beside the column I mention above, there is also the system function
app_name(). However, this value is set in the connection string and
can be spoofed.


--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

.



Relevant Pages

  • Re: How to get the IndexNames
    ... are you connecting to ... I connect to a SqlServer 2000 database using an ODBC driver from ... Microsoft 'SQL server v 200.85.1117.00'. ... in that case I would suggest to use the MS SQL Server OLE DB provider ...
    (borland.public.delphi.database.ado)
  • Re: Connection Error: ADO.Net and SQL Server 2005
    ... using ODBC to connect to SQL Server can and does work. ... Search my blog for "Connecting" and read the whitepapers there that discuss ... but one client has had problems and the error he gets is of ...
    (microsoft.public.sqlserver.connect)
  • Connection Error: ADO.Net and SQL Server 2005
    ... I have an application that uses ADO.Net to connect to SQL Server. ... but one client has had problems and the error he gets is of the ... and he has no problem connecting through ODBC. ...
    (microsoft.public.sqlserver.connect)
  • Remote connection
    ... It must be so easy that neither SQL Server nor ODBC help dev. ... It must be easier then previewing or connecting to a table in ... No mater how –Server to Server or ODBC to Server –I need to create remote ...
    (microsoft.public.sqlserver.server)
  • User Account Only by ODBC Not SSMS (SQL 2005)
    ... I have a SQL Server 2005 database server that has a SQL user account that I ... would like to restrict it from connecting with SSMS only connecting with ODBC. ...
    (microsoft.public.sqlserver.server)