MVC

  • Home
  • HTML
    • Overview
    • Formatting
  • Java Script
    • Overview
    • Validation
  • CSS
    • Overview
  • Sql
    • Overview
    • SQL Select
    • SQL Command
    • Advance Query
    • SQL Create
    • Function
    • Function vs StoreProcedure
    • Stored Procedures
  • MVC
    • OverView
    • Evolution of MVC
    • Install VisualStudio-2015
    • Create First Application
  • LINQ
    • Introduction
  • Privacy Policy

Sunday, 24 September 2017

INSERT INTO statement in SQL

  Unknown       08:57       AdvanceQuery       No comments    

INSERT INTO SELECT Statement


In this article describe about Insert data one table to existing table The INSERT INTO SELECT statement selects data from one table and inserts it into an existing table.
Example
In this article Firstly create 2 tables like - tbl_1,tbl_2 and insert some values in tbl_1 Using 'INSERT INTO' Statement data Insert into tbl_2 table , you will find all records in tbl_2 table
Create Table

Create table tbl_1
(
Id int,
name nvarchar(10)
)


Note -
Table tbl_1 created with two field and same for tbl_2 with same field and datatype, name may be different but datatype same

Above Example Created Table tbl_1 after that Use Insert into Statement


Syntex
Note -
INSERT INTO [TableName]
SELECT * FROM [TableName]

You also see example then you can better understand

Example
INSERT INTO tbl_2
SELECT * FROM tbl_1


Note -
In this example Tbl_2 inserted all record which are in tbl_1, You can see above using select statement
SELECT * FROM tbl_2

SELECT INTO STATEMENT


you can want to make replica of table then use select into
select * into tbl_2 from tbl_1 In this no need create table ,following example we can't create table tbl_2 only create tbl_1 and just make replica so table and data same copy in replica of table this is explain in my previous article
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
Email This BlogThis! Share to X Share to Facebook
Newer Post Older Post Home

0 comments :

Post a Comment

learningmvctutorial

Popular Posts

  • Overview
      SQL (Structured Query Language)   SQL  is a language that interacts with the database on the server-side. This dynamite duo has changed ...
  • Overview of HTML
    What is HTML? First developed by Tim Berners-Lee in 1990 . HTML is used to create electronic documents (called pages) that are displ...
  • Difference Between function v/s store procedure
    Definition  of Store Procedure In a database management system (DBMS), a  stored procedure  is a set of Structured Query Language (SQL...
  • SQL Select
    The SQL SELECT Statement The SELECT statement is used to select data from a database. SQL SELECT Syntax SELECT column_name , column_n...
  • What is LINQ
    LINQ  (Language Integrated Query) is a Microsoft programming model and methodology that essentially adds formal query capabilities into Mic...
  • What is Function in Sql Server
    A function is a block of code that has a name and it has a property that it is reusable. We use function in store Procedure and queries in...
  • Create Duplicate Table of existing table in SQL Server
    In This Tutorial we create table and want to same structure and same data then We create new table with data type after that  insert in ta...
  • About Javascript
    What is JavaScript? JavaScript was designed to add interactivity to HTML pages JavaScript is a scripting language A scripting langua...
  • Operator in JavaScript
    What is an operator? JavaScript has both binary and unary operators, and one special ternary operator, the conditional operator. A binar...
  • Open Application in MVC
    We want to create application in MVC first of how we create first application Show Steps   as below-     STEP 1 .  Start Computer and  I...

Blog Archive

  • ▼  2017 ( 35 )
    • ►  November ( 1 )
    • ►  October ( 2 )
    • ▼  September ( 4 )
      • INSERT INTO statement in SQL
      • Sql Like Operator
      • Html Formatting
      • SQL Group By Clause
    • ►  August ( 1 )
    • ►  July ( 1 )
    • ►  May ( 3 )
    • ►  April ( 7 )
    • ►  March ( 13 )
    • ►  February ( 3 )
Powered by Blogger.

Categories

  • AdvanceQuery
  • CreateApplication
  • CreateDb
  • CssOverview
  • Evolution
  • Formatting
  • Function
  • FunctionVSSp
  • HtmlOverview
  • InstallVisualStudio
  • Introduction
  • javascriptOverview
  • JsValidation
  • Mvc-vs-Asp.Net
  • OverView
  • Select
  • SqlCommand
  • SQLOverview
  • StoredProcedures

Text Widget

Sample Text

Pages

  • Home

Copyright © MVC | Powered by Blogger
Design by Vibha Acharya