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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 For LOOP question

Author  Topic 

MarjanMM
Starting Member

4 Posts

Posted - 2012-09-30 : 01:10:22
Hello,

I have a table with 2 columns. In the first column has to be CMD1 to CMD120. These are the names of the commands. In the second column has to a query:

'SELECT Value FROM OPENQUERY (iHistorian,''SELECT * FROM ihRawData WHERE TagName LIKE *DEM_S01_N and SamplingMode=CurrentValue'');'

I have to fill (Insert) the table with CMD1-CMD120 and DEM_S01_N to DEM_S120_N.
How to do this with the for loop?

Best regards

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2012-09-30 : 01:52:17
In what format is the data set? Why do you have to LOOP? Can you not use the format:
http://msdn.microsoft.com/en-us/library/ms188263(v=sql.105).aspx

Jack Vamvas
--------------------
http://www.sqlserver-dba.com
Go to Top of Page
   

- Advertisement -