使用 DotNetNuke 5.6.2 进行用户迁移
我需要将用户信息从实时数据库传输到它的新家(这是通过实时数据库的备份创建的,所以我只想移植新用户。(运行 sql sqerver 2005)
我可以毫无问题地传输 aspnet_ 表
但是,当我尝试执行用户表时,出现错误:
消息 512,级别 16,状态 1,过程 Mailing_list,第 18 行 子查询返回超过 1 个值。当子查询跟在 =、!=、<、<=、>、>= 后面或子查询用作表达式时,不允许这样做。
查询
begin TRAN
SET IDENTITY_INSERT TargetDB.dbo.users ON
INSERT INTO TargetDB.dbo.users (UserId, UserName, FirstName, LastName, IsSuperUser,
AffiliateId, Email, DisplayName, UpdatePassword)
(SELECT dnnu.UserId, dnnu.username, dnnu.firstname, dnnu.lastname,
dnnu.isSuperuser, dnnu.AffiliateId, dnnu.Email, dnnu.DisplayName,
dnnu.UpdatePassword
FROM LiveDB.dbo.users dnnu
INNER JOIN LiveDB.dbo.aspnet_users u
ON (dnnu.username = u.username)
WHERE dnnu.username NOT IN (SELECT username
FROM TargetDB.dbo.users))
SET IDENTITY_INSERT TargetDB.dbo.users OFF
commit TRAN
我还在至少两个其他数据库上运行了相同的代码部分,没有任何问题
任何帮助将不胜感激
提前致谢 马特
I need to transfer users info from the live DB to its new home (which was created via a backup of the live DB so Im only looking to port new users across.(running sql sqerver 2005)
I can Transfer the aspnet_ tables without any issue
However when I try to do the users table it errors with:
Msg 512, Level 16, State 1, Procedure Mailing_list, Line 18
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
Query
begin TRAN
SET IDENTITY_INSERT TargetDB.dbo.users ON
INSERT INTO TargetDB.dbo.users (UserId, UserName, FirstName, LastName, IsSuperUser,
AffiliateId, Email, DisplayName, UpdatePassword)
(SELECT dnnu.UserId, dnnu.username, dnnu.firstname, dnnu.lastname,
dnnu.isSuperuser, dnnu.AffiliateId, dnnu.Email, dnnu.DisplayName,
dnnu.UpdatePassword
FROM LiveDB.dbo.users dnnu
INNER JOIN LiveDB.dbo.aspnet_users u
ON (dnnu.username = u.username)
WHERE dnnu.username NOT IN (SELECT username
FROM TargetDB.dbo.users))
SET IDENTITY_INSERT TargetDB.dbo.users OFF
commit TRAN
I have also run this same section of code on at least two other Database with no issues
Any help would be greatly appreciated
Thanks in advance
Matt
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
昨天花了一两个小时盯着这个问题并决定提出这个问题后,我又看了一眼,它击中了我。
表上有一个用于插入/更新的触发器,它抛出一个摇摇欲坠的掉落,它运行了查询,现在可以工作了
After spending an hour or two yesturday staring at this issue and deciding to ask the question I took a second glance and it hit me.
There was a trigger on the table for insert/update and it was throwing a wobbly dropped it ran the query and it now works