santoshupadhayay87 (10/16/2012)
i want to add three table to the datbase out of which two are from one table and one is of another table can anyone please help me with the same.
Do you really think it's possible to answer? That sound like:
Go to somewhere, I don't know where. And bring me something, I don't know what!
However here is the trick:
SELECT TOP (50) PERCENT * INTO NewTable1
FROM MyOldTable1
SELECT * INTO NewTable2
FROM MyOldTable1 ot1
WHERE NOT EXISTS (SELECT 1
FROM NewTable1 nt1
WHERE nt1.[UniqueIdColumn(s)] = ot1.[UniqueIdColumn(s)])
SELECT * INTO NewTable3
FROM MyOldTable2
The above will split data from MyOldTable1 roughly in two half's and create two new tables from you old one 🙂
And then create third new table from your second old one.