Wednesday, June 07, 2006

Is a Temporary Table Really Necessary?

Is a Temporary Table Really Necessary?

Shows how to do looping in SQL.

WHILE @lngLoopCount <> 0BEGIN
SET @strTabName = (SELECT strTableName FROM #tTables WHERE numID = @lngLoopCount)
EXEC sp_spaceused @strTabName
SET @lngLoopCount = @lngLoopCount - 1END

No comments:

Post a Comment