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 |
YogeshDesai
Posting Yak Master
136 Posts |
Posted - 2007-05-23 : 05:54:15
|
Hi guys I am writing a simple query to insert record from one table to another table.For this I am using following queryINSERT OutExcelTempDetails ( ExcelTempDetailID, ExcelTempID, RowNumber, ColumnNumber, ColumnName, Description ) SELECT ExcelTempDetailID, ExcelTempID, RowNumber, ColumnNumber, ColumnName, Description FROM ExcelTempDetailsnow my problem is once it's fired It wil insert all the records from ExcelTempDetails,I want to excute it agin and do want to add previous record,I mean how can I check for the prevoius values,If it already exist Ity should have to ignore them and want to insert only new values updated in ExcelTempDetailsPlease help me to solve this issue,I just wanna avoid repetationsYogesh V. Desai. | SQLDBA| |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-05-23 : 06:30:27
|
INSERT OutExcelTempDetails(ExcelTempDetailID,ExcelTempID,RowNumber,ColumnNumber,ColumnName,Description )SELECTExcelTempDetailID,ExcelTempID,RowNumber,ColumnNumber,ColumnName,Description FROM ExcelTempDetails TWhere not exists(Select * from OutExcelTempDetails where ExcelTempDetailID=T.ExcelTempDetailID)MadhivananFailing to plan is Planning to fail |
 |
|
YogeshDesai
Posting Yak Master
136 Posts |
Posted - 2007-05-23 : 06:47:49
|
Hi madhivananThank you very much for your quick help,It's working fine.Thanks dear friend for your helpand your time.Yogesh V. Desai. | SQLDBA| |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-05-23 : 07:35:18
|
quote: Originally posted by YogeshDesai Hi madhivananThank you very much for your quick help,It's working fine.Thanks dear friend for your helpand your time.Yogesh V. Desai. | SQLDBA|
You are welcome MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|
|