02-11-20, 09:23 PM
(آخر تعديل لهذه المشاركة : 02-11-20, 09:23 PM {2} بواسطة asemshahen5.)
اذا كنت تريد استخدامه لعملية تعديل سجلات الجدول فهذا استعلام :
ملاحظة :
تستطيع استبدال الجدول الوهمي بجدول حقيقي بقاعدة البيانات و هذا يختصر الكود بشكل كبير و لا يبقى منه الا القليل مع اطيب امنياتي لك بالتوفيق و النجاح انشاء الله .
PHP كود :
DECLARE @x int;
set @x= (Select ROW_NUMBER() OVER(ORDER BY (SELECT 1)))
DECLARE @TBooksNames TABLE (id int, ChrCol nvarchar(255));
insert into @TBooksNames(id,ChrCol)values(@x,(CHAR(243)))
set @x += 1
insert into @TBooksNames(id,ChrCol)values(@x,(CHAR(240)))
set @x += 1
insert into @TBooksNames(id,ChrCol)values(@x,(CHAR(245)))
set @x += 1
insert into @TBooksNames(id,ChrCol)values(@x,(CHAR(246)))
set @x += 1
insert into @TBooksNames(id,ChrCol)values(@x,(CHAR(242)))
set @x += 1
insert into @TBooksNames(id,ChrCol)values(@x,(CHAR(241)))
set @x += 1
insert into @TBooksNames(id,ChrCol)values(@x,(CHAR(248)))
set @x += 1
insert into @TBooksNames(id,ChrCol)values(@x,(CHAR(250)))
set @x += 1
insert into @TBooksNames(id,ChrCol)values(@x,'ال')
DECLARE @End int,@CharXT nvarchar(255);
set @End =(Select count(*) from @TBooksNames);
set @x=1;
WHILE @x < @End
begin
set @CharXT=(select ChrCol from @TBooksNames where id=@x);
update @TBooksNames set ChrCol=REPLACE(ChrCol ,@CharXT ,'X') where id=@x;
set @x +=1;
end;
Select * from @TBooksNames;
ملاحظة :
تستطيع استبدال الجدول الوهمي بجدول حقيقي بقاعدة البيانات و هذا يختصر الكود بشكل كبير و لا يبقى منه الا القليل مع اطيب امنياتي لك بالتوفيق و النجاح انشاء الله .
سبحان الله وبحمده سبحان الله العظيم و الحمد لله ولا اله الا الله والله اكبر
