• OK for the folks who have bothered to follow this thread, a minor update, with a bunch of changes that i added myself,as well as some that were also contributed through the fine people here, who helped make this even better.

    --V314 03/30/2015

    -- did i mention this scripts out temp tables too? sp_GetDDL #tmp

    -- scripts a LOT more objects... a better replacement for sp_helptext i think.

    • table,
    • #temptable
    • procedure,
    • function,
    • view
    • trigger
    • synonym (new!)

    -- added ability to script synonyms

    -- moved logic for REAL datatype to fix error when scripting real columns

    -- added OmaCoders suggestion to script column extended properties as well.

    -- added matt_slack suggestion to script schemaname as part of index portion of script.

    -- minor script cleanup to use QUOTENAME insead of concatenating square brackets.

    -- changed compatibility to 2008 and above only, now filtered idnexes with WHERE statmeents script correctly

    -- foreign key tables and columns in script now quotenamed to accoutn for spaces in names; previously an error for Applciation ID instead of [Application ID]

    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!