blog post

SELECT INTO copies data from one table into a new table.
SELECT INTO creates a new table located in the default filegroup.

The SQL SELECT INTO syntax

The general syntax is:
SELECT column-names
  INTO new-table-name
  FROM table-name
 WHERE EXISTS 
      (SELECT column-name
         FROM table-name
        WHERE condition)

The new table will have column names as specified in the query.

SQL SELECT INTO Example

Problem: Copy all suppliers from USA to a new SupplierUSA table.

SELECT * INTO SupplierUSA
  FROM Supplier
 WHERE Country = 'USA'
 

  • Share This Story


Pleas give your valuable comments to improve the contents.

about author

Atul kumar shukla


I'm Atul Kumar Shukla, working as a web developer.
Welcome to my Blog. This is my personal blog where i post my own questions and answers , articles about ASP.Net., SQL Server, HTML, CSS, Jquery and many more..

Visit Profile

Leave a comment

Name
E-mail
Url
Message

Get More Stuff
Subscribing to the TheOneblogs newsletter and get intersting stuff and updates to your email inbox.
Your Email

 

Style Switcher

Change Color

×! We use cookies to improve your user experience. More information