Skip to content
David Kittell
David Kittell

Application & System: Development / Integration / Orchestration

  • Services
    • Application Development
    • Online Application Integration
  • Code
  • Online Tools
  • Tech Support
David Kittell

Application & System: Development / Integration / Orchestration

File Extension

Posted on October 17, 2013October 26, 2015 By David Kittell

If you are working in a database that has asset/file storage and need to get just the extension of the column this query will help save time.

SELECT CASE
		WHEN filepath LIKE '%.%'
			THEN RIGHT(filepath, Len(filepath) - Charindex('.', filepath))
		ELSE filepath
		END FilePath
FROM tbl1
Originally Posted on October 17, 2013
Last Updated on October 26, 2015
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.

Related

Code MSSQL

Post navigation

Previous post
Next post

Related Posts

MSSQL – Valid Date

Posted on March 14, 2014October 26, 2015

Validate a non-DateTime data type field is a really a date. SET LANGUAGE English; — Not necessary but can be helpful SELECT ISDATE(’15/04/2008′); –Returns 0. SELECT ISDATE(’04/15/2008′); –Returns 1. Originally Posted on March 14, 2014Last Updated on October 26, 2015 All information on this site is shared with the intention…

Read More

Find Most Expensive Queries Using DMV

Posted on April 29, 2013October 26, 2015

SELECT TOP 10 SUBSTRING(qt.TEXT, (qs.statement_start_offset / 2) + 1, ( ( CASE qs.statement_end_offset WHEN – 1 THEN DATALENGTH(qt.TEXT) ELSE qs.statement_end_offset END – qs.statement_start_offset ) / 2 ) + 1) ,qs.execution_count ,qs.total_logical_reads ,qs.last_logical_reads ,qs.total_logical_writes ,qs.last_logical_writes ,qs.total_worker_time ,qs.last_worker_time ,qs.total_elapsed_time / 1000000 total_elapsed_time_in_S ,qs.last_elapsed_time / 1000000 last_elapsed_time_in_S ,qs.last_execution_time ,qp.query_plan FROM sys.dm_exec_query_stats qs CROSS…

Read More

Responsive Design Tabled Div

Posted on October 1, 2013October 26, 2015

#page { max-width: 1280px; height: 100%; } /* Portrait Start */ @media screen and (max-width: 540px) { } /* Portrait Stop */ /* Landscape Start */ @media screen and (min-width: 541px) { #BodyContent1 { width: 50%; float: left; height:100%; } #BodyContent2 { width: 50%; float: right; height:100%; } } /*…

Read More

Code

Top Posts & Pages

  • PowerShell - Rename Pictures to Image Taken
  • Front Page
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions

Recent Posts

  • Javascript – Digital Clock with Style
  • BASH – Web Ping Log
  • BASH – Picture / Video File Name Manipulation
  • Mac OSX Terminal – Create SSH Key
  • Bash – Rename Picture

Top Posts

  • PowerShell - Rename Pictures to Image Taken
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions
  • Open On Screen Keyboard (OSK)
  • SQLite - Auto-Increment / Auto Generate GUID
©2025 David Kittell | WordPress Theme by SuperbThemes