Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Last four characters of a field
Message
 
 
À
17/10/2012 16:05:40
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:
01555203
Message ID:
01555205
Vues:
69
This message has been marked as the solution to the initial question of the thread.
>I need to obtain the proper syntax to do a query on a character field based on the last four characters. For example, the record could have this value in that field: ThisIsMyFileName.ext. Thus, I need to locate the .ext record.

Well, it will be
FieldName LIKE '%[.]ext'
This will be non-sargable, so if you can create a computed column for extension and index on it, the performance will be better.
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