SQL Insert Query Over Multiple Tables?

Soldato
Joined
2 May 2004
Posts
19,950
Hello,

I have no problems querying multiple tables in one query, that's all easy with the dots and stuff.

I'm now needing to submit database to multiple tables from one query, I have tried it the same method as you use to query multiple databases but that doesn't want to work.

I did quite a bit of searching on Goooooooooooogle for it but I couldn't find anything :(

So any ideas how I can submit data to multiple tables from one query please?

Thanks
Craig.
 
Hmmm, so there's no way to submit accross multi tables with one query :(?

Also, how can I make a field increment + 1 but post it onto a new row, I can't use auto increment. Is there a way to increment it in the query but post the incremented number onto the next row? Or will I need to first select the field from the database so it knows what number to go to?

Craig.
 
do you want to insert the same data into multiple tables? seems a tad strange if you do and you are probably best re designing your DB if thats the case. You could do this with triggers in MSSQL, alternatively if you just want a backp of each table abd they don' need to be right up to date then you could do a scheduled job that did a select into every night (or just a backup)
 
oneilldo said:
do you want to insert the same data into multiple tables? seems a tad strange if you do and you are probably best re designing your DB if thats the case. You could do this with triggers in MSSQL, alternatively if you just want a backp of each table abd they don' need to be right up to date then you could do a scheduled job that did a select into every night (or just a backup)

I was just needing to insert one part of the user entry into one table and the other part into another table. But it's all sorted now thanks :)

Craig.
 
Back
Top Bottom