Sunday, February 26, 2012

Hiding System Tables when connecting with non-microsoft clients

I have a user who would like to connect to a SQL Server database using SAS (a
statistical application) and have the system tables not be displayed
Currently, when the user connects they are shown all of the tables
(including system table). We have inquired on the SAS side and have been
told that it is something that must be on the database side.
Do I need to remove some default permissions? Or send a special connection
string? I know in Ent. Manager, you just clear the show system tables
checkbox - but there is not an option like that when connecting with SAS.
No, it is not something that you can do in the database. You'll have to get
your SAS guys to change their query that retreives the table list. For
example, the following query returns system and user tables, where as the
second one doesn't:
SELECT TABLE_SCHEMA, TABLE_NAME
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE = 'BASE TABLE'
--AND OBJECTPROPERTY(OBJECT_ID(TABLE_SCHEMA + '.' + TABLE_NAME),
'isMSShipped') = 0
SELECT TABLE_SCHEMA, TABLE_NAME
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE = 'BASE TABLE'
AND OBJECTPROPERTY(OBJECT_ID(TABLE_SCHEMA + '.' + TABLE_NAME),
'isMSShipped') = 0
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Mike" <Mics_79@.online.nospam> wrote in message
news:AD6C6A91-7912-429F-90BA-7169CA29B641@.microsoft.com...
I have a user who would like to connect to a SQL Server database using SAS
(a
statistical application) and have the system tables not be displayed
Currently, when the user connects they are shown all of the tables
(including system table). We have inquired on the SAS side and have been
told that it is something that must be on the database side.
Do I need to remove some default permissions? Or send a special connection
string? I know in Ent. Manager, you just clear the show system tables
checkbox - but there is not an option like that when connecting with SAS.

No comments:

Post a Comment