【问题标题】:How to declare a FK, uniqueidentifier in a SQL cursor如何在 SQL 游标中声明 FK、uniqueidentifier
【发布时间】: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


【解决方案1】:

没关系。我运行它并且它起作用了,我担心必须先转换唯一标识符,我猜不是。谢谢!

【讨论】:

    猜你喜欢
    • 2018-01-16
    • 1970-01-01
    • 1970-01-01
    • 2011-12-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-01-27
    • 1970-01-01
    相关资源
    最近更新 更多