Login or Sign Up to become a member!
LessThanDot Sit Logo

LessThanDot

Data Management

Less Than Dot is a community of passionate IT professionals and enthusiasts dedicated to sharing technical knowledge, experience, and assistance. Inside you will find reference materials, interesting technical discussions, and expert tips and commentary. Once you register for an account you will have immediate access to the forums and all past articles and commentaries.

LTD Social Sitings

Lessthandot twitter Lessthandot Linkedin Lessthandot friendfeed Lessthandot facebook Lessthandot rss

Note: Watch for social icons on posts by your favorite authors to follow their postings on these and other social sites.

Your profile

Search

XML Feeds

Google Ads

« The SQL Server Memory Leak ConfusionSite is no more after they discover they did not have SQL Server backups »
comments
Rate Post:
submit to reddit Digg!FacebookDotnetkicks

Today I had to change the schema of a stored procedure. I couldn't find a clicky click method to do this in SQL server management studio (which kinda worries me). So I looked on google for a method and found this. But not being an SQLguru I took a few seconds to sink in.

So the syntax is.

ALTER SCHEMA nameoftheschematotransferto TRANSFER nameandschemaoftheSP

For example:

We have an SP called username.spo1 and I want to change it to dbo.spo1 so I would change it from schema username to schema dbo. This would then mean

  1. ALTER SCHEMA dbo TRANSFER username.spo1

The funny thing is that not even SQL prompt from Redgate recognizes the word TRANSFER as a keyword. So I guess transfering schemas is not a very common event.

About the Author

User bio imageChristiaan is a forensic technician who programs on the side, although my function description says that I do IT-things for 90% of the time . I'm an avid VB.NET fan and I use lots of the ALT.Net techniques, like unit-testing, nhibernate, logging, IoC, ...
Social SitingsTwitterLinkedInHomePageLTD RSS Feed
974 views
submit to reddit Digg!FacebookDotnetkicks

Comments and Feedback

1 comment

Comment from: SQLDenis [Member] Email
*****
Back in SQL 2000 days you had to use sp_changeobjectowner
06/01/09 @ 10:30

Leave a comment


Your email address will not be revealed on this site.

Your URL will be displayed.
(Line breaks become <br />)
(Name, email & website)
(Allow users to contact you through a message form (your email will not be revealed.)