Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 rename

Author  Topic 

jtwork
Yak Posting Veteran

82 Posts

Posted - 2008-06-06 : 04:36:29
i am trying to set up a way of renaming a table in a sp.

ive been using

exec sp_rename 'old table', 'new table'

however if i try and specify to database and owner i end up with a weired db.owm.db.own.table name in the outcome. ive tried putting using it without specifying a db name in a sp and then sched job to exec the sp but it doesnt rename, probably because it doesn know which db to look for the ld table name in. however the sched job doesnt fail?

any ideas?

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-06-06 : 04:58:14
Were you trying to change only the schema name?
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-06-07 : 00:09:51
You can specify which db the job step run under.
Go to Top of Page
   

- Advertisement -