Exforsys.com
 
Home Tutorials SQL Server 2005
 

SQL Server 2005 - Populating the Database

 

SQL Server 2005 - Populating the Database

In this tutorial you will learn how to populate the database in SQL Server 2005.



One method of populating the tables in a database is to right click on a table and select ‘Open Table’ and entering the data in the visual mode that is displayed.



Another method is to use the INSERT statement to add rows to a table. The syntax would be as under:


INSERT [INTO] table_or_view [(column_list)] data_values



 



The SELECT subquery in the INSERT statement can also be used to add values to a table or views. The use of the SELECT subquery also allows more than one row to be inserted at the same time. It must be ensured that the select list of the subquery matches the column list of the INSERT statement. If no column list is specified, the select list must match the columns in the table of view being inserted into.



Bulk copy operations can also be used to populate a database. A bulk copy program can be used. This is a command prompt utility that provides for running bulk copies in .bat and .cmd scripts. The BULK INSERT statement of T_SQL batches can be used. This statement has to be executed in the context of the server. Finally the bulk copy APIs for OLE DB, ODBC and DB-Library applications can be used. This is again a command prompt utility that uses the SQL Server ODBC driver bulk copy functions.



Read Next: SQL Server 2005 - Database Backup



 

 

Comments


akhilkes said:

  when i found this site and register free and find many tutorials , i really feel too much good registering free, ***********REALLY THIS WEBSITE IS BEST AMONG ALL I HAVE EVER SEEN**************************
September 23, 2006, 11:58 am

Post Your Comment:

Members Please Login
Your Name:*
e-mail ID:(required for notification)*
Image Verification: 
 
 Subscribe    

Sponsored Links

 

Subscribe via RSS


Get Daily Updates via Subscribe to Exforsys Free Training via email


Get Latest Free Training Updates delivered directly to your Inbox...

Enter your email address:


 

Subscribe to Exforsys Free Training via RSS
 

 
Partners -  Privacy and Legal Policy -  Site News -  Contact   Sitemap  

Copyright © 2000 - 2010 exforsys.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape