﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2008 / T-SQL (SS2K8)  / T-SQL query help / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Wed, 22 May 2013 21:09:31 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: T-SQL query help</title><link>http://www.sqlservercentral.com/Forums/Topic1364451-392-1.aspx</link><description>Another way is like this (a computed column):[code="sql"]IF object_id('TempDB..#tTemp1') IS NOT NULLDROP TABLE #tTemp1CREATE TABLE #tTemp1(ID int, Name varchar(20)    ,Comment AS ('The city name is ' + Name))INSERT INTO #tTemp1(ID, Name)SELECT 1, 'NewYork'UNION SELECT 2, 'Virginia'UNIONSELECT 3, 'London'UNIONSELECT 4, 'Sydney'UNIONSELECT 5, 'Dubai'SELECT * FROM #tTemp1DROP TABLE #tTemp1[/code]</description><pubDate>Thu, 27 Sep 2012 19:13:21 GMT</pubDate><dc:creator>dwain.c</dc:creator></item><item><title>RE: T-SQL query help</title><link>http://www.sqlservercentral.com/Forums/Topic1364451-392-1.aspx</link><description>Hi ,You can get the desired result quiet easily...The below mentioned code will solve your problem.Select ID, Name, 'The City name is ' + Name CommentFrom #tTemp1</description><pubDate>Thu, 27 Sep 2012 04:01:48 GMT</pubDate><dc:creator>ard5karthick</dc:creator></item><item><title>RE: T-SQL query help</title><link>http://www.sqlservercentral.com/Forums/Topic1364451-392-1.aspx</link><description>Did you know that in [i]any[/i] tiered architecture, not just SQL, that kind of display formatting is  always done in a presentation layer? This tiered concept is usually covered in the first day of any class on the subject.</description><pubDate>Wed, 26 Sep 2012 01:38:20 GMT</pubDate><dc:creator>CELKO</dc:creator></item><item><title>RE: T-SQL query help</title><link>http://www.sqlservercentral.com/Forums/Topic1364451-392-1.aspx</link><description>Yep, just this easy:[code="sql"]IF object_id('TempDB..#tTemp1') IS NOT NULLDROP TABLE #tTemp1CREATE TABLE #tTemp1(ID int, Name varchar(20))INSERT INTO #tTemp1(ID, Name)SELECT 1, 'NewYork'UNION SELECT 2, 'Virginia'UNIONSELECT 3, 'London'UNIONSELECT 4, 'Sydney'UNIONSELECT 5, 'Dubai'SELECT ID, Name, 'The city name is ' + Name as Comment FROM #tTemp1DROP TABLE #tTemp1[/code]</description><pubDate>Wed, 26 Sep 2012 00:55:10 GMT</pubDate><dc:creator>Lynn Pettis</dc:creator></item><item><title>RE: T-SQL query help</title><link>http://www.sqlservercentral.com/Forums/Topic1364451-392-1.aspx</link><description>Its really a simple solution with all you need to do is add a column that conactinates the fixed string 'This city name is ' and the Name Column.</description><pubDate>Wed, 26 Sep 2012 00:36:28 GMT</pubDate><dc:creator>Jason-299789</dc:creator></item><item><title>T-SQL query help</title><link>http://www.sqlservercentral.com/Forums/Topic1364451-392-1.aspx</link><description>Hi..I have data the data in the below temp table(SQL query)[code="sql"]IF object_id('TempDB..#tTemp1') IS NOT NULLDROP TABLE #tTemp1CREATE TABLE #tTemp1(ID int, Name varchar(20))INSERT INTO #tTemp1(ID, Name)SELECT 1, 'NewYork'UNION SELECT 2, 'Virginia'UNIONSELECT 3, 'London'UNIONSELECT 4, 'Sydney'UNIONSELECT 5, 'Dubai'SELECT * FROM #tTemp1DROP TABLE #tTemp1[/code] I need the SQL query to get the output as:[img]http://www.sqlservercentral.com/Forums/Attachment12473.aspx[/img]Thanks..</description><pubDate>Wed, 26 Sep 2012 00:19:57 GMT</pubDate><dc:creator>etirem</dc:creator></item></channel></rss>