---
title: "How To Split From Last Dot In Sql Server?"  
description: "How To Split From Last Dot In Sql Server?"  
author: "Manoj Bhatt"  
published: 2014-10-27  
updated: 2014-10-27  
canonical: https://www.mindstick.com/forum/2437/how-to-split-from-last-dot-in-sql-server  
category: "mssql server"  
tags: ["c#", "sql server"]  
reading_time: 1 minute  

---

# How To Split From Last Dot In Sql Server?

Hi,**The below are the [values](https://www.mindstick.com/forum/327/sum-textbox-values) [stored](https://www.mindstick.com/forum/157561/what-is-the-stored-procedure-create-a-procedure-to-find-the-record-by-stu_id-from-the-student-table) in DB.**2013.ack2013.regres2013.zip.ackHere I need to trim the values before the last [dot](https://www.mindstick.com/forum/92/what-is-the-dot-net-framework-data-provider-for-sql-server)(.).The [output](https://www.mindstick.com/interview/34427/explain-the-output-in-angular) should be like below2013.2013.2013.zip.

## Replies

### Reply by Anonymous User

Hi,\
Please try with below sample \

```
DECLARE @Expression NVARCHAR(100)SET @Expression = 'abc.test.sd'SELECT SUBSTRING(@Expression,1,LEN(@Expression)-(CHARINDEX('.',REVERSE(@Expression))-1))
```


---

Original Source: https://www.mindstick.com/forum/2437/how-to-split-from-last-dot-in-sql-server

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
