Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 For LOOP question
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

4 Posts

Posted - 09/30/2012 :  01:10:22  Show Profile  Reply with Quote

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

Flowing Fount of Yak Knowledge

United Kingdom
2179 Posts

Posted - 09/30/2012 :  01:52:17  Show Profile  Visit jackv's Homepage  Reply with Quote
In what format is the data set? Why do you have to LOOP? Can you not use the format:

Jack Vamvas
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000