Click here to Skip to main content
15,892,199 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi , im developing asp.net web apps,with sql database
i make 2 tables named reg,userverify
in reg table have some columns like username,password etc,..
and userverify table have secretcode,securityques,securityans (3cloumns).
i want to merge the two tables in single table like userAcc.it should have username,password,securityques,secretcode,securityans.... im newbie for sql database and c# help me adv thanks.
Posted
Comments
Monster Maker 25-Mar-13 12:52pm    
Do you know the concept of join in database?
gvprabu 25-Mar-13 13:13pm    
Merge means... U need to list all the columns from 2 tables using JOIN... or merge Data.. Using MERGE Statement?
sreeprakash248 25-Mar-13 13:19pm    
1st thanks for everyone... i want to im newbie(beginner) for sql database and asp.net .so i try join statements and merge thanks
ZurdoDev 25-Mar-13 14:36pm    
Just use Sql Management Studio and create a new table with the columns you need.
sreeprakash248 25-Mar-13 14:50pm    
plz give a syntax for joining the two table columns in single table... using join statement?

 
Share this answer
 
Did you create table having all columns you want??.. After creating table, use the following query to insert data from reg, userverify tables to userAcc table:
SQL
insert into [userAcc](username,password,etc)
select username,password,etc from reg

insert into [userAcc](secretcode,securityques,securityans)
select secretcode,securityques,securityans from userverify


You need a common cloumn in both the tables(reg & userverify) to join them. Otherwise join will be all possible combinations. In this case you can use above query or u need to create a column common to both tables.

Read more about JOIN here:
SQL Joins[^]
http://msdn.microsoft.com/en-IN/library/ms191517(v=sql.105).aspx[^]

Mark it if you find this helpful.
 
Share this answer
 

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