This video will teach you how to INSERT data into a table with working examples, within SQL Server, we also look at the different types of INSERT statements that can be run including INSERT SELECT.
Statements:
INSERT INTO dbo.Customers (C_First_Name, C_Middle_Name, C_Last_Name, C_1st_Line, C_2nd_Line, C_City, C_PostCode, C_Tel, C_Email, C_DOB)
VALUES ('Anne', 'Marie', 'Smith', '62 The Grove', 'Southbridge', 'London', 'SE1 2SH', '0207 556 1234', 'anne.smith@email.com', '19840123')
INSERT INTO ‘table_name’ (‘column names’)
VALUES (‘values’)
INSERT INTO dbo.Customers (C_First_Name, C_Last_Name, C_Tel, C_Email, C_DOB)
VALUES ('Charlie', 'Hawkins', '07789456789', 'charlieh@email.com', '19610527')
INSERT INTO dbo.Books (P_Title, P_Author, P_Year, P_BarCode, P_Stock, P_Type)
VALUES ('The Sense of an Ending', 'Julian Barnes', 2012, (SELECT MAX(P_BarCode) FROM dbo.Books) + 1, 10, 'Paperback')
, ('The Boy in the Striped Pyjamas', 'John Boyne', 2008, (SELECT MAX(P_BarCode) FROM dbo.Books) + 2, 10, 'Paperback')
, ('Lolita', 'Vladimir Nabokov', 2000, (SELECT MAX(P_BarCode) FROM dbo.Books) + 3, 10, 'Hardback')
INSERT INTO dbo.Customers (C_First_Name, C_Last_Name, C_1st_Line, C_City, C_Email, C_DOB)
SELECT FirstName, Surname, [1st Line of Address], City, Email, DOB FROM dbo.Customers_Excel
INSERT statements (DML) are covered in the Microsoft Exam – Querying SQL Server (70-461) 2012 / 2014.
To learn how to backup and restore databases check out the video below:
SQL Tutorial – Backup and Restore
• SQL Tutorial - Backup and Restore
To learn how to UPDATE data in a database check out the video below:
• SQL Tutorial - UPDATE
To learn how to use the Import and Export Wizard in SQL check out the video below:
• SSIS Tutorial - Import and Export Wizard
On this page of the site you can watch the video online SQL Tutorial - INSERT with a duration of online in good quality, which was uploaded by the user BeardedDev 19 April 2017, share the link with friends and acquaintances, this video has already been watched 491 times on youtube and it was liked by 11 viewers. Enjoy your viewing!