I have two questions:
1) Is it possible to rename a SQL table –or- copy the content of a table into a new table ?
2) How to replace the renamed or replaced table name inside the code of Stored Procedures that references it ?
1.
Copy only schema
Select * into NewTable from table1 where 1=2;
Copy schema with data
Select * into NewTable from table1;
2.
use "sp_rename" stored procedure
http://doc.ddart.net/mssql/sql70/sp_ra-rz_11.htm
No comments:
Post a Comment