FIX: SELECT INTO Variable and Table May GP Fault Server
  
PSS ID Number: Q101810
Article last modified on 10-31-1994
 
4.20 4.20a
 
OS/2
 

----------------------------------------------------------------------
The information in this article applies to:
 
  - Microsoft SQL Server versions 4.2 and 4.2a for OS/2
----------------------------------------------------------------------
 
BUG# OS/2: 1626 (4.2)
 
SYMPTOMS
========
 
Executing a SELECT INTO statement that uses invalid syntax by
assigning results to a local variable may trap SQL Server.
 
The following example traps the server:
 
   declare @db_num smallint
   select @db_num = max(dbid) into #temp from sysdatabases
 
WORKAROUND
==========
 
The above syntax is invalid. The same effect can be achieved by using
either of the following two sets of statements:
 
   declare @db_num smallint
   select @db_num = max(dbid) from sysdatabases
 
or
 
   select max(dbid) into #temp from sysdatabases
 
If you want to assign to a variable and send data to a new table, use
both statements.
 
STATUS
======
 
Microsoft has confirmed this to be a problem in SQL Server versions
4.2 and 4.2a for OS/2. This problem was corrected in SQL Server version
4.2aK10. For more information, contact your primary support provider.
 
Additional reference words: 4.20 4.2 GP_Fault Transact-SQL
KBCategory: kbprg
KBSubCategory: SSrvServer
 
=============================================================================
 
Copyright Microsoft Corporation 1994.
