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.
| Author |
Topic |
|
claire99
Starting Member
17 Posts |
Posted - 2003-02-04 : 16:56:52
|
| I am new in sql. I'd like to rename a table. Can anyone know sql query about it? Thanks in advance.-------------------"And we know that all things work together for good to them that love God, to them who are the called according to his purpose." --- Roman 8:28 |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2003-02-04 : 17:07:23
|
| look at sp_rename==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
claire99
Starting Member
17 Posts |
Posted - 2003-02-04 : 18:07:58
|
| I need to use this query in sql sever 2000 DTS. I'm using "EXEC sp_rename 'table_n', 'table'" but it is showing below error message:"could not find the object "sp_name"... Anyone can help? Thanks in advance!-------------------"And we know that all things work together for good to them that love God, to them who are the called according to his purpose." --- Roman 8:28 |
 |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2003-02-04 : 18:13:29
|
| Include the database name (master) when executing sp_rename:EXEC master..sp_rename 'table_n', 'table' |
 |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2003-02-04 : 18:28:55
|
| DTS?Just execute it in query analyser.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
claire99
Starting Member
17 Posts |
Posted - 2003-02-04 : 18:30:41
|
| New error message when i added the database name"is not a stored procedure"-------------------"And we know that all things work together for good to them that love God, to them who are the called according to his purpose." --- Roman 8:28 |
 |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2003-02-04 : 19:04:04
|
| Something strange going ontry select * from master..sysobjects where type = 'P' order by nameAnd look for sp_renamealso are you working in v6.5 emulation mode? Don't know if that would make a difference.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
claire99
Starting Member
17 Posts |
Posted - 2003-02-05 : 10:44:01
|
| Thanks to all!EXEC sp_rename table_o, table_n works!-------------------"And we know that all things work together for good to them that love God, to them who are the called according to his purpose." --- Roman 8:28 |
 |
|
|
|
|
|