SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
CREATE TABLE tabl_1( Makat nvarchar(22) NOT NULL,Description nvarchar(59) NOT NULL); INSERT INTO tabl_1 (Makat, Description) VALUES(20202028 ,'BAL LONAHTE'); INSERT INTO tabl_1 (Makat, Description) VALUES(40-0015 ,'%5 redwop animula no muidohR'); INSERT INTO tabl_1 (Makat, Description) VALUES(40-1010 ,'RBK-EDIMORB MUISSATOP'); INSERT INTO tabl_1 (Makat, Description) VALUES(2000042 ,'L1-RA ENEULOT - פיה רחבה'); INSERT INTO tabl_1 (Makat, Description) VALUES(40-1100 ,'slatsyrC enotaktooN larutaN'); INSERT INTO tabl_1 (Makat, Description) VALUES(40-0378 ,'CCB מנידוף לפלש'); INSERT INTO tabl_1 (Makat, Description) VALUES('3PBDMSBCC-0402' ,'LOB לנידוף XEH/FHT'); SELECT* FROM dbo.tabl_1 -------------------- с этой преременной в низу нужно создать функцию и использовать для замены столбца Description----- declare @NAME VARCHAR(300) set @NAME = 'טולואן מטיפול RLTC/BMA' DECLARE @POS INT DECLARE @HebrewWord varchar(200) DECLARE @EnglishWord Varchar(200) DECLARE @NewName Varchar(200) DECLARE @Found int -- initialazation set @HebrewWord = '' set @EnglishWord = '' set @Found = 0 set @NewName = '' set @NAME = ltrim(Rtrim(@NAME)) SELECT @POS = 1 WHILE @POS <= LEN(@NAME) --2 BEGIN if (ASCII(SUBSTRING(@NAME,@POS,1)) <> 32) begin IF (ASCII(SUBSTRING(@NAME,@POS,1)) < 224) begin SELECT @NAME = STUFF(@NAME, @POS, 1 , CHAR(ASCII(SUBSTRING(@NAME,@POS,1)))) set @EnglishWord = @EnglishWord + SUBSTRING(@NAME,@POS,1) set @Found = 0 --set @HebrewWord = '' --end if end else begin set @HebrewWord = @HebrewWord + SUBSTRING(@NAME,@POS,1) set @Found = 1 --set @EnglishWord = '' --end else end set @NewName = reverse(@EnglishWord) + ' ' + @HebrewWord IF SUBSTRING(@NAME,@POS,1)= '''' begin SELECT @NAME = STUFF(@NAME, @POS, 1 , '`') --end if end --end if (ASCII(SUBSTRING(@NAME,@POS,1)) <> 32) end else begin set @EnglishWord = @EnglishWord + ' ' set @HebrewWord = @HebrewWord + ' ' --end else end SELECT @POS = @POS + 1 --end while @POS <= LEN(@NAME) END select (ltrim(rtrim(@NewName))),@NewName --REVERSE (@HebrewWord) +@EnglishWord

Stuck with a problem? Got Error? Ask ChatGPT!

Copy Clear