1 / 10

Scripting and automation with SQLCMD

Scripting and automation with SQLCMD . Haidong “Alex” Ji http://www.HaidongJi.com . About Me. http://www.HaidongJi.com MCSD, MCDBA Co-author of Professional SQL Server 2005 Integration Services from Wrox

kanoa
Download Presentation

Scripting and automation with SQLCMD

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Scripting and automation with SQLCMD Haidong “Alex” Ji http://www.HaidongJi.com

  2. About Me • http://www.HaidongJi.com • MCSD, MCDBA • Co-author of Professional SQL Server 2005 Integration Services from Wrox • Regular columnist for SqlServerCentral.comhttp://www.sqlservercentral.com/columnists/hji/ • Specialize in Sql Server. Also work with Oracle and MySql on Solaris and Linux

  3. Agenda • sqlcmd, osql, and isql comparison • Batch and Interactive mode • sqlcmd customization • Variables for powerful scripting • sqlcmd in Management Studio

  4. sqlcmd, osql, and isql • osql there, isql gone • osql on its way out, maybe Sql Server 2010;) • Switches are very similar. Switches are case-sensitive!! • Same commenting style • Demo • Look at the switches by doing sqlcmd /? and osql /?

  5. Batch and Interactive mode • Batch: use -i for input script file • Interactive • Demo • Pubs batch • Interactive Pubs

  6. sqlcmd customization • Change default editor • Initialization script • Demo

  7. Variables for powerful scripting • Backup and restore scenario and scripts • Demo

  8. sqlcmd in Management Studio • Good place for editing • Some sqlcmd commands cannot be used

  9. Additional Resources • BOL • Sqlservercentral.com • http://www.HaidongJi.com/download I will post the slides and scripts there for download.

  10. Thank you! Thank you for attending this session and the 2006 PASS European Conference in Barcelona, Spain. Please help us improve the quality of our conference by completing your session evaluation form. Completed evaluation forms should be submitted to the room monitor as you exit or to staff at the registration desk.

More Related