- CREATE TABLE #temp([Source] NVARCHAR(100))
- INSERT INTO #temp([Source]) VALUES
- ('2012-04-27 16:49:24$1$2'),
- ('2012-04-27 17:04:26$2$2'),
- ('2012-04-27 17:18:58$2$2926180')
- SELECT [Source],
- PARSENAME(REPLACE([Source],'$','.'),3) AS [日期],
- PARSENAME(REPLACE([Source],'$','.'),2) AS [考勤机号],
- PARSENAME(REPLACE([Source],'$','.'),1) AS [员工编号]
- FROM #temp