<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: SQL SERVER &#8211; Concat Function in SQL Server &#8211; SQL Concatenation</title>
	<atom:link href="http://blog.sqlauthority.com/2010/11/25/sql-server-concat-function-in-sql-server-sql-concatenation/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2010/11/25/sql-server-concat-function-in-sql-server-sql-concatenation/</link>
	<description>Personal Notes of Pinal Dave</description>
	<lastBuildDate>Sat, 25 May 2013 15:33:52 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: johan max</title>
		<link>http://blog.sqlauthority.com/2010/11/25/sql-server-concat-function-in-sql-server-sql-concatenation/#comment-476014</link>
		<dc:creator><![CDATA[johan max]]></dc:creator>
		<pubDate>Wed, 15 May 2013 21:21:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10977#comment-476014</guid>
		<description><![CDATA[Dear every one,
I find that select @string = @string + columna +columnb from tabelx
will produce memory leak if the tablex is quite big. Is there any way to this ?]]></description>
		<content:encoded><![CDATA[<p>Dear every one,<br />
I find that select @string = @string + columna +columnb from tabelx<br />
will produce memory leak if the tablex is quite big. Is there any way to this ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: trytrtrytrytyt</title>
		<link>http://blog.sqlauthority.com/2010/11/25/sql-server-concat-function-in-sql-server-sql-concatenation/#comment-412768</link>
		<dc:creator><![CDATA[trytrtrytrytyt]]></dc:creator>
		<pubDate>Fri, 25 Jan 2013 09:58:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10977#comment-412768</guid>
		<description><![CDATA[just want to ask how to concatenate this one.

(‘Microsoft.Jet.OLEDB.4.0′, ‘Excel 8.0;Database= ‘ + @ExcelFile + ‘, ‘select * from [Sheet1$]‘) AS A;

Im’ getting errors]]></description>
		<content:encoded><![CDATA[<p>just want to ask how to concatenate this one.</p>
<p>(‘Microsoft.Jet.OLEDB.4.0′, ‘Excel 8.0;Database= ‘ + @ExcelFile + ‘, ‘select * from [Sheet1$]‘) AS A;</p>
<p>Im’ getting errors</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joel</title>
		<link>http://blog.sqlauthority.com/2010/11/25/sql-server-concat-function-in-sql-server-sql-concatenation/#comment-411632</link>
		<dc:creator><![CDATA[Joel]]></dc:creator>
		<pubDate>Wed, 23 Jan 2013 05:50:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10977#comment-411632</guid>
		<description><![CDATA[just want to ask how to concatenate this one.

(&#039;Microsoft.Jet.OLEDB.4.0&#039;, &#039;Excel 8.0;Database= &#039; + @ExcelFile + &#039;, &#039;select * from [Sheet1$]&#039;) AS A;

Im&#039; getting errors]]></description>
		<content:encoded><![CDATA[<p>just want to ask how to concatenate this one.</p>
<p>(&#8216;Microsoft.Jet.OLEDB.4.0&#8242;, &#8216;Excel 8.0;Database= &#8216; + @ExcelFile + &#8216;, &#8216;select * from [Sheet1$]&#8216;) AS A;</p>
<p>Im&#8217; getting errors</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sayali</title>
		<link>http://blog.sqlauthority.com/2010/11/25/sql-server-concat-function-in-sql-server-sql-concatenation/#comment-405974</link>
		<dc:creator><![CDATA[sayali]]></dc:creator>
		<pubDate>Thu, 10 Jan 2013 08:45:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10977#comment-405974</guid>
		<description><![CDATA[How to concatinate variable of datatype varchar and function getdate() while alter table query?]]></description>
		<content:encoded><![CDATA[<p>How to concatinate variable of datatype varchar and function getdate() while alter table query?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ramesh</title>
		<link>http://blog.sqlauthority.com/2010/11/25/sql-server-concat-function-in-sql-server-sql-concatenation/#comment-392933</link>
		<dc:creator><![CDATA[ramesh]]></dc:creator>
		<pubDate>Fri, 14 Dec 2012 05:07:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10977#comment-392933</guid>
		<description><![CDATA[Hi, following is the mysql query

DELETE FROM ATTRIBUTE_INSTANCE WHERE ATTRIBUTE_INSTANCE.ATTRIBUTE_NAME 
			IN ( SELECT CONCAT(ATTRIBUTE_TEMPLATE.TEMPLATE_ID,&#039;.&#039;,ATTRIBUTE_TEMPLATE.ATTRIBUTE_NAME) FROM 
			ATTRIBUTE_TEMPLATE, TEMP_ENTITY_TABLE WHERE 
			ATTRIBUTE_TEMPLATE.TEMPLATE_ID=TEMP_ENTITY_TABLE.ENTITY_ID);		
I want to convert it to sql server specific query. please help me

thanks]]></description>
		<content:encoded><![CDATA[<p>Hi, following is the mysql query</p>
<p>DELETE FROM ATTRIBUTE_INSTANCE WHERE ATTRIBUTE_INSTANCE.ATTRIBUTE_NAME<br />
			IN ( SELECT CONCAT(ATTRIBUTE_TEMPLATE.TEMPLATE_ID,&#8217;.',ATTRIBUTE_TEMPLATE.ATTRIBUTE_NAME) FROM<br />
			ATTRIBUTE_TEMPLATE, TEMP_ENTITY_TABLE WHERE<br />
			ATTRIBUTE_TEMPLATE.TEMPLATE_ID=TEMP_ENTITY_TABLE.ENTITY_ID);<br />
I want to convert it to sql server specific query. please help me</p>
<p>thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL SERVER &#8211; Concat Strings in SQL Server using T-SQL &#8211; SQL in Sixty Seconds #035 &#8211; Video &#171; SQL Server Journey with SQL Authority</title>
		<link>http://blog.sqlauthority.com/2010/11/25/sql-server-concat-function-in-sql-server-sql-concatenation/#comment-387006</link>
		<dc:creator><![CDATA[SQL SERVER &#8211; Concat Strings in SQL Server using T-SQL &#8211; SQL in Sixty Seconds #035 &#8211; Video &#171; SQL Server Journey with SQL Authority]]></dc:creator>
		<pubDate>Wed, 05 Dec 2012 01:32:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10977#comment-387006</guid>
		<description><![CDATA[[...] SQL SERVER – Concat Function in SQL Server – SQL Concatenation [...]]]></description>
		<content:encoded><![CDATA[<p>[...] SQL SERVER – Concat Function in SQL Server – SQL Concatenation [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Abhishek Chakladar</title>
		<link>http://blog.sqlauthority.com/2010/11/25/sql-server-concat-function-in-sql-server-sql-concatenation/#comment-371098</link>
		<dc:creator><![CDATA[Abhishek Chakladar]]></dc:creator>
		<pubDate>Thu, 08 Nov 2012 06:26:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10977#comment-371098</guid>
		<description><![CDATA[Hi guyes

please follow the following LOC of my above post

CHARINDEX(@sDelimiter,@sInputList,0) != 0

 the less than () has been encoded I guess by the site so that (!=) is not coming you can also use &quot;&quot;]]></description>
		<content:encoded><![CDATA[<p>Hi guyes</p>
<p>please follow the following LOC of my above post</p>
<p>CHARINDEX(@sDelimiter,@sInputList,0) != 0</p>
<p> the less than () has been encoded I guess by the site so that (!=) is not coming you can also use &#8220;&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Abhishek Chakladar</title>
		<link>http://blog.sqlauthority.com/2010/11/25/sql-server-concat-function-in-sql-server-sql-concatenation/#comment-371093</link>
		<dc:creator><![CDATA[Abhishek Chakladar]]></dc:creator>
		<pubDate>Thu, 08 Nov 2012 06:20:07 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10977#comment-371093</guid>
		<description><![CDATA[The following function can be a good example that I wrote

ALTER FUNCTION [dbo].[fnConcatString]
(
	@sInputList VARCHAR(8000) -- List of delimited items
,	@sDelimiter VARCHAR(8000) = &#039;,&#039; --delimiter that separates items
) 
RETURNS VARCHAR(4000) --TABLE (item VARCHAR(8000))
BEGIN
	DECLARE @sItem VARCHAR(8000)
	DECLARE @FirstString VARCHAR(100)=&#039;&#039;
	DECLARE @SecondString VARCHAR(100)
	DECLARE @Result VARCHAR(100) 
	set @sInputList = dbo.udf_TitleCase(@sInputList)

WHILE CHARINDEX(@sDelimiter,@sInputList,0)0
BEGIN
		SELECT @sItem = RTRIM(LTRIM(SUBSTRING(@sInputList,1,CHARINDEX(@sDelimiter,@sInputList,0)-1))),
		   @sInputList = RTRIM(LTRIM(SUBSTRING(@sInputList,CHARINDEX(@sDelimiter,@sInputList,0)+LEN(@sDelimiter),LEN(@sInputList))))
		   
	IF LEN(@sItem) &gt; 0
	begin
		set @FirstString =@FirstString + @sItem
	end
END
	IF LEN(@sInputList) &gt; 0
	begin
		SET @SecondString = @sInputList -- Put the last item in
	end
	Set @Result = @FirstString+&#039;&#039;+@SecondString
	RETURN @Result
END]]></description>
		<content:encoded><![CDATA[<p>The following function can be a good example that I wrote</p>
<p>ALTER FUNCTION [dbo].[fnConcatString]<br />
(<br />
	@sInputList VARCHAR(8000) &#8212; List of delimited items<br />
,	@sDelimiter VARCHAR(8000) = &#8216;,&#8217; &#8211;delimiter that separates items<br />
)<br />
RETURNS VARCHAR(4000) &#8211;TABLE (item VARCHAR(8000))<br />
BEGIN<br />
	DECLARE @sItem VARCHAR(8000)<br />
	DECLARE @FirstString VARCHAR(100)=&#8221;<br />
	DECLARE @SecondString VARCHAR(100)<br />
	DECLARE @Result VARCHAR(100)<br />
	set @sInputList = dbo.udf_TitleCase(@sInputList)</p>
<p>WHILE CHARINDEX(@sDelimiter,@sInputList,0)0<br />
BEGIN<br />
		SELECT @sItem = RTRIM(LTRIM(SUBSTRING(@sInputList,1,CHARINDEX(@sDelimiter,@sInputList,0)-1))),<br />
		   @sInputList = RTRIM(LTRIM(SUBSTRING(@sInputList,CHARINDEX(@sDelimiter,@sInputList,0)+LEN(@sDelimiter),LEN(@sInputList))))</p>
<p>	IF LEN(@sItem) &gt; 0<br />
	begin<br />
		set @FirstString =@FirstString + @sItem<br />
	end<br />
END<br />
	IF LEN(@sInputList) &gt; 0<br />
	begin<br />
		SET @SecondString = @sInputList &#8212; Put the last item in<br />
	end<br />
	Set @Result = @FirstString+&#8221;+@SecondString<br />
	RETURN @Result<br />
END</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TZ</title>
		<link>http://blog.sqlauthority.com/2010/11/25/sql-server-concat-function-in-sql-server-sql-concatenation/#comment-369752</link>
		<dc:creator><![CDATA[TZ]]></dc:creator>
		<pubDate>Mon, 05 Nov 2012 17:17:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10977#comment-369752</guid>
		<description><![CDATA[I need to use something like the concat function in a subquery. The result set is a variable number of strings that should be concatenate to a single string. Because of the dynamic number of rows  &#039;+&#039; doesn&#039;t work. So I am wondering why concat does not work although it is a documented function in Transact- SQL. Can anybody help?]]></description>
		<content:encoded><![CDATA[<p>I need to use something like the concat function in a subquery. The result set is a variable number of strings that should be concatenate to a single string. Because of the dynamic number of rows  &#8216;+&#8217; doesn&#8217;t work. So I am wondering why concat does not work although it is a documented function in Transact- SQL. Can anybody help?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jay</title>
		<link>http://blog.sqlauthority.com/2010/11/25/sql-server-concat-function-in-sql-server-sql-concatenation/#comment-331000</link>
		<dc:creator><![CDATA[Jay]]></dc:creator>
		<pubDate>Wed, 15 Aug 2012 18:30:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10977#comment-331000</guid>
		<description><![CDATA[Thanks buddy, I really appreciate the time you take to post these tips.]]></description>
		<content:encoded><![CDATA[<p>Thanks buddy, I really appreciate the time you take to post these tips.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zak</title>
		<link>http://blog.sqlauthority.com/2010/11/25/sql-server-concat-function-in-sql-server-sql-concatenation/#comment-320157</link>
		<dc:creator><![CDATA[Zak]]></dc:creator>
		<pubDate>Sat, 28 Jul 2012 05:58:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10977#comment-320157</guid>
		<description><![CDATA[OK also, not to come across like a complete idiot, I must point out that I later realized that what you were saying above was that Concat() does not exist in 2008 R2 and that the &#039;+&#039; operator is the proper method. Regardless though, my question remains valid how one can properly (reliably) use &#039;+&#039; to concatenate various entities with each other, especially a column&#039;s current value for that record, dynamically. Thanks again]]></description>
		<content:encoded><![CDATA[<p>OK also, not to come across like a complete idiot, I must point out that I later realized that what you were saying above was that Concat() does not exist in 2008 R2 and that the &#8216;+&#8217; operator is the proper method. Regardless though, my question remains valid how one can properly (reliably) use &#8216;+&#8217; to concatenate various entities with each other, especially a column&#8217;s current value for that record, dynamically. Thanks again</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zak</title>
		<link>http://blog.sqlauthority.com/2010/11/25/sql-server-concat-function-in-sql-server-sql-concatenation/#comment-320143</link>
		<dc:creator><![CDATA[Zak]]></dc:creator>
		<pubDate>Sat, 28 Jul 2012 05:27:37 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10977#comment-320143</guid>
		<description><![CDATA[Maybe cast the varchar as type text somehow?

Anyway I could theoretically do a workaround where I handle in CF9 what SQL is giving me trouble with, but that&#039;s a seriously huge workaround, cos:

As the solution above provides, I can update many rows at once by doing it &quot;where NotesID in (&quot; &amp; (csv list of IDs) &amp; &quot;)&quot;. But the meanderingly long workaround would be, select each record, append the value in CF, then update that one record; it&#039;d forbid the multiple updates, and hence be a lot more work. I&#039;d like a simple elegant solution if possible, if SQL has one that is. Thanks for your time but an additional bonus thanks if anyone happens to know it:)]]></description>
		<content:encoded><![CDATA[<p>Maybe cast the varchar as type text somehow?</p>
<p>Anyway I could theoretically do a workaround where I handle in CF9 what SQL is giving me trouble with, but that&#8217;s a seriously huge workaround, cos:</p>
<p>As the solution above provides, I can update many rows at once by doing it &#8220;where NotesID in (&#8221; &amp; (csv list of IDs) &amp; &#8220;)&#8221;. But the meanderingly long workaround would be, select each record, append the value in CF, then update that one record; it&#8217;d forbid the multiple updates, and hence be a lot more work. I&#8217;d like a simple elegant solution if possible, if SQL has one that is. Thanks for your time but an additional bonus thanks if anyone happens to know it:)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zak</title>
		<link>http://blog.sqlauthority.com/2010/11/25/sql-server-concat-function-in-sql-server-sql-concatenation/#comment-320112</link>
		<dc:creator><![CDATA[Zak]]></dc:creator>
		<pubDate>Sat, 28 Jul 2012 04:29:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10977#comment-320112</guid>
		<description><![CDATA[hm, what if neither &#039;+&#039; nor &#039;Concat()&#039; are supported by SQL Server 2008 R2 using CF9? well, let me correct myself. &#039;+&#039; is officially supported, however it can&#039;t do the job because I&#039;m trying to concat a text col with some user-updated content, and so the types don&#039;t line up. well, so says the error msg returned from SQL. See below for exactly what happens.

Anyone know how to get around this?

When I do THIS:

update tblNotes set sNotesAppend = sNotesAppend + &#039;(user-updated content)&#039;

I got the error:
ErrorCode = &quot;402&quot;
Message = &quot;[Macromedia][SQLServer JDBC Driver][SQLServer]The data types text and varchar are incompatible in the add operator.&quot;
SQLState = &quot;HY000&quot;

So I turned to Googs which led me here and I see you mention Concat(), so I tried the same. However when I do it, when I do THIS instead:

update tblNotes set sNotesAppend = Concat(sNotesAppend, Char(13), Char(10), Char(13), Char(10), GetDate(), Char(13), Char(10), &#039;(user-updated content)&#039;)

I get the error:
ErrorCode = &quot;195&quot;
Message = &quot;[Macromedia][SQLServer JDBC Driver][SQLServer]&#039;Concat&#039; is not a recognized built-in function name.&quot;
SQLState = &quot;HY000&quot;

Fantastic! If I keep going this way I can waste the whole day instead of just parts of it! AWESOME!~]]></description>
		<content:encoded><![CDATA[<p>hm, what if neither &#8216;+&#8217; nor &#8216;Concat()&#8217; are supported by SQL Server 2008 R2 using CF9? well, let me correct myself. &#8216;+&#8217; is officially supported, however it can&#8217;t do the job because I&#8217;m trying to concat a text col with some user-updated content, and so the types don&#8217;t line up. well, so says the error msg returned from SQL. See below for exactly what happens.</p>
<p>Anyone know how to get around this?</p>
<p>When I do THIS:</p>
<p>update tblNotes set sNotesAppend = sNotesAppend + &#8216;(user-updated content)&#8217;</p>
<p>I got the error:<br />
ErrorCode = &#8220;402&#8243;<br />
Message = &#8220;[Macromedia][SQLServer JDBC Driver][SQLServer]The data types text and varchar are incompatible in the add operator.&#8221;<br />
SQLState = &#8220;HY000&#8243;</p>
<p>So I turned to Googs which led me here and I see you mention Concat(), so I tried the same. However when I do it, when I do THIS instead:</p>
<p>update tblNotes set sNotesAppend = Concat(sNotesAppend, Char(13), Char(10), Char(13), Char(10), GetDate(), Char(13), Char(10), &#8216;(user-updated content)&#8217;)</p>
<p>I get the error:<br />
ErrorCode = &#8220;195&#8243;<br />
Message = &#8220;[Macromedia][SQLServer JDBC Driver][SQLServer]&#8216;Concat&#8217; is not a recognized built-in function name.&#8221;<br />
SQLState = &#8220;HY000&#8243;</p>
<p>Fantastic! If I keep going this way I can waste the whole day instead of just parts of it! AWESOME!~</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Janaki</title>
		<link>http://blog.sqlauthority.com/2010/11/25/sql-server-concat-function-in-sql-server-sql-concatenation/#comment-318702</link>
		<dc:creator><![CDATA[Janaki]]></dc:creator>
		<pubDate>Wed, 25 Jul 2012 04:12:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10977#comment-318702</guid>
		<description><![CDATA[Of course..Sometime we break head for simple queries..:) But they help you learn lot coz u keep exploring..:)]]></description>
		<content:encoded><![CDATA[<p>Of course..Sometime we break head for simple queries..:) But they help you learn lot coz u keep exploring..:)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: yokomoko</title>
		<link>http://blog.sqlauthority.com/2010/11/25/sql-server-concat-function-in-sql-server-sql-concatenation/#comment-288513</link>
		<dc:creator><![CDATA[yokomoko]]></dc:creator>
		<pubDate>Fri, 25 May 2012 12:15:57 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10977#comment-288513</guid>
		<description><![CDATA[When doing yours and either column is null it just shows null for me, so I did:

Select Case When (ForeName + &#039; &#039; + SurName) is null then (Select Case when (ForeName) is null then (SurName) else (ForeName) end) else (ForeName + &#039; &#039; + SurName) end as Fullname from customers]]></description>
		<content:encoded><![CDATA[<p>When doing yours and either column is null it just shows null for me, so I did:</p>
<p>Select Case When (ForeName + &#8216; &#8216; + SurName) is null then (Select Case when (ForeName) is null then (SurName) else (ForeName) end) else (ForeName + &#8216; &#8216; + SurName) end as Fullname from customers</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2010/11/25/sql-server-concat-function-in-sql-server-sql-concatenation/#comment-182968</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Mon, 24 Oct 2011 16:56:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10977#comment-182968</guid>
		<description><![CDATA[Use this code

select cast((size*8) as varchar(10))+&#039; MB&#039; as FileSize from sys.database_files]]></description>
		<content:encoded><![CDATA[<p>Use this code</p>
<p>select cast((size*8) as varchar(10))+&#8217; MB&#8217; as FileSize from sys.database_files</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vinay (@vinayprasadv)</title>
		<link>http://blog.sqlauthority.com/2010/11/25/sql-server-concat-function-in-sql-server-sql-concatenation/#comment-181148</link>
		<dc:creator><![CDATA[vinay (@vinayprasadv)]]></dc:creator>
		<pubDate>Thu, 20 Oct 2011 10:36:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10977#comment-181148</guid>
		<description><![CDATA[Hi Pinal, how we can concatenate number and string?

Example: If i want to print as filesize and MB next to file size like 120 MB for the below query.. how to do that?

select (size*8) as FileSize from sys.database_files]]></description>
		<content:encoded><![CDATA[<p>Hi Pinal, how we can concatenate number and string?</p>
<p>Example: If i want to print as filesize and MB next to file size like 120 MB for the below query.. how to do that?</p>
<p>select (size*8) as FileSize from sys.database_files</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Praveen</title>
		<link>http://blog.sqlauthority.com/2010/11/25/sql-server-concat-function-in-sql-server-sql-concatenation/#comment-103246</link>
		<dc:creator><![CDATA[Praveen]]></dc:creator>
		<pubDate>Wed, 01 Dec 2010 05:11:08 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10977#comment-103246</guid>
		<description><![CDATA[Suppose, we want to concatenate output returned in one column by query, what would be the best way?

We have been using a CLR for such concatenation.

Ex: 
SELECT master.dbo.CONCATENATE(name) 
   FROM master.sys.tables
---------
spt_fallback_db,spt_fallback_dev,spt_fallback_usg,spt_monitor,spt_values,MSreplication_options]]></description>
		<content:encoded><![CDATA[<p>Suppose, we want to concatenate output returned in one column by query, what would be the best way?</p>
<p>We have been using a CLR for such concatenation.</p>
<p>Ex:<br />
SELECT master.dbo.CONCATENATE(name)<br />
   FROM master.sys.tables<br />
&#8212;&#8212;&#8212;<br />
spt_fallback_db,spt_fallback_dev,spt_fallback_usg,spt_monitor,spt_values,MSreplication_options</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pinaldave</title>
		<link>http://blog.sqlauthority.com/2010/11/25/sql-server-concat-function-in-sql-server-sql-concatenation/#comment-103242</link>
		<dc:creator><![CDATA[pinaldave]]></dc:creator>
		<pubDate>Wed, 01 Dec 2010 04:44:15 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10977#comment-103242</guid>
		<description><![CDATA[This is indeed interesting story sir!

Thank you for sharing!]]></description>
		<content:encoded><![CDATA[<p>This is indeed interesting story sir!</p>
<p>Thank you for sharing!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe Celko</title>
		<link>http://blog.sqlauthority.com/2010/11/25/sql-server-concat-function-in-sql-server-sql-concatenation/#comment-103138</link>
		<dc:creator><![CDATA[Joe Celko]]></dc:creator>
		<pubDate>Tue, 30 Nov 2010 17:24:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10977#comment-103138</guid>
		<description><![CDATA[A funny story on concatenation in ANSI/ISO SQL. The correct syntax is &#124;&#124; and not +. Overloading the + has been a problem for decades in T-SQL.

The &quot;pipe&quot; symbol was submitted to ANSI X2H2 by Phil Shaw of IBM. Phil had been on the PL/I development team and borrowed this syntax.  

When we asked him if PL/I had any other good ideas we should look at for SQL, he went into a rant about how PL/I was the worst language ever designed. :)]]></description>
		<content:encoded><![CDATA[<p>A funny story on concatenation in ANSI/ISO SQL. The correct syntax is || and not +. Overloading the + has been a problem for decades in T-SQL.</p>
<p>The &#8220;pipe&#8221; symbol was submitted to ANSI X2H2 by Phil Shaw of IBM. Phil had been on the PL/I development team and borrowed this syntax.  </p>
<p>When we asked him if PL/I had any other good ideas we should look at for SQL, he went into a rant about how PL/I was the worst language ever designed. :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jardel</title>
		<link>http://blog.sqlauthority.com/2010/11/25/sql-server-concat-function-in-sql-server-sql-concatenation/#comment-103089</link>
		<dc:creator><![CDATA[Jardel]]></dc:creator>
		<pubDate>Tue, 30 Nov 2010 13:31:02 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10977#comment-103089</guid>
		<description><![CDATA[Sorry  pinaldave, I writed in portuguese...

The question is that I need pass a param to set the number of the company to table, e.g:
(company = 01)


create function dbo.fcn_consultaTitulos(@companyvarchar(2))
returns varchar(20)
as begin
declare @resultado varchar(20);
if(@result=&#039;valor&#039;)
  begin		
	set @resultado = 	
	(SELECT top 1 E1_VALOR
	FROM SE1+{@company}+0 SE1 
        WHERE ......]]></description>
		<content:encoded><![CDATA[<p>Sorry  pinaldave, I writed in portuguese&#8230;</p>
<p>The question is that I need pass a param to set the number of the company to table, e.g:<br />
(company = 01)</p>
<p>create function dbo.fcn_consultaTitulos(@companyvarchar(2))<br />
returns varchar(20)<br />
as begin<br />
declare @resultado varchar(20);<br />
if(@result=&#8217;valor&#8217;)<br />
  begin<br />
	set @resultado =<br />
	(SELECT top 1 E1_VALOR<br />
	FROM SE1+{@company}+0 SE1<br />
        WHERE &#8230;&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jardel</title>
		<link>http://blog.sqlauthority.com/2010/11/25/sql-server-concat-function-in-sql-server-sql-concatenation/#comment-103087</link>
		<dc:creator><![CDATA[Jardel]]></dc:creator>
		<pubDate>Tue, 30 Nov 2010 13:19:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10977#comment-103087</guid>
		<description><![CDATA[Estou fazendo uma função e esbarrei no problema de não conseguir concatenar no from ou nas colunas..... Alguém pode me ajudar? Nas linhas destacadas estão o que quero fazer...

 

alter function fcn_consultaTitulos(@result varchar(15), @nf varchar(9), @serie varchar(2), @emissao varchar(15), @cliLoja varchar(20), @parcela char(1), @empresa varchar(2))
returns varchar(20)

as begin

declare @resultado varchar(20);

declare @tabela varchar(10);

set @tabela = &#039;SE1&#039;+@empresa+&#039;0&#039;;

 

if(@result=&#039;valor&#039;)

  begin 

set @resultado = 

(SELECT top 1 E1_VALOR

FROM @tabela SE1 

WHERE SE1.D_E_L_E_T_  &#039;*&#039; AND SE1.E1_FILIAL=&#039;00&#039; 

AND SE1.E1_NUM =@nf 

AND SE1.E1_SERIE =@serie 

AND SE1.E1_EMISSAO=@emissao 

AND SE1.E1_CLIENTE+SE1.E1_LOJA =@cliLoja

AND E1_PARCELA = @parcela

ORDER BY SE1.E1_NUM, SE1.E1_SERIE,SE1.E1_PARCELA);

  end

else

if(@result=&#039;dataVenc&#039;)

begin

set @resultado = 

(SELECT top 1 E1_VENCREA

FROM SE1+@empresa+0 SE1 

WHERE SE1.D_E_L_E_T_  &#039;*&#039; AND SE1.E1_FILIAL=&#039;00&#039; 

AND SE1.E1_NUM =@nf 

AND SE1.E1_SERIE =@serie 

AND SE1.E1_EMISSAO=@emissao 

AND SE1.E1_CLIENTE+SE1.E1_LOJA =@cliLoja

AND E1_PARCELA = @parcela

ORDER BY SE1.E1_NUM, SE1.E1_SERIE,SE1.E1_PARCELA);

end

return @resultado

end





Desde já agradeço.
Jardel]]></description>
		<content:encoded><![CDATA[<p>Estou fazendo uma função e esbarrei no problema de não conseguir concatenar no from ou nas colunas&#8230;.. Alguém pode me ajudar? Nas linhas destacadas estão o que quero fazer&#8230;</p>
<p>alter function fcn_consultaTitulos(@result varchar(15), @nf varchar(9), @serie varchar(2), @emissao varchar(15), @cliLoja varchar(20), @parcela char(1), @empresa varchar(2))<br />
returns varchar(20)</p>
<p>as begin</p>
<p>declare @resultado varchar(20);</p>
<p>declare @tabela varchar(10);</p>
<p>set @tabela = &#8216;SE1&#8242;+@empresa+&#8217;0&#8242;;</p>
<p>if(@result=&#8217;valor&#8217;)</p>
<p>  begin </p>
<p>set @resultado = </p>
<p>(SELECT top 1 E1_VALOR</p>
<p>FROM @tabela SE1 </p>
<p>WHERE SE1.D_E_L_E_T_  &#8216;*&#8217; AND SE1.E1_FILIAL=&#8217;00&#8242; </p>
<p>AND SE1.E1_NUM =@nf </p>
<p>AND SE1.E1_SERIE =@serie </p>
<p>AND SE1.E1_EMISSAO=@emissao </p>
<p>AND SE1.E1_CLIENTE+SE1.E1_LOJA =@cliLoja</p>
<p>AND E1_PARCELA = @parcela</p>
<p>ORDER BY SE1.E1_NUM, SE1.E1_SERIE,SE1.E1_PARCELA);</p>
<p>  end</p>
<p>else</p>
<p>if(@result=&#8217;dataVenc&#8217;)</p>
<p>begin</p>
<p>set @resultado = </p>
<p>(SELECT top 1 E1_VENCREA</p>
<p>FROM SE1+@empresa+0 SE1 </p>
<p>WHERE SE1.D_E_L_E_T_  &#8216;*&#8217; AND SE1.E1_FILIAL=&#8217;00&#8242; </p>
<p>AND SE1.E1_NUM =@nf </p>
<p>AND SE1.E1_SERIE =@serie </p>
<p>AND SE1.E1_EMISSAO=@emissao </p>
<p>AND SE1.E1_CLIENTE+SE1.E1_LOJA =@cliLoja</p>
<p>AND E1_PARCELA = @parcela</p>
<p>ORDER BY SE1.E1_NUM, SE1.E1_SERIE,SE1.E1_PARCELA);</p>
<p>end</p>
<p>return @resultado</p>
<p>end</p>
<p>Desde já agradeço.<br />
Jardel</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ramdas</title>
		<link>http://blog.sqlauthority.com/2010/11/25/sql-server-concat-function-in-sql-server-sql-concatenation/#comment-102329</link>
		<dc:creator><![CDATA[Ramdas]]></dc:creator>
		<pubDate>Fri, 26 Nov 2010 16:17:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10977#comment-102329</guid>
		<description><![CDATA[Hi,
I have been using the &#039;+&#039; operator for a long time in SQL Server for concatenation purposes. One of recent comparisions i had to do was for the CONNECT BY clause available in ORACLE. I used CTE&#039;s to get a similar effect as the CONNECT BY.]]></description>
		<content:encoded><![CDATA[<p>Hi,<br />
I have been using the &#8216;+&#8217; operator for a long time in SQL Server for concatenation purposes. One of recent comparisions i had to do was for the CONNECT BY clause available in ORACLE. I used CTE&#8217;s to get a similar effect as the CONNECT BY.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sumit Bansal</title>
		<link>http://blog.sqlauthority.com/2010/11/25/sql-server-concat-function-in-sql-server-sql-concatenation/#comment-102243</link>
		<dc:creator><![CDATA[Sumit Bansal]]></dc:creator>
		<pubDate>Fri, 26 Nov 2010 06:01:02 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10977#comment-102243</guid>
		<description><![CDATA[I know this function but I was talking about built in split fucntion]]></description>
		<content:encoded><![CDATA[<p>I know this function but I was talking about built in split fucntion</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Shay</title>
		<link>http://blog.sqlauthority.com/2010/11/25/sql-server-concat-function-in-sql-server-sql-concatenation/#comment-102052</link>
		<dc:creator><![CDATA[Mark Shay]]></dc:creator>
		<pubDate>Thu, 25 Nov 2010 16:27:02 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=10977#comment-102052</guid>
		<description><![CDATA[I use method 3 all the time.]]></description>
		<content:encoded><![CDATA[<p>I use method 3 all the time.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
