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

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 716 Downloads 331

'SQL', 'Modify', 'Copy', 'preserve'

ANmarAmdeen
333
Attachments
Database SQL
Revisions

v1.0