Jump to content

Sql Help


GajaKesari

Recommended Posts

To ManchiBoy and others..

 

Using a trigger for selecting the amount of inserts done is a slow and heck of a process. It wastes lots of IO usage and during etl things will work very very slow.. 

 

Also for this trigger you are suggesting he should be using a loop to call all the inserts which will take a while to load all the records and will definitely exceed more than 30 minutes of time frame if he is looking at 100+Million records... If the tables reside in the same databases, speed will be a little okay but if they are spanned across different databases it will be a challenge as well.

To ManchiBoy,

 

There is an option called MERGE in sql server, which can get you to what you want. What MERGE statement does is, it will select only the changes or new inserts or deletes which ever you want between two different tables you have. This will be your fastest and safest bet to work with. Put all the code inside a sql proc and call it as a job every 30 minutes or as per your requirement. I wrote an article regarding how to use MERGE step by step. 

 

http://sqlsaga.com/sql-server/how-to-capture-changes-between-source-and-destination-using-merge-statement/

 

good luck reading. Don't forget to like SQLSAGA's facebook fan page :P

Link to comment
Share on other sites

ee beerbob neeku thanks chepthunnadu  bye1

To ManchiBoy and others..

 

Using a trigger for selecting the amount of inserts done is a slow and heck of a process. It wastes lots of IO usage and during etl things will work very very slow.. 

 

Also for this trigger you are suggesting he should be using a loop to call all the inserts which will take a while to load all the records and will definitely exceed more than 30 minutes of time frame if he is looking at 100+Million records... If the tables reside in the same databases, speed will be a little okay but if they are spanned across different databases it will be a challenge as well.

To ManchiBoy,

 

There is an option called MERGE in sql server, which can get you to what you want. What MERGE statement does is, it will select only the changes or new inserts or deletes which ever you want between two different tables you have. This will be your fastest and safest bet to work with. Put all the code inside a sql proc and call it as a job every 30 minutes or as per your requirement. I wrote an article regarding how to use MERGE step by step. 

 

http://sqlsaga.com/sql-server/how-to-capture-changes-between-source-and-destination-using-merge-statement/

 

good luck reading. Don't forget to like SQLSAGA's facebook fan page :P

 

Link to comment
Share on other sites

To ManchiBoy and others..

 

Using a trigger for selecting the amount of inserts done is a slow and heck of a process. It wastes lots of IO usage and during etl things will work very very slow.. 

 

Also for this trigger you are suggesting he should be using a loop to call all the inserts which will take a while to load all the records and will definitely exceed more than 30 minutes of time frame if he is looking at 100+Million records... If the tables reside in the same databases, speed will be a little okay but if they are spanned across different databases it will be a challenge as well.

To ManchiBoy,

 

There is an option called MERGE in sql server, which can get you to what you want. What MERGE statement does is, it will select only the changes or new inserts or deletes which ever you want between two different tables you have. This will be your fastest and safest bet to work with. Put all the code inside a sql proc and call it as a job every 30 minutes or as per your requirement. I wrote an article regarding how to use MERGE step by step. 

 

http://sqlsaga.com/sql-server/how-to-capture-changes-between-source-and-destination-using-merge-statement/

 

good luck reading. Don't forget to like SQLSAGA's facebook fan page :P

bro nee site lo cheppina adventure works dw 2012 database mdf file ekkada nunchi download chesavu? i tried d/l but every file is corrupt or not able to attach to db

Link to comment
Share on other sites

okasari m,ove chesinavi malli move cheyyakudadhu ante row identifier orevery row ki oka flag undali and u shud mark that flag as true if the record is read

 

idea good but extra memory man for that bit flag.. MERGE will do same sheeeeeet behind the scenes...... :)

Link to comment
Share on other sites

×
×
  • Create New...