New answers tagged temp-tables
It's difficult to understand your question. Do you mean that you want to copy the data in a table into new rows, but update DATE values? For example, is the following what you're trying to do? ORIGINAL TABLE_1: TABLE_ID | VALUE_1 | VALUE_2 | DATEFIELD 1 | 'Somedata' | 'Someotherdata' | 2012-05-01 ... And you want to produce: UPDATED ...
The only way to see the temp table needed would be to micromanage the process. Here is how: USE mydb CREATE TABLE anonymized_table_name_new LIKE anonymized_table_name; ALTER TABLE anonymized_table_name_new ADD COLUMN `anonymized_column_name` VARCHAR(100) NULL; INSERT INTO anonymized_table_name_new (list of all columns except anonymized_column_name) SELECT ...
OPTION 1: To find the size of this table you can use the follow query: SELECT DATA_LENGTH+INDEX_LENGTH AStotalTable, TABLE_ROWS from information_schema.TABLES WHERE TABLE_SCHEMA = 'DB_NAME' AND TABLE_NAME = 'TABLE_NAME'; Now you have to calculate the difference from the actual size totalTable + what you will add, see the list on [MySQL Documentation] ...
Yes, just do : select * into dbo.NewTable FROM #tempTable
Why not use the same approach you used to create the #temp table? SELECT * INTO dbo.NewTable FROM #tempTable;
Top 50 recent answers are included