CFF KB - Carrz-Fox-Fire Promotions Knowledge Base
CFF KB is all about 1 thing: The Sharing of Knowledge and the Power we gain from it.Knowledge Base
- Breadrumbs:
ALTER SCHEMA to dbo
- Article ID:
56 - Date Created
Wednesday, November 24, 2010 - This Article Has been Viewed
1849 times - Short Desc
When you create a table in another SQL Server Mangement Studio the SCHEMA name may differ from your current name. - Details
When you create a table in another SQL Server Mangement Studio, and then import that table into your current running SQL Server Management Studio, you will notice that the name of the SCHEMA is not the same as your others (Default SCHEMA Name: dbo)
If you choose not to correct this issue, then you will have to provide the SCHEMA name with your table name in your SQL Statements.
Example<%
sql.commandtext="select column from myschema.tablename"
%> - Recreate Issue
Importing databases or tables into other SQL Server Management Studios will cause the SCHEMA names to differ from one another. - Resolve Issue
To correct this issue within SQL Server Management Studio.
Perform the following action.
Right click on the Database name
Choose New Query
Paste this into the Query editor.
ALTER SCHEMA dbo TRANSFER otherschema.yourtablename
If you have multiple tables that need to have their SCHEMA names changed, simply just copy this code out as many times as needed, and change the .yourtablename for each one and run them all together.
To view the ending results, you will need to colapse the database tree in the Object Explorer and then Right click on your database and choose Refresh.
You will then see the live version of your database with the changed SCHEMA names.
Share With Friends (Updated 6-8-2010)
Recent Articles
All Topics
- Coming Soon - Knowledge Exchange
Trending Articles
- Microsoft VBScript runtime error '800a0046' Permission denied FileSystemObject 24694
- Microsoft OLE DB Provider for SQL Server error '80040e57' String or binary data would be truncated. or The field is too small to accept the amount of data you attempted to add. Try inserting or pasting less data. 21297
- ADODB.Parameters error '800a0e7c' Parameter object is improperly defined 19544
- After Effects warning: Audio conforming failed for the following file .cfa. Perhaps due to disk space 17785
- The backup set holds a backup of a database other than the existing 16825