Microsoft KB Archive/307948

From BetaArchive Wiki
Knowledge Base


Article ID: 307948

Article Last Modified on 9/26/2005



APPLIES TO

  • Microsoft SQL Server 2000 Standard Edition



This article was previously published under Q307948

BUG #: 355624 (SHILOH_BUGS)

SYMPTOMS

Sending attached results of a SQL query adds an extra space before each row of the result set output if the @separator option is not specified with the xp_sendmail call.

CAUSE

When using the default separator, SQL Server 2000 does not account for the first column and adds the separator to the file, thereby changing the default behavior exhibited by prior builds of SQL Server.

RESOLUTION

To resolve this problem, obtain the latest service pack for Microsoft SQL Server 2000. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

290211 INF: How to Obtain the Latest SQL Server 2000 Service Pack


Hotfix

NOTE: The following hotfix was created prior to Microsoft SQL Server 2000 Service Pack 2.

The English version of this fix should have the following file attributes or later:

   File name     Version
   ----------------------
   Sqlmap70.dll  8.00.449
                

NOTE: Due to file dependencies, the most recent hotfix or feature that contains the above files may also contain additional files.



WORKAROUND

Set the @separator to a single space to retain column separation by spaces and avoid the default behavior.

STATUS

Microsoft has confirmed that this is a problem in Microsoft SQL Server 2000. This problem was first corrected in Microsoft SQL Server 2000 Service Pack 2.

MORE INFORMATION

After application of this correction, a new registry key ('ignore_default_column_separator') for the SQL Server instance can be established to select the SQL Server 2000 or SQL Server 7.0 behavior as the default.

Setting the value of the registry key to DWORD=1 establishes the SQL Server 7.0 behavior. When the key does not exist or is set to DWORD=0, the SQL Server 2000 behavior will be the default.

For a default instance:

EXEC master..xp_regwrite 'HKEY_LOCAL_MACHINE',
   'Software\Microsoft\MSSQLServer\SQLMAPI',
   'ignore_default_column_separator', 'REG_DWORD', 1
                

For a named instance:

EXEC master..xp_regwrite 'HKEY_LOCAL_MACHINE',
   'Software\Microsoft\Microsoft SQL Server\<<INSTANCE NAME>>\SQLMAPI',
   'ignore_default_column_separator', 'REG_DWORD', 1
                

Keywords: kbbug kbfix kbqfe kbsqlserv2000presp2fix kbhotfixserver KB307948