Continually Improving.... let us know how support@devdiamond.net Sign in | Sign up
home articles news blog forum  

 
 


 
Skip Navigation LinksHome > Article > SQL Basics :: Insert Statement
SQL Basics :: Insert Statement
Abstract :
Now that you know how to select records out of a database, you should also know how to insert records in to one.

Views : 4843
Published : Monday, January 21, 2002
By
HyperLink

Avarage Rating :
Page Page 1 of 1

Now that you know how to select records out of a database, you should also know how to insert records in to one. The insert statement is used like this:

INSERT INTO TableName (Column1, Column2, Column3)
VALUES ('Value1','Value2','Value3')


     Tablename is the name of the table you want to insert in to. Column1, 2, etc. are the names of the columns that you want to insert the corresponding values (value1, 2, 3, etc.) in to. Here is an example:

INSERT INTO CustomerTable (fname, lname, gender) VALUES ('John','Doe','m')

     The above code would insert one record with the VALUES information in to CustomerTable at the corresponding columns.


About Author

        Yasir Send Feedback
        Yasir is a .NET expert, with over 5 years experience in Microsoft Technologies, 8 years overall programming experience, he is the owner, founder & primary contributor of Minwar.com, and he also works as IT Director in the hospitality industry.