Modify SQL table

SQL seams to have issues when we try to modify a table and preserving data,
I found it helpful to have a quick statement to do this copy, while preserving data.
It actually copy fields into new table, then rename them

CodeFunctionName
What is this?

Public

Tested

Original Work
NewTableName table should already been created with new structure, like adding new columns, removed not needed columns, or changing the order of columns, etc...

use YourDatabaseName
Insert into NewTableName (Columns, withValues, FromOld, table, like, CategoryeID, CategoryName, DateAdded)
Select Columns, withValues, FromOld, table, like, CategoryID, CategoryName, DateAdded from OldTableName


Views 3,616

Downloads 1,329

CodeID
DB ID

ANmarAmdeen
609
Attachments
Revisions

v1.0

Saturday
June
9
2018