标题: SQL sever 取得档案名字与扩展名 split get file name and extension [打印本页] 作者: 资讯王 时间: 2010-12-28 16:47 标题: SQL sever 取得档案名字与扩展名 split get file name and extension SQL sever 不必写函数,select指令轻松取得档案名字与扩展名 No need function, select command split and get filename and extension
取档案名字 get file name
SELECT (SUBSTRING((FileName), 1, CHARINDEX('.', (FileName)) - 1)) AS FileName
FROM tblFile
复制代码
取档案扩展名 get file name extension
SELECT REVERSE(SUBSTRING(REVERSE(FileName), 1, CHARINDEX('.', REVERSE(FileName)) - 1)) AS FileExt