mrtweaver
Member
I was wondering, I dont know if this is off topic or not but thought I would ask because there has been lots of reference to SCADA systems. This question is more based on the SQL commands. 2005 SQL. I am currrently taking some night classes to bring myself upto speed but have not gotten to the advanced stuff yet and that is where I need assistance.
What I have are two tables. They have the same number of row but a different number of columns. What I want to do is copy 5 of the columns from table a to table b with the following exception. If a column in table b which is not copied from table a has a value of 1 dont copy any data to that row and set another column in that same row to a 1. If the value in this same referenced column has a 0 in it then copy the data from table a to table b. I want this set of commands to execute as fast as possible. The way in which i currently have it written it takes about 1 min which is way to long. I know there has to be a faster more efficient way and when I get to that part in my education I am sure I will find it but I have to get an answer quickly to finish up the reports section on my scada project at work. Any assistance greatly appreciated. like I said I know what I want to do and I can do it with basic commands but have not learned the advanced stuff yet.
Just so you know the copy will do 5 columns by 99 rows. Hope this helps. Have a Happy New Year.
What I have are two tables. They have the same number of row but a different number of columns. What I want to do is copy 5 of the columns from table a to table b with the following exception. If a column in table b which is not copied from table a has a value of 1 dont copy any data to that row and set another column in that same row to a 1. If the value in this same referenced column has a 0 in it then copy the data from table a to table b. I want this set of commands to execute as fast as possible. The way in which i currently have it written it takes about 1 min which is way to long. I know there has to be a faster more efficient way and when I get to that part in my education I am sure I will find it but I have to get an answer quickly to finish up the reports section on my scada project at work. Any assistance greatly appreciated. like I said I know what I want to do and I can do it with basic commands but have not learned the advanced stuff yet.
Just so you know the copy will do 5 columns by 99 rows. Hope this helps. Have a Happy New Year.