In this tip, Sergey introduces the construct with easy to followĮxamples and he also explains some more advanced concepts such as specifying A good introduction to the SELECT … INTO construct can be found inĬreating a table using the SQL SELECT INTO clause - Part 1 and.If you specify an ORDER BY clause, the order of the inserted rows is still.One exception is the IDENTITY constraint, but there are a couple of conditions. Like with partitioning, those properties are not transferred from the source You cannot specify indexes, constraints, computed columns or triggers.Even if the source table used in the SELECT is partitioned, There are some drawbacks when you use SELECT … INTO to create a new table. Once the stored proc is over, the data can be discarded.Įven though you can insert into a new temp table, you cannot use SELECT … For example, when you are debuggingĪ query, or in a stored procedure when you want to write intermediate results toĭisk. Using INTO and temp tables is useful when you want to dump data into a table,īut you only have use for it for a limited time. As long as there is at least one connection open that is referencing the global
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |