【发布时间】:2014-06-11 11:16:01
【问题描述】:
我不确定如何在 sql 游标中声明唯一标识符。现在我将它定义为 @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
【问题讨论】:
-
没关系。我运行它并且它工作,我担心唯一标识符必须先转换,我猜不是。谢谢!
标签: sql-server-2008 cursor uniqueidentifier declare