Newbie guide to scripting

  • Is there a post or an article someplace that has a newbie guide to scripting ? I currently have several pipe delimited files that I manually import into SQL after a nightly FTP download. I'd like to script the table truncate and import every night after the FTP downloads are completed.

    Thanks,

    Patrick


    Kindest Regards,

    Patrick Allmond
    batteryfuel.com
    For all of your laptop, camera, power tool and portable battery needs.

  • Books online (bol for short) has all the info you need. The thing is that you need to know what you're looking for in order to find it in that huge library.

    To truncate the table : TRUNCATE TABLE dbo.TableName

    To import, you can check out the BCP commands, or bulk inserts.

    Post back if you need further help after reading from BOL.

  • Thanks. I'll head there.


    Kindest Regards,

    Patrick Allmond
    batteryfuel.com
    For all of your laptop, camera, power tool and portable battery needs.

  • You might also search for some scripts here on the site. Chances are someone has writtne some of them already.

  • This will help, as well...

    http://www.w3schools.com/sql/default.asp

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Books Online is your BEST friend when it comes to TSQL. Keep that in mind


    * Noel

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

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