|
|
Using This sql Function We can Use String In sql Function
DROP FUNCTION dbo.fnFormatString GO CREATE FUNCTION dbo.fnFormatString(@format varchar(6000), @arg1 sql_variant, @arg2 sql_variant='', @arg3 sql_variant='') RETURNS varchar(8000) AS BEGIN RETURN REPLACE( REPLACE( REPLACE(@format, '{0}', CAST(@arg1 as varchar(400))), '{1}', CAST(@arg2 as varchar(400))), '{2}', CAST(@arg3 as varchar(400))) END GO PRINT dbo.fnFormatString('This {0} of works like {1} in that langauge {2}' , 'sorta' , 'string.Format()' , 'C#')
| | Responses | |
No response found. Be the first to respond this post
| |
| You must Sign In To post reply |
| | | | | | Find More code samples in C#, ASP.Net, Vb.Net and more Here |
|
|