Menu ▾ ▴

#577 MSSQL: username must == schema name and user must own schema

open
nobody
None
5
2012-12-29
2007-11-07
John Hardin
No

SQuirrel SQL 2.6.1
MS SQL Server 2005

I'm logging into an SQL Server 2005 server using a database user (vs. Windows auth). This user uses a schema that is not named the same as the user's login name; that schema is the user's default schema.

The Alias Properties dialog does not see the schema. When the database is queried for the existing schemas, it includes a schema with the same name as the database user name even though such a schema does not actually exist in the database. The same bogus schema name is displayed in the object view.

Attempting to expand, refresh, etc. the tree is fruitless. No tables, views, or other objects are ever detected under that nonexistent schema. There is no way to view the tables that are in the user's default schema.

In order for Squirrel to successfully retrieve schema data from MSSQL, the database user name (but not necessarily the login name) must match the schema name and that user must be the schema owner. This is not guaranteed to be the case and assuming this is the case is not justified in all cases.

To repro:
Create a database.
Create a schema in that database and give it a name.
Add some tables to that schema.
Create a database user with a login and user name that are different from the schema name (the login and user names may be the same as or different from each other), and set the user's default schema to the schema you created.
Connect via squirrel and attempt to get schema information.

Discussion

  • EkriirkE

    EkriirkE - 2007-11-12

    Logged In: YES
    user_id=1580241
    Originator: NO

    I, too, have this problem. I used to be able to browse user schemas and other non-"dbo." tables - now I can only view the information under "dbo" with 1.6.1
    However Squirrel has no problem using these in SQL statements. Ctrl+Clicking a table in a working query simply results in Squirrel locking up for about 10 seconds then an error about not being able to locate the schema.

    I have to fall back on SQL Server Management Studio if I want to view non dbo.

     
  • Nobody/Anonymous

    Hello, i installed newest 3.0.1 and connection to:

    Microsoft SQL Server Management Studio 9.00.4035.00
    Microsoft Analysis Services Client Tools 2005.090.4035.00
    Microsoft Data Access Components (MDAC) 2000.085.1117.00 (xpsp_sp2_rtm.040803-2158)
    Microsoft MSXML 2.6 3.0 4.0 5.0 6.0
    Microsoft Internet Explorer 7.0.5730.13
    Microsoft .NET Framework 2.0.50727.3082
    Operating System 5.1.2600

    is working with the newes microsoft jdbc driver.
    If i select a Database, no tables where be listed! What can solve the Problem before i fall back to Management Studio?

     
  • Nobody/Anonymous

    I am seeing this behviour too. The bug renders squirrel useless for non-username schemas.

    I believe SQL Server 2005 was the first version to allow schemas which were not the username.

    This bug is a showstopper for SQL Server users who are on 2005 and who are using the schema functionality.

     

Log in to post a comment.