none
How do I create a folder for SSIS package in MSDB with T-SQL?

    Discussione generale

  • [This is just for sharing information for those common asked questions collected from forums. If you have any better way or feedback, please directly reply in this thread so that community users can benefit from your answers.]


    Question:

    When I logon to Integration Services from SQL Server Management Studio, I can create a package folder to store the package under the MSDB folder. But can I programmatically create a folder with T-SQL?

     

    Answer:

    Yes, you can directly insert a record into the user table dbo.sysssispackagefolders in your msdb database with the T-SQL statement as follows:

    INSERT INTO dbo. sysssispackagefolders (
    folderid
    ,parentfolderid
    ,foldername)
    VALUES (NEWID(), '<Parent folder GUID>', '<Folder name>')
    
    

     

    For example, if you want to create a folder named “Packages” under the MSDB folder, you can run the following T-SQL:

    INSERT INTO dbo. sysssispackagefolders (
    folderid
    ,parentfolderid
    ,foldername)
    VALUES (NEWID(), '00000000-0000-0000-0000-000000000000','Packages')
    

    Please remember to mark the replies as answers if they help and unmark them if they provide no help
    sabato 19 giugno 2010 03:51
    Moderatore

Tutte le risposte

  • Charles - you should be blogging these tips.  Search engines and other blogs will find them more readily...
    Todd McDermid's Blog Talk to me now on
    sabato 19 giugno 2010 15:48
    Moderatore
  • Its better you create some blog, and use it in your footer while answering the questions...
    sabato 19 giugno 2010 19:42
  • Hi Todd and bal123,

    Thanks very much for your feedbacks. Some colleagues and I collected about 20 SSIS and 20 SSAS forum FAQs and need to post them in the SSIS and SSAS forums in the following days.

    I had thought that blog is a good way, however based on our investigation and statistics from other forums like .NET development, windows server etc, posting the FAQs in forums has better better search possibility than a blog. For example, if you search a technical question vial Bing or Google, forum posts are often ranked very top. So we follow the best practice from other forums and post these FAQs in forums.

    To align the FAQs publication manner with other forums, I am afraid that currently these 40 coming FAQs will be published in SSIS and SSAS forums. However we really appreciate your feedbacks. We will further discuss on the FAQ publication and figure out a better way for doing this next time, maybe creating a blog or KB or something else.

    Really appreciate your understanding on this. Thank you guys.

     


    Please remember to mark the replies as answers if they help and unmark them if they provide no help
    domenica 20 giugno 2010 05:48
    Moderatore
  • My two cents:

    It may or may not be the case that forum posts get ranked higher - in my experience, blog posts get ranked equally.  However, I tend to click on blog posts in preference to those - because forum posts tend to be rambling and not always applicable.  From a blog post title, I can easily see if the post will apply, and blog posts tend to be very straightforward, to the point, and complete.

    Pages get ranked on relevance and links to them (I think) - which may mean that forum posts get linked to comparably to blog posts... which may the case.

    If/when yo do compile those posts into a FAQ, I hope you don't copy the entirety of the posts into the FAQ.  You should just place a link to the relevant post in there.

    However, I think you can get the best of both: Publish your articles on a blog - perhaps the SSIS Team blog, under a "How To" tag, and link to those posts in the FAQ.  You'll benefit from the rankings that the SSIS Team blog already has - plus the fact that it's already on a ton of peoples' reader lists.


    Todd McDermid's Blog Talk to me now on
    domenica 20 giugno 2010 17:16
    Moderatore
  • Thanks Todd. We will change the way of FAQ publication next time. For this time, let us just bear them in forums.

    Thank you!


    Please remember to mark the replies as answers if they help and unmark them if they provide no help
    domenica 20 giugno 2010 17:41
    Moderatore
  • Wouldn't it be cleaner/safer to use the appropriate system stored proc for that?

    The example would come down to:

     

    exec msdb.dbo.sp_ssis_addfolder
        @parentfolderid = '00000000-0000-0000-0000-000000000000'
        ,@name = 'Packages';
    

    Additional info: the third parameter, @folderid, is optional and NEWID() will be used when not provided.

     


    MCITP SQL Server 2008 (DEV); MCTS SQL Server 2008 (BI, DEV & DBA)
    mercoledì 25 gennaio 2012 12:34