Posted by jim_geissman on 10/01/59 11:33
This seems to work for the header, assuming you can figure out which is
the first line (minimum StockID) --
CREATE TABLE #Test(N int IDENTITY, String varchar(30))
INSERT #Test SELECT 'Line one'
INSERT #Test SELECT 'Line two'
DECLARE C CURSOR FOR SELECT
Head=CASE WHEN N=1
THEN 'Header'+CHAR(10)+String
ELSE String END FROM #Test
DECLARE @String varchar(30)
OPEN C
WHILE 1=1 BEGIN
FETCH NEXT FROM C INTO @String
IF @@FETCH_STATUS <> 0 BREAK
PRINT @String
END
CLOSE C
DEALLOCATE C
Navigation:
[Reply to this message]
|