SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

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

MarjanMM
Starting Member

4 Posts

Posted - 09/30/2012 :  01:10:22  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

United Kingdom
1912 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:
http://msdn.microsoft.com/en-us/library/ms188263(v=sql.105).aspx

Jack Vamvas
--------------------
http://www.sqlserver-dba.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New 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.05 seconds. Powered By: Snitz Forums 2000