SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 temporary table
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

slimt_slimt
Aged Yak Warrior

Switzerland
746 Posts

Posted - 07/29/2007 :  18:41:55  Show Profile  Reply with Quote
Hi,

i have:

[first table]
user_id
user_name
user_password

[second table]
set
item
order

Since the second table is somehow only temporary table (having at the front ajax script), i need the third table to store user's ID and all the info from second table.

What would be the easiest way to do it, since the first table contains only one row per user and the second one 40 rows per user.

thank you for your thought!

nr
SQLTeam MVY

United Kingdom
12543 Posts

Posted - 07/29/2007 :  22:06:39  Show Profile  Visit nr's Homepage  Reply with Quote
No idea what you mean but
insert table3
select t1.Userid, t2.set, t2.item, t2.Order
from table1 t1
cross join table2 t2
where t1.Userid = @myuserid


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

slimt_slimt
Aged Yak Warrior

Switzerland
746 Posts

Posted - 07/30/2007 :  12:32:22  Show Profile  Reply with Quote
hi,

sorry for being so vague.

The main problem i have is that all data are written in db dynamicly and what i need is to have a third table to preserve/save all corresponding data from table 1 and table 2.

is there any easy/fast way to do it?
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.09 seconds. Powered By: Snitz Forums 2000