stored proc help needed

  • i want to pass to_date and from_date to a SP and wanted to get the latest modified SP's,Views and Functions and after wanted to get the script of that view or sp or function and Pump the code to a File In a Particular Path like 'd:\Scripts' or so and need to the order as in a particular order like 1 function,

    2 views,

    3 sp's

    ignore tables and other

  • what have you tried so far?

    you can find all the modified dates and creation dates in sys.objects;

    filter the type column for types like 'P' and 'FN', etc

    sp_helptext gives you the text of anything except a table; to loop thru that collection, i would probably use a cursor myself.

    are you sure you want to write to a file from TSQL? programming languages have a much easier interface to write to a file....

    have you looked in the scripts section or googled on hoe to write to a file from TSQL?

    sreeman.chakka (2/28/2009)


    i want to pass to_date and from_date to a SP and wanted to get the latest modified SP's,Views and Functions and after wanted to get the script of that view or sp or function and Pump the code to a File In a Particular Path like 'd:\Scripts' or so and need to the order as in a particular order like 1 function,

    2 views,

    3 sp's

    ignore tables and other

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Please post in an appropriate forum next time. The article discussion forums are for discussion of published articles

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply