Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
mohan123
Constraint Violating Yak Guru
252 Posts |
Posted - 2012-12-13 : 06:16:54
|
Hello all i have 2 cases in which i am facing some issues.How to delete records when from one table A and Table B for scenario :Case 1 : table A have 100 records and Table B have 200 records now i need to insert data of table A into table B so in need to delete as well as insert how it can be possible???Case 2 : in another case i need to insert and update insert into Speciality(SpecialityName,Description,SpecialityCode,CreatedByUserId)select SpecialityName,Description,SpecialityCode,21from Speciality1 where exists (select 1 from Speciality)but this query is not working???P.V.P.MOhan |
|
bandi
Master Smack Fu Yak Hacker
2242 Posts |
Posted - 2012-12-13 : 06:34:11
|
I am not clear about your requirement...If you want to do either insert or delete/Update based on some condition, go ahead with MERGE--Chandu |
|
|
mohan123
Constraint Violating Yak Guru
252 Posts |
Posted - 2012-12-13 : 07:16:33
|
i have 100 records in table A and 200 rcords in table B.Here i need to upate 100 records in table B and delete rest of records in table BP.V.P.MOhan |
|
|
bandi
Master Smack Fu Yak Hacker
2242 Posts |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
|
|