Competition: What’s your favorite Redgate tool? Enter now.

Refactor owner without owner reference in t-sql

sleepyheadsleepyhead Posts: 13
edited April 23, 2007 10:17AM in SQL Refactor Previous Versions
Is it possible to generate a script without writing the owner of the object in the stored procedures? I want to change owner of a object from 'User' to 'dbo' but I do not want store procedures to reference dbo.TableName, instead I just want select field from TableName. Is this possible?

Comments

  • The easiest way to do this is to use the smart rename feature although this won't give you exactly what you require.
    You can right click on an object and use the smart rename to create a script that will give you a script that will have a creating portion that you can copy, edit and use.

    If you just want to change the owner than i would recommend using the smart name as it will search out any dependant objects, and rename them in the script.

    Dan
    Daniel Handley
    Red Gate Software Ltd
Sign In or Register to comment.