Tuesday, February 23, 2010

Simple insert Query

Simple insert query 

Here you can learn how to create simple insert query. Its all about how to create a simple insert query for sql server 2005.
Insert query is also help full when we are firing query to database from .net page.


Insert intoTable Name select column name1 column name N from Table name
Example

Insert into sqldemo (id,password,status) values('sds','sad','sdsa');
Insert into sqldemo select id,password,status from sqldemo1;
Here
- sqldemo is destination table
- sqldemo1 is source table




Another insert query with 'where' condition.
Insert into Table Name select column name1 column name-n from table name where condition

Example
Insert into sqldemo select id,password,status from sqldemo1 where id like 'a%';

see more on sql


This query is used in inserting data into table

Page Rank Checker

See Status of the blog



No comments: