SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Query Help
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

sqlfresher2k7
Aged Yak Warrior

583 Posts

Posted - 07/02/2012 :  16:58:32  Show Profile  Reply with Quote
how to get the desired results from the following ip

TableA

Ip
-------------------------------
5.46.200.1.462222.2.1.2.3.4.5.1
5.46.200.1.462222.2.1.2.3.4.5

Expected output:

Ip
-------------------------------
5.46.200.1.462222.2.1.2.3.4.5
5.46.200.1.462222.2.1.2.3.4

thanks for your help in advance

tkizer
Almighty SQL Goddess

USA
35007 Posts

Posted - 07/02/2012 :  17:05:32  Show Profile  Visit tkizer's Homepage  Reply with Quote
What is your business requirement? Just chop off the last 2 characters?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

sqlfresher2k7
Aged Yak Warrior

583 Posts

Posted - 07/02/2012 :  17:21:27  Show Profile  Reply with Quote
Yes ..exclude the last 2 characters.
Go to Top of Page

yosiasz
Flowing Fount of Yak Knowledge

USA
1608 Posts

Posted - 07/02/2012 :  17:24:37  Show Profile  Click to see yosiasz's MSN Messenger address  Reply with Quote
declare @whyalwaysme table(id varchar(max))
insert @whyalwaysme
select '5.46.200.1.462222.2.1.2.3.4.5.1'
union
select '5.46.200.1.462222.2.1.2.3.4.5'

select left(id, len(id) -2) from @whyalwaysme

<><><><><><><><><><><><><><><><><>
If you don't have the passion to help people, you have no passion
Go to Top of Page

sqlfresher2k7
Aged Yak Warrior

583 Posts

Posted - 07/02/2012 :  17:31:14  Show Profile  Reply with Quote
Thanks a lot it works..
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000