I need, if possible, a T-SQL query that will return the values in a specific format from the columns.
I can do this programmatically (c#), but is it possible to do in query using SQL Server 2008 ?
Here's the current query
select id, server_name, domain_name
from mastertable
Current output:
id server_name domanin_name
1 sys1 one.abc.in
2 sys2 two.pqr.in
3 sys3 three.abc.in
4 sys4 four.xyz.in
I need to display data as (skip value after (.) for column domain_name):
id server_name domanin_name
1 sys1 one
2 sys2 two
3 sys3 three
4 sys4 four
Thanks in advance