Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

insert tables

Status
Not open for further replies.

calvi

Technical User
May 26, 2003
87
NL
Is it possible to insert sql with several tables?
insert into 'tablename1', 'tablename2' (coluMn1, column2) values (column1value, column2value)
if not do ihave to have several sqlstring, command?
 
No that query is not possible. You can insert result set from more than one table, but you can't insert records in more than one table.


Borislav Borissov
VFP9 SP2, SQL Server 2000/2005.
Microsoft MVP VFP
 
actually there is a way but you would have to create a partitioned view, you need check constraints on the table and you also need to make sure that the tables have identical DDL
then you would insert into the view and the view would insert into the correct table (so to speak)

Denis The SQL Menace
--------------------
SQL Server Code,Tips and Tricks, Performance Tuning
SQLBlog.com, Google Interview Questions
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top