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)
 Sql Function Like String.format
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

chiragvm
Yak Posting Veteran

India
63 Posts

Posted - 07/02/2013 :  09:54:16  Show Profile  Reply with Quote
Hi to all

is it any ready made function in sql (string.format in c#)
so we can use easily concate strings in select query insted of using (+)

-------------
Chirag
India
Sr. Sw.Engineer

James K
Flowing Fount of Yak Knowledge

3724 Posts

Posted - 07/02/2013 :  09:57:19  Show Profile  Reply with Quote
quote:
Originally posted by chiragvm

Hi to all

is it any ready made function in sql (string.format in c#)
so we can use easily concate strings in select query insted of using (+)

-------------
Chirag
India
Sr. Sw.Engineer


No, SQL Server does not have an equivalent. There is a FORMAT function in SQL 2012, but that is not equivalent to the string.format in C#. http://msdn.microsoft.com/en-us/library/hh213505.aspx

But there is a CONCAT function, which is as close as you can get, but still not as flexible as String.format: http://msdn.microsoft.com/en-us/library/hh231515.aspx

Edited by - James K on 07/02/2013 09:59:39
Go to Top of Page

chiragvm
Yak Posting Veteran

India
63 Posts

Posted - 07/03/2013 :  06:22:11  Show Profile  Reply with Quote
thanks a lot James for giving this clarity about my question

-------------
Chirag
India
Sr. Sw.Engineer

Edited by - chiragvm on 07/03/2013 06:23:54
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.05 seconds. Powered By: Snitz Forums 2000