Monday, March 26, 2012

SQL Server Acronyms

I have titled this post SQL Server Acronyms, but I think several of these acronyms refer to SQL in general and not a specific implementation like Microsoft SQL Server.

I had a job interview recently and the interviewer quized me on some SQL Server acronyms.  I was not as prepared as I should've been.  I had heard several of them, but not committed them to memory.  I write the code and don't always remember the catch phrases.

I have created a list below.  Some the interviewer asked about and some I came across as I was researching the others.


  • SRS/SSRS - SQL Reporting Services/SQL Server Reporting Services
    • I have seen this referred to as SRS in some places and SSRS in others.
    • It is a Microsoft reporting engine.
    • It competes with Crystal Reports and other reporting technologies.
    • The reports are defined with RDL - Report Definition Language.
  • SSIS - SQL Server Integration Services
    • Performs data migration tasks.
  • SSB - SQL Server Service Broker
    • Provides message queuing.
  • DTS - Data Transformation Services
    • Use to load, extract, and transform data in and out of a database.
  • DML - Data Manipulation Language
    • Things like Update, Insert, and Delete.
  • DDL - Data Definition Language
    • Things like Alter, Create, and Drop
  • DCL - Data Control Language
    • Things like Grant and Revoke statements
  • TCL - Transactional Control Language
    • Things like Commit and Rollback
  • DQL - Data Query Language
    • Some resources I have been reading say DQL is Select statements and others say Select is part of DML.

Truncate Table SQL Server

I was asked in an interview not long ago what Truncate did in SQL Server.  I had remembered seeing a Truncate statement in the code of the project that I am currently working on, but couldn't remember what we used it for.  I came home and read up on it.

The statement is Truncate Table [table name].

It appears to be the equivalent to the DELETE statement without a where clause.  Basically it dumps all your records in the table.  This is handy for temp tables that you might be using and reusing for heavy lifting.

Truncate Table is faster than Delete.  It is likely that truncate doesn't pick each row, but just dumps them all.  Perhaps moving a record pointer to the top of the table and letting all the other memory be reclaimed.  It also doesn't appear to do all the logging that Delete does.  It you need logging you should stick with Delete and take the performance hit.

In many ways the end result of Truncate Table is the same as executing a Drop Table and then a Create Table with the exact same table layout.

There seem to be limitations on the Truncate command that it can't be used if the table has a foreign key constraint.  The Delete statement does not have that limitation.

Tuesday, July 26, 2011

VB6 Make Exe Menu Disabled

We are noticing that every so often with no reason we can determine the Make Exe menu disables.  The only solution we have been able to find is detailed below.

1.  Right click any toolbar.
2. Click the Toolbars tab.
3. Click Reset.

Thursday, March 10, 2011

Windows Installer Error on Windows 7

I was getting the error with any Microsoft Installer (MSI) that I would try to install, repair, or uninstall "A network error occurred while attempting to read from the file:" on Windows 7.


It was pointing to a J: drive on my machine.  It said that the MSI was being looked for in that path.  I finally created the path it was looking for and put the file there and then it would tell me that the MSI file was invalid or corrupt.


I tried using the upgrade option of my Windows 7 install disk.  At first it told me that I had a more current version of Windows 7 already installed, even though the setup program went out and got the latest setup files before starting to try to install.  I found a DVD with Windows 7 Service Pack 1 and tried again.  It still went to download updated files, but this time it succeeded.  Unfortunately, when I booted windows back up it had not fix Microsoft Installer.


After becoming desperate after several days of research and assuming I was to the point of reformatting and reinstalling Windows and all of my software I decided to hack the registry.  I went through and searched for every reference to j: in the registry and removed almost all of them.  This did not fix the problem.  All it did was cause the installer to not auto fill the path when it gave me the error.


I then found this link with registry keys that Microsoft Installer uses.  http://msdn.microsoft.com/en-us/library/aa367758(v=vs.85).aspx  I deleted all of these keys and tried again.  All of the installers worked after that.

Friday, February 4, 2011

TrueDBGrid Not Clearing Last Row

I have a TrueDBGrid that is bound to an XArray in Visual Basic 6 (VB6).  I was finding that when I would delete all the rows from the XArray and rebind to the TrueDBGrid the grid would still contain the data, even though the XArray did not.  After spending hours trying every property and method of the TrueDBGrid and the XArray I finally stumbled across a way that worked.

I was clearing the array that was previously assigned to the grid and then rebinding the grid, but the grid wasn't updating.

Original Code:

    xaData.Clear
    tdbGrid.ReBind

I found that even though the TrueDBGrid's array property had previously set to the XArray it needed to be set again after the clear and then rebound.

New Code:

    xaData.Clear
    tdbGrid.Array = xaData
    tdbGrid.ReBind

Friday, August 20, 2010

ActiveX UltraGrid Not Sorting With More Than 1000 Rows

I am using an ActiveX UltraGrid on a Visual Basic 6 (VB6) form.  I was having problems with it not sorting.  I researched it for a long time and found that if you have more than 1000 rows the grid will not sort with the default settings.  I had to change the FetchRows property to 3-ssFetchRowsPreloadWithSiblings.

This property is a little tricky to find.  It is on the Categorized tab of the Property Page.  On that tab there is an expandable item called Behavior.  Expand that item and there will be another expandable item called Override.  Expand Override and the FetchRows property is under there.  I changed this property to 3-ssFetchRowsPreloadWithSiblings and it allowed the grid to sort.


Wednesday, July 21, 2010

Crystal Report "report" showing just 19 pages (out of 43 pages)

An old friend of mine was having some trouble with Visual Basic 6 and Crystal reports.  Here is what he told me his problem was and the solution he found.

A ticket was assigned to me to look at a report that was not displaying all the data. The report displayed just 19 pages. The user said he/she was expecting around 40 pages…. After hours of trying different things I found the problem….

·         The Report had a sub-report
·         The 19 pages represented the main report
·         The sub-report was not showing because the VB6 code is dynamically creating SQL that is passed to the report. It just happened that when one of the parameters (user entered thru the UI) was 0 (zero)
·         The VB6 code was doing Format$(USER_PARAMETER, "######") this caused the value to be empty
·         Solution Format$(USER_PARAMETER, "#####0")