Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
Hi,

I am new to dotnet and stuck in a task which deals with two sql tables. Let me explain clearly

I have two tables Events,user-events.I have four asp buttons.Each button is asssigned to each id in Events table .On button click i need to insert that id in user-events table.

I tried using select statement for retrieving the id from first table and later using insert for inserting into second table ...But it did not work.. can anyone help me sorting out this issue
Posted

1 solution

try this

SQL
insert into Database1.dbo.Table1
select (AllCOl except identity Col)  from Database2.dbo.Table2
 
Share this answer
 
Comments
Raghavanand 3-Nov-12 17:49pm    
Thanks a lot sir .. I really mean it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900