What you want to see on DotNetFunda.com ?
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 12830 |  Welcome, Guest!   Register  Login
 Home > Forums > Sql Server > what the use of into statement in SQL ? ...
Gow.Net

what the use of into statement in SQL ?

Replies: 2 | Posted by: Gow.Net on 4/28/2012 | Category: Sql Server Forums | Views: 375 | Status: [Member] | Points: 10  


what the use of into statement in SQL ?

gowthaman8870226416


Reply | Reply with attachment | Alert Moderator

 Responses below this adGet hundreds of .NET Tips and Tricks videos

 Replies

Pandians
Pandians  
Posted on: 4/28/2012 9:31:56 AM
Level: Silver | Status: [Member] [MVP] | Points: 50

Resolved

Hi

we can use "INTO" statement in various situations...

Normally, when we copy an existing table into an another name.
SELECT * INTO NewTableName FROM ExistingTableName
GO
(or)
Asigning a column value into a variable inside the CURSOR

Note:
1. If you want to copy only the structure then simply include WHERE clause with FALSE condition
SELECT * INTO NewTableName FROM ExistingTableName WHERE 1=0
GO

I hope it would help to proceed further!

Cheers
www.SQLServerbuddy.blogspot.com
iLink Multitech Solutions

Gow.Net, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Muhsinathk
Muhsinathk  
Posted on: 6/20/2012 3:52:55 AM
Level: Bronze | Status: [Member] | Points: 25

The SELECT INTO statement selects data from one table and inserts it into a different table.
The SELECT INTO statement is most often used to create backup copies of tables.

Refer this link
http://msdn.microsoft.com/en-us/library/ms188029(v=sql.110).aspx

Gow.Net, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Reply - Please login to reply


Click here to login & reply

Found interesting? Add this to:


 Latest Posts

Write New Post | More ...

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/25/2013 12:55:40 AM