Dynamically script Create Database For Attach For All Databases

  • Comments posted to this topic are about the item Dynamically script Create Database For Attach For All Databases

    David

    @SQLTentmaker

    “He is no fool who gives what he cannot keep to gain that which he cannot lose” - Jim Elliot

  • Will this script work for databases using the FILESTREAM feature in SQL Server 2008?

  • I did not include that in this design but could look into that as well.

    David

    @SQLTentmaker

    “He is no fool who gives what he cannot keep to gain that which he cannot lose” - Jim Elliot

  • Thx!

  • Sweet code.

    On the

    SELECT @a = (SELECT SUBSTRING(@a,1,LEN(@a)- 1))

    --Trim off the final comma; I'm sure there is a better way to do this...

    Why not just do a

    SELECT @a = LEFT(@a,LEN(@a)- 1)



    ----------------
    Jim P.

    A little bit of this and a little byte of that can cause bloatware.

  • A lot of the code is sourced from another script posted by another user on the site. I reference the original script when I posted my version so that proper credit could be given. That particular section of code came with the original script. I will look at adding that in my version though. Thanks for the suggestion!

    David

    @SQLTentmaker

    “He is no fool who gives what he cannot keep to gain that which he cannot lose” - Jim Elliot

  • Thanks for the script.

Viewing 7 posts - 1 through 6 (of 6 total)

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