This is a migrated thread and some comments may be shown as answers.

Update Database from Model to specified Schema

1 Answer 52 Views
Design Time (Visual Designer & Tools)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
David
Top achievements
Rank 1
David asked on 15 Jul 2014, 05:19 PM
I am preparing to Update the database from a Telerik Data Access Model I have designed and I do not want the tables created in the dbo Database schema.  How do I specify which schema I want the tables created in?  I saw some instructions for adding ALTER SESSION SET CURRENT_SCHEMA=<new schema> in the Init SQL field of the Connection Pool under Backend Configuration, but this command does not work for MS SQL 2008.  

Thank you

1 Answer, 1 is accepted

Sort by
0
Boris Georgiev
Telerik team
answered on 17 Jul 2014, 06:22 AM
Hi David,

The SQL which you point out is for Oracle, not for MS SQL. The Init SQL which you should set to use a default schema other than "dbo" in MS SQL is:
ALTER USER yourUser WITH DEFAULT_SCHEMA = myschema;
Unfortunately if you are using Windows Authentication this SQL will not work.

There is a workaround - when you create a new Domain Class, you could change the schema for it from the Table Editor when you map the class to a new Table. You should have in mind that by default when you first map a class to a table, the Schema Name field is disabled, so you should map the class first, close the Table Editor and then open it again to edit the mapping.

I hope that helps.

Regards,
Boris Georgiev
Telerik
 
OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
 
Tags
Design Time (Visual Designer & Tools)
Asked by
David
Top achievements
Rank 1
Answers by
Boris Georgiev
Telerik team
Share this question
or