?
Solved

Mgmnt Studio change schema name.

Posted on 2007-04-10
6
Medium Priority
?
543 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 1000 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
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

 
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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Windocks is an independent port of Docker's open source to Windows.   This article introduces the use of SQL Server in containers, with integrated support of SQL Server database cloning.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Suggested Courses

829 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