Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Last four characters of a field
Message
 
 
To
17/10/2012 16:05:40
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2008
Application:
Web
Miscellaneous
Thread ID:
01555203
Message ID:
01555205
Views:
71
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform