Dynamic sql procedure for bulk insert

  • kast218

    SSCertifiable

    Points: 6286

    Comments posted to this topic are about the item Dynamic sql procedure for bulk insert

  • brad.pears

    Old Hand

    Points: 374

    More description on what is actually going on in the script along the way for SQL newbies would have been nice but otherwise very nice...

  • kast218

    SSCertifiable

    Points: 6286

    brad.pears (6/3/2015)


    More description on what is actually going on in the script along the way for SQL newbies would have been nice but otherwise very nice...

    Hello, brad.pears. Thanks for your recommendation, I will try add more description in next week. Also you can use @debug=1 for printing tsql statement before executing it. Main parameter in this stored procedure is @useIdentity for bulk insert different type of tables with and without identity column (see comment description inside procedure).

  • akljfhnlaflkj

    SSC Guru

    Points: 76202

    Thanks for the scripts. We do this on occasion so I may use this script.

  • akljfhnlaflkj

    SSC Guru

    Points: 76202

    Thanks for the script.

  • jhart@ipswitch.com

    Newbie

    Points: 9

    Love the script!

    The only issue is that you assume people already have the usp_LogError and usp_ReportError stored procedures you reference in your catch section. Therefore, you should reference those scripts as well.

  • kast218

    SSCertifiable

    Points: 6286

    Thanks for your post, JHart4444!

    You can add issue on Github or grab last version: https://github.com/ktaranov/sqlserver-kit/blob/master/Stored_Procedure/usp_BulkUpload.sql or just comment 224 and 225 rows in code:

    EXECUTE dbo.usp_LogError;

    EXECUTE dbo.usp_PrintError;

    Also you could find useful another stored procedures:

    https://github.com/ktaranov/sqlserver-kit/blob/master/Stored_Procedure/usp_bcpTableUnload.sql

    https://github.com/ktaranov/sqlserver-kit/blob/master/Stored_Procedure/usp_bcpUnloadSelect.sql

  • VladB

    SSC-Addicted

    Points: 418

    Konstantin,

    Your script is absolutely great.  Thank you very much.  And your GitHub server-kit is fantastic!!!!    Has everything for any occasions. Real library - just navigate and use it. 
    Vlad

  • kast218

    SSCertifiable

    Points: 6286

    VladB - Friday, February 24, 2017 7:48 AM

    Konstantin,

    Your script is absolutely great.  Thank you very much.  And your GitHub server-kit is fantastic!!!!    Has everything for any occasions. Real library - just navigate and use it. 
    Vlad

    Great thanks for feedback, Vlad. Its motivate. Always happy to help.

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

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