insert multiple rows..
-
Hi all im using SqlServer2005.. I need to insert multiple rows into a existing table(db1) from other database(db2).. There are around 400 rows(15 columns) need to be inserted. Both db are having same tables. how can i do it.. Thanks...
modified on Wednesday, September 22, 2010 5:34 AM
-
Hi all im using SqlServer2005.. I need to insert multiple rows into a existing table(db1) from other database(db2).. There are around 400 rows(15 columns) need to be inserted. Both db are having same tables. how can i do it.. Thanks...
modified on Wednesday, September 22, 2010 5:34 AM
Which database?
test-09 wrote:
other database(db2)
Database/table?
-
Which database?
test-09 wrote:
other database(db2)
Database/table?
-
Hi all im using SqlServer2005.. I need to insert multiple rows into a existing table(db1) from other database(db2).. There are around 400 rows(15 columns) need to be inserted. Both db are having same tables. how can i do it.. Thanks...
modified on Wednesday, September 22, 2010 5:34 AM
insert into table1 (columname1,columnname2) select columnmae1,columname2 from databasename.dbo.table2
I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post. www.aktualiteti.com
-
insert into table1 (columname1,columnname2) select columnmae1,columname2 from databasename.dbo.table2
I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post. www.aktualiteti.com
-
That is basic query with which you can import records between tables but in select query it depends on your criterias.
I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post. www.aktualiteti.com
-
That is basic query with which you can import records between tables but in select query it depends on your criterias.
I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post. www.aktualiteti.com
-
I am having the same db with 2 back ups both have different information(table rows) i need to append both..
test09
Did you try that query? I think you are trying to merge two databases into one, right?
I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post. www.aktualiteti.com
-
Did you try that query? I think you are trying to merge two databases into one, right?
I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post. www.aktualiteti.com
-
Then use my query and all will be done.
I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post. www.aktualiteti.com
-
Then use my query and all will be done.
I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post. www.aktualiteti.com
-
using that query can insert single row how do i select all 400 rows.. or else i need to execute that query for each and every row..
test09
That query will insert all rows from table, not only one! Better check this http://en.wikipedia.org/wiki/Insert\_(SQL)
I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post. www.aktualiteti.com
-
That query will insert all rows from table, not only one! Better check this http://en.wikipedia.org/wiki/Insert\_(SQL)
I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post. www.aktualiteti.com
He's in trouble if he is trying to merge 2 tables, there will be duplicates unless he filters them out.
Never underestimate the power of human stupidity RAH
-
Take the boys query and add a where clause that filters out existing records so you do not get duplicates. You need to identify the primary key (unique data) in both fields that can be used to apply the filter.
Never underestimate the power of human stupidity RAH
-
He's in trouble if he is trying to merge 2 tables, there will be duplicates unless he filters them out.
Never underestimate the power of human stupidity RAH
I warned him/her too in previos post, thanks for claryfing me :)
I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post. www.aktualiteti.com
-
I warned him/her too in previos post, thanks for claryfing me :)
I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post. www.aktualiteti.com
Actually I think I could have left it a
he's in trouble
His level of understanding about database needs upgradingNever underestimate the power of human stupidity RAH