Learn more about SQL Server tools

   
   























Latest from MSSQLTips















SQL Server INSERT Command




Overview

I need to be able to add data to my tables.  I have found the INSERT command, but I want to find out if you can provide me with some examples.  I am hoping to see some code examples to see if I can pick-up any tips or tricks.  Check out this tutorial to learn about the SQL Server INSERT command. 

Explanation

You are correct, the INSERT command is used in SQL Server to add records to a table. It is a fairly straightforward command that can be used in ad-hoc code and stored procedures. Let's cover the following topics in this tip:
  • Sample table
  • Simple INSERT statement
  • Verify the INSERT commands
  • INSERT command with variables
  • INSERT stored procedure
  • Automatically generating an INSERT statement in SQL Server Management Studio
  • INSERT INTO a SQL Server table with IDENTITY column
  • INSERT INTO a SQL Server table with a SELECT statement
  • INSERT INTO a new table with the SELECT INTO command in SQL Server






 
Sponsor Information







 

Follow

Get Free SQL Tips

Twitter

LinkedIn

Google+

Facebook

Pinterest

RSS

Learning

DBAs

Developers

BI Professionals

Careers

Q and A

Today's Tip

Resources

Tutorials

Webcasts

Whitepapers

Tools

Search

Tip Categories

Search By TipID

Authors

Community

First Timer?

Pictures

Free T-shirt

Contribute

Events

User Groups

Author of the Year

More Info

Join

About

Copyright

Privacy

Disclaimer

Feedback

Advertise

Copyright (c) 2006-2015 Edgewood Solutions, LLC All rights reserved
Some names and products listed are the registered trademarks of their respective owners.