Compartir a través de


Most tedious task ever

I just got finished doing something that I wish I had a program to do.  I'm sure it could be automated but I didn't know anything that could do it off the top of my head that would take less time than just doing it manually.  I had to create a .SQL file for each of the stored procedures used in our database.

Thank god for the right-click keyboard button.  Don't know what that key is called but it brings up the right-click menu for the item your currently on.  It is one of the few extra keys a Windows keyboard comes with.  Anyhow to create these files in Studio Manager I had to do the following key sequence.  F2, ctrl+c, Esc, right-click key, S, C, F, ctrl+v, Enter, Down arrow. 10 Keys!  Eek.  This copied the procedure name and then created a file with that name in the default document directory.

Surprisingly it didn't take that long.  At least everything is in the depot now.

Comments

  • Anonymous
    January 02, 2008
    In SQL Management Studio, Right-Click on the database, Highlight Tasks, then click Generate Scripts. Click Next. Select your database, then click Next. Click Next. Select "Stored procedures" then click Next. Click "Select All" then click Next. Click "Script to file," then click "File per object," then type your destination folder, then click Next. Click Finish. Wait for it to finish, then click Close. This should do most of what you want.

  • Anonymous
    January 02, 2008
    Also, if you have no right-click key, Shift + F10 accomplishes the same thing (pretty much anywhere in Windows).