![]() |
| Making a copy of a MS SQL table |
|
Candywrapper
|
Here is an extremely simple script to make a copy of a MS SQL table. I had need to experiment with some Cold Fusion code in developing a project and was afraid I would mess up the original database table when I ran the script so I needed a backup of the table before running the script. Kyle, at HostMySite, suggested that I post the script as others might have the same need. Here it is. I hope it helps others.
<!--- *************************************************** Project Name: Copy SQL Table Initial Creation Date: 5/22/2007 Author: Warren Hoffnung GGTE warren@ggte.com Purpose: This is a handy way to create a backup or a copy of a SQL Table. Application Note: There is no need to create the new table prior to running the script. The new table will be automatically created by SQL Server. You do not have to be running ColdFusion. You can simply use the 3 lines of the query in Enterprise Manager or however you access your SQL Database. It is probably obvious but just in case, do not type the [ ] when you run the script. Simply substitute your own information. <B>REVISION HISTORY</B> Date: *************************************************** ---> <cfquery name="copytable" datasource="#DS#" username="#User#" password="#PW#"> SELECT * INTO [your_new_table_name] FROM [the_table_you_want_to_copy] </cfquery> |
||||||||||||
|
|
|||||||||||||
| Making a copy of a MS SQL table |
|
||
|


