Solved

SQL DB2005

Posted on 2010-11-15
6
840 Views
Last Modified: 2013-11-10
I have about 200 Store Pro. and 300 Views in my Database. I need to change the Database schema from eds.qqqqq to dbo.qqqqqq inside outside and inside these Sp's and Views.

Is there any code I can use in SQL or any SSIS PCKG I can use?

any advice?
Thanks
0
Comment
Question by:DBA2010
6 Comments
 
LVL 10

Expert Comment

by:Humpdy
ID: 34137560
0
 
LVL 3

Accepted Solution

by:
expert_dharam earned 500 total points
ID: 34137659
Follow these steps:
1. Open 'SQL Server Management Studio'
2. Login with Windows Authentication
3. Select and Right Click on the respective database
4. Goto Tasks > Generate Scripts
5. Generate scripts for SPs and Views only
6. Save the script to your desired location and then open it
7. Replace "[eds]." with "[dbo]."
8. Execute the script

(For safe execution, create a dummy database and then execute the script to test.)
0
 

Author Comment

by:DBA2010
ID: 34138367
I cant creat the script. I have this error.
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown. at Microsoft.SqlServer.Management.SqlScriptPublish.GeneratePublishPage.worker_DoWork(Object sender, DoWorkEventArgs e) at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e) at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)
0
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 
LVL 3

Expert Comment

by:expert_dharam
ID: 34138814
Seems you do not have sufficient RAM to perform this operation.
Make sure you close all the application before you start generating scripts.
Best way to release all the memory resources is by rebooting your system.
0
 

Author Comment

by:DBA2010
ID: 34141970
thanks alot
0
 
LVL 30

Expert Comment

by:Reza Rad
ID: 34142547
No need to generate scripts,
use this sql statement:

DECLARE @sourceschema VARCHAR(100)

DECLARE @destinationschema VARCHAR(100)

SET @sourceschema = 'sourceschema'

SET @destinationschema = 'destinationschema'

SELECT 'ALTER SCHEMA ' + @destinationschema + ' TRANSFER ' + b.name + '.' + a.name FROM sys.objects a JOIN sys.schemas b

ON a.schema_id=b.schema_id WHERE a.type IN ('U','P','FN','V') AND b.name=@sourceschema


referenece:
http://www.sql-articles.com/scripts/change-transfer-schema-for-all-objects
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Microsoft – Kerberos Configuration Manager. Delegation service account query 1 38
SQL Group By Question 4 20
SQLCMD Syntax 2 15
Parse this column 6 27
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Via a live example, show how to shrink a transaction log file down to a reasonable size.

830 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