20 June 2007

Server 2000: Query Analyzer Tips & Tricks

You probably know that SQL Server stores metadata about all of the objects in a database. The system tables contain a wealth of information about column names, data types, identity seeds, and so on. But did you know that you can get that information with a single keystroke via Query Analyzer? Highlight the object name in any SQL statement and press Alt+F1. Figure 1 shows the results for a SQL Server table. If you don't have anything highlighted, Alt+F1 will give you information about the database itself. For an equally neat trick, highlight a SQL keyword and press Shift+F1; you'll go straight to the Books Online page that describes that keyword.

19 June 2007

Getting .dll into Registry

  1. Download the file (MSRDO20.zip) to your desktop
  2. Unzip the content of the file (a file called MSRDO20.DLL) to your desktop
  3. Right now you should have a new file called MSRDO20.DLL that resides on your desktop
  4. Copy this file to your Windows System Folder; this folder is usually found inside your 'C:\Windows' folder. It is called 'C:\Windows\System' or 'System32'...
  5. Go to 'Start Menu' and choose 'Run'
  6. A new window titled 'Run' will open; type the line 'regsvr32.exe msrdo20.dll' and hit 'Enter'.
  7. A message will show up stating that the registration was successful.

09 June 2007

Visual Studio Short-cuts

Most of the time, you will Step Into or Step Over commands in your stored procedures. The commands below apply to a single T-SQL line:

  • Step Into (F11): Use to single step through your code. (Move the yellow arrow down one statement.)
  • Step Over (F10): Useful if you have lines of code that perhaps modify data or call other procedures that you don't care about while debugging. For example, you may want to skip code that performs auditing.
  • Step Out (SHIFT+F11): Execute the rest of the stored procedure without pause.
  • Run to Cursor (CTRL+F10): Position the cursor to a point in your code and then hit CTRL-F10 to execute all code up to that point.
  • Continue or Start Debug or Run (F5): Start Debug. Or resumes execution until completion or until the next breakpoint.
  • Toggle Bookmark (CTRL+K)
  • Help (F1)

When you provide a summary of the class using XML comments, your class displays documentation about itself in appropriate places within Visual Studio, such as in the List Members box. Open the List Members box by selecting Edit | Intellisense | List Members from the main menu bar or by clicking the Display an Object Member List icon on the Text Editor toolbar.

Command Window debugging: Getting Values

To see the value of your variable whilst in Debug mode, use the "Command Window" (View >Other Windows >Command Window). Enter this: ? myVariableName
http://ondotnet.com/pub/a/dotnet/excerpt/vshacks_chap1/index.html

header adsense code