?
Solved

SQL DB2005

Posted on 2010-11-15
6
Medium Priority
?
845 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 10

Expert Comment

by:Humpdy
ID: 34137560
0
 
LVL 3

Accepted Solution

by:
expert_dharam earned 2000 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
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
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

What Is Blockchain Technology?

Blockchain is a technology that underpins the success of Bitcoin and other digital currencies, but it has uses far beyond finance. Learn how blockchain works and why it is proving disruptive to other areas of IT.

Question has a verified solution.

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

I have a large data set and a SSIS package. How can I load this file in multi threading?
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…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…
Suggested Courses

800 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