Substring in SQL :
update [DB_Staging].[dbo].[LedgerJournalTrans]
set BIT_LEDGERDIMENSION = SUBSTRING(BIT_LEDGERDIMENSION, 1, LEN(BIT_LEDGERDIMENSION)-2)
where BIT_LEDGERDIMENSION like '%M1'
SELECT name, SUBSTRING(name, 1, 1) AS Initial ,
SUBSTRING(name, 3, 2) AS ThirdAndFourthCharacters
FROM sys.databases
WHERE database_id < 5;
update [DB_Staging].[dbo].[LedgerJournalTrans]
set BIT_LEDGERDIMENSION = SUBSTRING(BIT_LEDGERDIMENSION, 1, LEN(BIT_LEDGERDIMENSION)-2)
where BIT_LEDGERDIMENSION like '%M1'
SELECT name, SUBSTRING(name, 1, 1) AS Initial ,
SUBSTRING(name, 3, 2) AS ThirdAndFourthCharacters
FROM sys.databases
WHERE database_id < 5;
0 comments:
Post a Comment