Course Hive
Search

Welcome

Sign in or create your account

Continue with Google
or
Select into in sql server
Play lesson

SQL Server tutorial for beginners - Select into in sql server

5.0 (5)
35 learners

What you'll learn

This course includes

  • 27 hours of video
  • Certificate of completion
  • Access on mobile and TV

Summary

Keywords

Full Transcript

select into existing table sql server insert into select only some columns select into copy table structure select into schema only select into from multiple tables select into from two tables select into from external database select into from different server select into from one server to another In this video we will discuss the power and use of SELECT INTO statement in SQL Server. Healthy diet is very important both for the body and mind. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking our YouTube channel. Hope you can help. https://www.youtube.com/channel/UC7sEwIXM_YfAMyonQCrGfWA/?sub_confirmation=1 The SELECT INTO statement in SQL Server, selects data from one table and inserts it into a new table. SELECT INTO statement in SQL Server can do the following 1. Copy all rows and columns from an existing table into a new table. This is extremely useful when you want to make a backup copy of the existing table. SELECT * INTO EmployeesBackup FROM Employees 2. Copy all rows and columns from an existing table into a new table in an external database. SELECT * INTO HRDB.dbo.EmployeesBackup FROM Employees 3. Copy only selected columns into a new table SELECT Id, Name, Gender INTO EmployeesBackup FROM Employees 4. Copy only selected rows into a new table SELECT * INTO EmployeesBackup FROM Employees WHERE DeptId = 1 5. Copy columns from 2 or more table into a new table SELECT * INTO EmployeesBackup FROM Employees INNER JOIN Departments ON Employees.DeptId = Departments.DepartmentId 6. Create a new table whose columns and datatypes match with an existing table. SELECT * INTO EmployeesBackup FROM Employees WHERE 1 = 2 7. Copy all rows and columns from an existing table into a new table on a different SQL Server instance. For this, create a linked server and use the 4 part naming convention SELECT * INTO TargetTable FROM [SourceServer].[SourceDB].[dbo].[SourceTable] Please note : You cannot use SELECT INTO statement to select data into an existing table. For this you will have to use INSERT INTO statement. INSERT INTO ExistingTable (ColumnList) SELECT ColumnList FROM SourceTable Text version of the video http://csharp-video-tutorials.blogspot.com/2015/09/select-into-in-sql-server.html Slides http://csharp-video-tutorials.blogspot.com/2015/09/select-into-in-sql-server_14.html All SQL Server Text Articles http://csharp-video-tutorials.blogspot.com/p/free-sql-server-video-tutorials-for.html All SQL Server Slides http://csharp-video-tutorials.blogspot.com/p/sql-server.html Full SQL Server Course https://www.youtube.com/playlist?list=PL4cyC4G0M1RQ_Rm52cQ4CcOJ_T_HXeMB4 All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists

Course Hive

Continue this lesson in the app

Install CourseHive on Android or iOS to keep learning while you move.

Related Courses

FAQs

Course Hive
Download CourseHive
Keep learning anywhere