Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Union and calculated field
Message
 
 
À
28/02/2010 02:12:05
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2008
Application:
Web
Divers
Thread ID:
01451565
Message ID:
01451575
Vues:
40
This message has been marked as a message which has helped to the initial question of the thread.
>>Which field is Text datatype? If you're using SQL 2005 and up, cast TEXT field to varchar(max).
>
>Url2 was Text datatype. I have adjusted and it works.
>
>>Also, IMHO, it doesn't make much sense to have char(74) field. I would use varchar(74) instead.
>
>Why would that be?
>

IMHO, using char type makes sense only when you know that all 74 characters are always populated. Say, it makes sense to have Char(2) for State field or Char(1) for some type field.

However, if you need to store variable length information, then it makes much more sense to use VARCHAR type rather than CHAR to save space.

>>Finally, if you want to get rid of the error, use UNION ALL instead of UNION.
>
>When I use UNION ALL, it worked even before I changed the Text. What does UNION ALL exactly?

UNION performs distinct and therefore certain types can not be used with UNION. (You'll get the same error if you try to use UNION and memo fields).

UNION ALL doesn't perform DISTINCT operation and therefore we can use it even with TEXT type in SQL Server or Memo field in VFP.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform