Skip to content

DB.tables not return all tables with MSSQL #446

Closed
hiscaler opened this Issue Feb 25, 2012 · 3 comments

2 participants

@hiscaler

Connection string is follow:

DB = Sequel.connect('ado://sa:system_admin@server/AdventureWorks?host=localhost&provider=SQLNCLI10')

But in MSSQL Server2008, DB.tables return tables if not full tables. why?

in mysql is always return all tables.

@jeremyevans
Owner

Can you be more specific? Does DB.tables return no tables, or only a subset of the tables that you think that it should return? If a subset, which tables does it not return, and what is different about those tables compared to the tables it does return?

@hiscaler

Yeah, i found diff, in my AdventureWorks mssql database, has more tables. but only three tables with dbo prefix. is follow:
dbo.AWBuildVersion
dbo.DatabaseLog
dbo.ErrorLog
Table-1
Table-2
...
Tales-N

soDB.tables return this three tables, but not return other tables. Other table name not has 'dbo.' prefix.

@jeremyevans
Owner

This is expected behavior. If you want tables outside the dbo schema, you need to pass the :schema option: DB.tables(:schema=>:schema_name). The only reason this isn't required on mysql is that mysql does not support schemas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.