如何在SQL游标中声明FK,uniqueidentifier

时间:2014-06-11 11:16:01

标签: sql-server-2008 cursor uniqueidentifier declare

我不确定如何在sql游标中声明uniqueidentifier。现在我将它定义为@activity_id的nvarchar(50),但我担心这是不正确的。

declare @activity_id nvarchar (50)
declare @fullname nvarchar(200)


declare cur cursor for
select c.activityid, d.fullname from ActivityPointerBase as a
join PhoneCallBase as b on b.ActivityId = a.ActivityId
join ActivityPartyBase as c on c.ActivityId = a.ActivityId
join SystemUserBase as d on d.SystemUserId = c.PartyId
where b.new_Source = '100000000' and c.ParticipationTypeMask = '1'
order by d.FullName ASC

1 个答案:

答案 0 :(得分:0)

永不心。我运行它并且它工作,我担心uniqueidentifier必须首先转换,我猜不是。谢谢!