Ancak bu tür videoları sisteminizde göstermek için SQL bilgimizi konuşturabilir ve aşağıdaki komutu Host > SQL Penceresi sayfasından çalıştırabiliriz.
declare
@itemid
int
declare
@videopath nvarchar(200)
DECLARE
mycursor
CURSOR
FOR
select
ItemId,VideoPath
from
{databaseOwner}{objectQualifier}UVG_Video
where
charindex(
'.youtube.'
,
lower
(VideoPath)) > 1
order
by
itemid
OPEN
mycursor
FETCH
NEXT
FROM
mycursor
INTO
@itemid, @videopath
WHILE @@FETCH_STATUS = 0
BEGIN
declare
@videoId nvarchar(11)
declare
@embedcode nvarchar(2000)
select
@videoid=
substring
(@videopath, charindex(
'?v='
,@videopath)+3, 11)
select
@embedcode =
'<div><object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/'
+ @videoid +
'" /><param name="wmode" value="transparent" /><param name="flashVars" value="autoplay=1" /><embed src="http://www.youtube.com/v/'
+ @videoid +
'" type="application/x-shockwave-flash" width="425" height="355" wmode="transparent" flashVars="autoplay=1"></embed></object></div>'
update
{databaseOwner}{objectQualifier}UVG_Video
set
VideoPath =
null
, EmbedCode = @embedcode
where
ItemId = @ItemId
PRINT
cast
(@ItemId
as
varchar
(10)) +
' - '
+ @videoid +
' - '
+ @embedcode
FETCH
NEXT
FROM
mycursor
INTO
@itemid, @videopath
END
CLOSE
mycursor
DEALLOCATE
mycursor