Sql String Function

  • October 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Sql String Function as PDF for free.

More details

  • Words: 110
  • Pages: 1
--string manipulation function select select select select select select select select select select select select select select select select select select select

left('srinivasan',3) as test right('srinivasan',5) as test ltrim(' srinivasan ') rtrim(' srinivasan ') substring('srinivasan',6,5) reverse('srini') charindex('@','[email protected]') patindex('%@%','[email protected]') replace('srinivasan','vas','sri') len('srinivasan') upper('srini') lower('srini') replicate('srini',5) space(5)+'srini' + space(5) + 'vasan' ascii('a') 'myoutput' + char(13) + 'anotheroutput' str(1.2546, 6, 3) soundex('srinivasan') difference('sri','sri')

declare @var int select @var=12345 select cast(@var as varchar(20)) declare @var int select @var=12345 select convert(varchar(20),@var) create table #temp (id_column int null) declare @column_name varchar(50), @sql_string varchar(200) select @column_name = quotename('invalid column name') select @sql_string = 'alter table #temp add ' + @column_name + 'varchar(50)' exec (@sql_string) select * from #temp

Related Documents

Sql String Function
October 2019 1
String Function
May 2020 9
String
June 2020 26
Function
December 2019 67
Function
November 2019 54