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.
| Author |
Topic |
|
Lopaka
Starting Member
48 Posts |
Posted - 2010-02-10 : 13:55:27
|
| I have a print statement in a loop that lets me know where it is at... Unfortunately, the print only works at the end of the loop. Is there a way to force the print to work as it passes in the loop?Thanks youRobert R. Barnes |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-02-10 : 13:59:27
|
| it should work as long as print is within the loop.------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
Lopaka
Starting Member
48 Posts |
Posted - 2010-02-10 : 14:04:37
|
| The print is in the loop. there are three loops, at exit the loop prints out a all of the info and not durring the loops... any ideas?Robert R. Barnes |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-02-10 : 14:20:54
|
| can you show your query?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
Lopaka
Starting Member
48 Posts |
Posted - 2010-02-10 : 15:12:12
|
| WHILE @PK < @MAX_PKBEGIN SET @PK = @PK + 1 SELECT @Table = tName, @TableDate = tDate FROM #TableList WHERE PK = @PK -- Populate the officers table based on the financial data... SET @SQL_Insert = 'INSERT INTO GS_Data.dbo.EO_Officers_NEW(' + 'fin_id, eName, eTitle, eHours, eCompensation, eBenefits, eOther) ' + 'SELECT b.Fin_ID, LEFT(UPPER(b.ename), 75), LEFT(UPPER(title), 150), LEFT([hours], 150), compensation, benefits, other ' + 'FROM gs_data.dbo.EO_Financials_NEW a LEFT JOIN ' + 'gs_data.dbo.' + @Table + ' b ON a.fin_id = b.fin_id ' + 'WHERE a.TableDate = ''' + @TABLEDATE + ''' ' + 'AND b.fin_id IS NOT NULL' PRINT 'Inserting ' + @Table EXECUTE(@SQL_Insert) PRINT 'OFFICER - NEXT TABLE'ENDRobert R. Barnes |
 |
|
|
|
|
|
|
|