Solved

Mgmnt Studio change schema name.

Posted on 2007-04-10
6
530 Views
Last Modified: 2008-01-09
Please outline the steps Using Management Studio for SQL 2005.


How do I change the schema name for a database?

I want the tables to appear as mychosenname_xxx instead of dbo_xxx



0
Comment
Question by:Volibrawl
  • 3
  • 2
6 Comments
 
LVL 27

Accepted Solution

by:
ptjcb earned 250 total points
ID: 18884428
It is a two step process in script. One to create the schema, the second to transfer the table. You would have to do this for every table that you want to transfer. You may also authorize a different user (rather than dbo). You can read more about it under CREATE SCHEMA and ALTER SCHEMA in books online.

CREATE SCHEMA mychosenname_xxx AUTHORIZATION dbo;

ALTER SCHEMA mychosenname_xxx TRANSFER dbo.Address;
0
 
LVL 9

Author Comment

by:Volibrawl
ID: 18899825
So, like my other question, there is no tool in Management Studio to do this either?

I have to write 2 scripts for each of the 50 tables?
0
 
LVL 9

Author Comment

by:Volibrawl
ID: 18899831
Excuse me, 1 script for each of the tables.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 27

Expert Comment

by:ptjcb
ID: 18907389
No, no tool in SMS to create and transfer. Schema is new to SQL 2005 (it was the owner in 2000), so there are new rules and situations. Manipulating schemas requires T-SQL.

0
 
LVL 9

Author Comment

by:Volibrawl
ID: 19003563
OK, can't be done, huh?

The more I use this Management Studio, the more I find I can't do any of the things I want to do with it.

Thanks anyway..


0
 

Expert Comment

by:va2505
ID: 22922945
SQL 2005 SMS   has tool to create and transfer Schema.
1. To create new Schema go to Security-Schemas (add new)
2. To rename schema.:
2.1 First you need activate Property window  just click F4 (or select from  Menu - View - Properties Window)
2.2 Then right click on table name and select Design. Design window is opened and you can change schema  name in properties window.  Don't forget TO SAVE it. Click on save button   :)

0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now