Working with SQL Source Files

From SQLBWiki

Jump to: navigation, search

[edit] Opening SQL Files

There are 4 ways to open an SQL file for editing (in the least to most productive order):

  • Use the File / Open Menu (quite slow, discouraged)
  • Find the file in the Operating System Explorer and Drag the file in the editor
  • Use the Favorites tab on the left to add Folders and Files (Right Click: Add to Favorites). If favorite tab is absent, make it appear in the Windows menu
  • Use the Find Object tab (Ctrl-Shift-O) and tick the 'Source' Option. (Need to setup the Sources Options in the preferences) From version 396. This is the most efficient way to work sith source files


[edit] Editing SQL Files

  • Tab or Shift-Tab on marked text indents or unindent the block
  • Alt-Ctrl-Shift-F reformats the SQL code, without changing the number of lines
  • Double clicking on a tab maximises or restores the window
  • You can have rudimentary auto completion on object names by hitting Ctrl-Space. For auto completion of foreign keys, please refer to Dependencies And Schema
  • You can use Templates to speed up code writing. For example, type crp <Tab> will expand a stored proc creation template. You can create you own templates in File / Option / Editor / Code Templates (Language:SQL)
Personal tools