Solved

MS SQL breaking script results into different files?

Posted on 2014-02-03
3
173 Views
Last Modified: 2014-02-04
There is a table that I have to work with that has data which is sorted by Bill To Manufacture Name (BillToMfgName) and a Manufacture Name (MfgName).  Any time the BillToMfgName and/or MfgName changes I need to put the data in a new results section.  Is there any way to do this?  Or to write each of the results set to a new csv file?

Thanks, John
0
Comment
Question by:j_heck
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 40

Expert Comment

by:lcohan
ID: 39830329
You can do both those things via SQL Server table TRIGGERS where you check if the INSERTED value for the specific column is different that the DELETED the either populate the results column(or another table/column) with data or pipe the result out to a csv file - I would not recommend the second option with the CSV file.

http://msdn.microsoft.com/en-us/library/ms189799(v=sql.105).aspx
0
 
LVL 66

Accepted Solution

by:
Jim Horn earned 500 total points
ID: 39830505
>Any time the BillToMfgName and/or MfgName changes I need to put the data in a new results section.
If by 'results section' you mean how the data is viewed, then this should really be handled by whatever reporting app you're using, and not by T-SQL or in the data.
0
 

Author Closing Comment

by:j_heck
ID: 39832607
Thanks Jim, that is what I thought.
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

689 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question