Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2008
»
SQL Server 2008 - General
»
sp_rename
sp_rename
Rate Topic
Display Mode
Topic Options
Author
Message
IgorMi
IgorMi
Posted Sunday, February 17, 2013 5:57 AM
SSCommitted
Group: General Forum Members
Last Login: Today @ 9:55 AM
Points: 1,877,
Visits: 1,445
Hi All,
I need to use sp_rename -
http://msdn.microsoft.com/en-us/library/ms188351.aspx
I need to use it for tables in the following way:
For an existing "table_name" table i create "table_name_new" table. I copy all the data from "table_name" to "table_name_new". Then i drop "table_name" and rename "table_name_new" to "table_name". Finally i create the FKs and indexes with same definitions as they were in "table_name".
I know it could be problematic using sp_rename for some other objects like SPs, FNs ...
Has anyone experienced any problems with renaming a table in this way. Please share.
Can anyone confirm as save the usage of sp_rename, and/or suggest something additionally.
Thanks
IgorMi
Post #1420970
jeetsingh.cs
jeetsingh.cs
Posted Monday, February 18, 2013 3:13 AM
SSC-Enthusiastic
Group: General Forum Members
Last Login: Thursday, May 16, 2013 11:06 PM
Points: 179,
Visits: 380
you should first check the dependencies for the particular object
by sp_depends
or by sys.dm_sql_referencing_entities ('OBJECT', 'OBJECT');
then you can modify your object in a more appropriate way
Post #1421120
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.