SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Create Schema Alias References Another Schema


Create Schema Alias References Another Schema

Author
Message
Garfi61416
Garfi61416
SSC Rookie
SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)

Group: General Forum Members
Points: 32 Visits: 9
I wanted to know if/how I can create a schema alias that references another schema name such that I can get tables from the original schema alias. The reason I ask is that I have a SS2K DB that is case-sensitive. But I need to do insensitive queries against it. So I was hoping there was a way to create an uppercase schema name that can be used to get a list of tables from the original case-sensitive schema name.

For example,

If I have a schema called dbo, such that select * from dbo.USERTABLE returns a list of columns

I want to be able to create another schema called DBO such that select * from DBO.USERTABLE will return the same result.

I've spent two days straight trying to come up with something, so any and all help would be greatly appreciated.

I need to get this done, so if there are other possibilities to accomplish this, I am open to suggestions.

Thanks in advance.
RBarryYoung
RBarryYoung
SSC-Dedicated
SSC-Dedicated (34K reputation)SSC-Dedicated (34K reputation)SSC-Dedicated (34K reputation)SSC-Dedicated (34K reputation)SSC-Dedicated (34K reputation)SSC-Dedicated (34K reputation)SSC-Dedicated (34K reputation)SSC-Dedicated (34K reputation)

Group: General Forum Members
Points: 34520 Visits: 9518
Not automatically. I think that you would have to create Views/Synonyms in your CI schema to map to the objects in your CS schema.

Plus, I don't think that Case-Sensitivity or collation is a schema attribute, so you might have to put the CI schema in a different database.

-- RBarryYoung, (302)375-0451 blog: MovingSQL.com, Twitter: @RBarryYoung
Proactive Performance Solutions, Inc.
"Performance is our middle name."
Garfi61416
Garfi61416
SSC Rookie
SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)

Group: General Forum Members
Points: 32 Visits: 9
Okay, so if I create a seperate database with a seperate schema, can I make calls to the original database and CS schema? Is there some view/procedure I can create that will give me all tables in the CI database from the CS database? Also, do you know of a way to filter all database requests for a particular database through a procedure to begin with? Perhaps some sort of translator that when a user attempts to connect to the database from a JDBC connection, they will go through the procedure first?
RBarryYoung
RBarryYoung
SSC-Dedicated
SSC-Dedicated (34K reputation)SSC-Dedicated (34K reputation)SSC-Dedicated (34K reputation)SSC-Dedicated (34K reputation)SSC-Dedicated (34K reputation)SSC-Dedicated (34K reputation)SSC-Dedicated (34K reputation)SSC-Dedicated (34K reputation)

Group: General Forum Members
Points: 34520 Visits: 9518
Well a Veiw will filter all queries through its SELECT statement. If you need to filter it through a procedure, then you woul dneed the view to SLEECT from a table-valued function (not inline) instead.

Honestly, I have never dealt with a CI to CS situation before, so I cannot advise you much. I have, however, done projects for customers where I automated the generation of views in one databas for all of the tables in another.

-- RBarryYoung, (302)375-0451 blog: MovingSQL.com, Twitter: @RBarryYoung
Proactive Performance Solutions, Inc.
"Performance is our middle name."
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search