I have a View in my SQL Server Database
CREATE VIEW dbo.VIEW_TESTDATA_ALL
AS
SELECT TOP 100 PERCENT G_RECORDS, SEQUENCING, G, VALIDATION, KEY_FIELD, RECORD_ID, CLASS_CODE, TERR_PREFIX, TERR, CLASS_CODE_2,
COINS, CONST, PC_PREFIX, PC, DED, RATE_GROUP, CLASS_LIMIT, EXP_PREFIX, EXPOSURE, ZIP_CODE, NUM_OF_STO, YR, BCEG
FROM DVessey.TestData
ORDER BY KEY_FIELD, SEQUENCING
What i need is a stored procdure that I can execute as a DTS Package that will LOOP and create a separate Text File to the path
O:\Practice
on every change in the Key_Field. Every Key_Field has 370 lines, the Sequence Number goes from 1 to 370.
Example Key_Field 5245200 grab its 370 records saves it as a Text File 5245200_Key.txt to the path O:\Practice
goes to the next Key_Field which might be 5245201 grabs its 370 records and saves is as a text file 5245201_Key.txt to the path O:\practice and continues all the way to the last Key_Field.
What Stroed procedure Code do I need to do this? Thanks
CREATE VIEW dbo.VIEW_TESTDATA_ALL
AS
SELECT TOP 100 PERCENT G_RECORDS, SEQUENCING, G, VALIDATION, KEY_FIELD, RECORD_ID, CLASS_CODE, TERR_PREFIX, TERR, CLASS_CODE_2,
COINS, CONST, PC_PREFIX, PC, DED, RATE_GROUP, CLASS_LIMIT, EXP_PREFIX, EXPOSURE, ZIP_CODE, NUM_OF_STO, YR, BCEG
FROM DVessey.TestData
ORDER BY KEY_FIELD, SEQUENCING
What i need is a stored procdure that I can execute as a DTS Package that will LOOP and create a separate Text File to the path
O:\Practice
on every change in the Key_Field. Every Key_Field has 370 lines, the Sequence Number goes from 1 to 370.
Example Key_Field 5245200 grab its 370 records saves it as a Text File 5245200_Key.txt to the path O:\Practice
goes to the next Key_Field which might be 5245201 grabs its 370 records and saves is as a text file 5245201_Key.txt to the path O:\practice and continues all the way to the last Key_Field.
What Stroed procedure Code do I need to do this? Thanks