• Home
  • Courses
  • Contact
  • About Us
  • Blog
  • Become a Teacher
Have any question?
(00) 000 000 000
info@SQLDbaSchool.com
RegisterLogin

Login with your site account

Lost your password?

Not a member yet? Register now

Register a new account

Are you a member? Login now

SQL DBA School
  • Home
  • Courses
  • Contact
  • About Us
  • Blog
  • Become a Teacher

    Blog

    • Home
    • Blog
    • Blog
    • SSMS Quick Tip: Never lose your script from overwrite again!

    SSMS Quick Tip: Never lose your script from overwrite again!

    • Posted by Refaw
    • Categories Blog, Business, SQL, SSMS
    • Date January 20, 2016

    Twenty something years ago when I started my SQL Server career there was an amazing tool called Query Analyzer. Honestly I’d say if Microsoft did nothing more than bring this tool back and call it Azure Data Studio I would have been excited and beyond happy.

    MySQL Operators

    I bring up this relic of a tool because it’s here that I got into the habit of using the “Insert File” shortcut that was on the toolbar. If you’ve worked as a DBA or SQL developer for any reasonable amount of time you can probably relate to having 20+ query windows open. Back then I’d have people come up to my desk and they ask about a perf issue or to kill a SPID. The problem is that I’d open a saved script and then type/edit things in it and leave it open. This was all good until one day the company started restarting machines nightly and the tool would auto save on close. Ouch! Everything was gone or completely broken. Sure you can put your things in Git now-a-days but this is much easier, trust me.

    I said “Quick” tip right? Let’s get to it! This is so simple you’re going to laugh and when you start this habit you’ll never go back. Instead of using the “Open File” shortcut to open a script, click New Query and then choose “Edit” & “Insert File As Text…”.  You’ll see this link has been added to my standard toolbar in the screen shots below. More on this in a moment. For now just look at the before and the after.

    Open a script with the “Open File” button: Note that the saved file name is listed. Saving anything here overwrites your file. Yikes!

    image

    Now Choose “New Query” instead and then “Insert File As Text…” from the Edit menu.

    image

    Note that the query script has been “inserted” but the file name says “SQLQuery10.sql”. Yay! No chance to overwrite this one!

    image

    If you’d like to add the “Insert File as Text…” button to your toolbar here’s a few screen shots showing how:

    Customize the toolbar and click “Add Command”.

    image

    Choose “Edit” on Categories and then select “Insert File”.

    image

    Move the command to your preferred location with the “Move Up” or “Move Down” buttons.

    image

    And now it’s there

    image

    Tag:Course

    • Share:
    author avatar
    Refaw

    Previous post

    Tips to Succeed in an Online Course
    January 20, 2016

    Next post

    What is Page Life Expectancy?
    January 20, 2016

    You may also like

    blog-7
    Availability Group issues fixed with Alerts
    20 January, 2016
    blog-9
    What is Page Life Expectancy?
    20 January, 2016
    blog-5
    Tips to Succeed in an Online Course
    20 January, 2016

    Search

    Categories

    • Blog
    • Business
    • career Advice
    • Design / Branding
    • IT
    • Jobs
    • Microsoft
    • Microsoft certification
    • Online Course
    • SQL
    • SQL Queries
    • SSMS
    SQL Server DBA Training from Beginner to Advanced

    SQL Server DBA Training from Beginner to Advanced

    $79.00
    SQL Server 2019 overview and installation

    SQL Server 2019 overview and installation

    $29.00
    SQL Server Tutorial Interactive

    SQL Server Tutorial Interactive

    $69.99

    sql classes free online - sql training course online

    (00) 000000000009

    info@SQLDBASChool.com

    COMPANY

    • Blog
    • About Us
    • Contact

    LINKS

    • About Us
    • Blog
    • Contact
    • Become a Teacher

    RECOMMEND

    • FAQs
    • Become a Teacher
    • sql learning resources
    • SQL Server DBA Interview Questions

    SUPPOTRT

    • Home
    • Courses
    • Contact
    • About Us
    • Blog
    • Become a Teacher

    Powered by SQL DBA School - Copyright 2020

    • Privacy
    • Terms
    • Sitemap
    • All Courses

    Become an instructor?

    Become an instructor?

    Join thousand of instructors and earn money hassle free!

    Get started now