Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7893667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:11:29+00:00 2026-06-03T07:11:29+00:00

I need, if possible, a T-SQL query that will return the values in a

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T07:11:30+00:00Added an answer on June 3, 2026 at 7:11 am

    You could try something like:

    SELECT id, server_name, SUBSTRING(domain_name, 1, CHARINDEX('.', domain_name) - 1)
    FROM mastertable
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am looking for an SQL query that will return a 1 or a
I am writing an SQL query in which that I will need to perform
I need help writing a T-SQL query that will generate 52 rows of data
I need query (to be more specific, it is view, not query) that will
I have this postgres sql query: select * from stats where athlete_id = 5
Possible Duplicate: How can I connect to an external database from a sql statement
I'm trying to come up with a LINQ query that will return the first
Possible Duplicate: Best way to stop SQL Injection in PHP I need to secure
Possible Duplicate: Saving changes after table edit in SQL Server Management Studio I need
I have an ActiveX plugin that we need (if possible) to run in Firefox.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.