Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Hacker Guide Question
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Produits tierce partie
Divers
Thread ID:
00625768
Message ID:
00626057
Vues:
14
Yes, it's legal. Sql Server is quite flexible in that matter. The following is legal too
Select SPACE(1) FROM mytable UNION SELECT cName FROM someothertable
The size of the result column would be equal the lenght of cName in either case.

>FWIW, this is legal to do in Oracle. I wonder if it is legal in SQL Server.
>
>>I need to amend my initial reply here. What does not work is a union where the same field in the second query is a smaller size. For example
SELECT cName FROM mytable UNION SELECT cName FROM someothertable
results in error 1851 if cName is C(10) in mytable and C(1) in someothertable (i.e., smaller but not identical).
>>
>>No error is generated if you use space(1) in the second query
SELECT cName FROM mytable UNION SELECT SPACE(1) FROM someothertable
although the result is not necessarily what one would expect.
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform