SQL Snippets: SELECT INTO

Microsoft SQL ServerThis post is part of the series on SQL Snippets.

I occasionally need to make a backup of a SQL table and all rows within; while you can create a table and insert the content, this is the long way of doing. Instead you can use SELECT INTO to both create a table with the correct columns and also to copy the data.

In the below example I am creating a new table suffixed with the date; the first highlighted section is the new destination table to be created and the second the source table:

SELECT *
INTO IV00101_20210910
FROM IV00101

Can ISC Software Solutions help?

ISC Software Solutions are UK and Ireland based experts on Microsoft Dynamics GP. If you’d like to speak to someone about support, consultancy, upgrades, implementation, development, GP Elementz add-ons or portals, or anything else Dynamics GP related, you can use the form below.





Your Name (required):
Your Email (required):
Subject:
Enquiry message:

What should we write about next?





Your Name (required) –
Your Email (required) –

Leave a Reply

Your email address will not be published. Required fields are marked *