Customizing tables and SPs to my user ID

Discussion in 'Databases' started by Amir Simantov, Jan 3, 2009.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hello,

    I uploaded the BAK file and restored the database successfully. I have changed the connection string in my code and it recognized the database.

    However, all the names of tables and store procedures are prefixed with my previous user ID (login name) as it was in the previous host. Therefore, code cannot
    access them. How do I change the names to be prefixed with my new user ID?

    Thanks,
    Amir
     
  2. JorgeR

    JorgeR DiscountASP.NET Staff

    Amir

    you can change it by using the alter schema statement or the easiest method is to use the command against your database;
    EXEC master..sp_msforeachtable 'sp_changedbowner '?',dbo'

    or


    alter schema [dbo] transfer [currentschema].[table_name]


    junior

    DiscountASP.NET

    www.DiscountASP.NET
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page