如何从备份数据库恢复选定的 ASP.NET 会员用户?
我的 CMS 最近出现了问题,今天发现我上周创建的所有用户都被删除了。好消息是我有数据库的备份,并且它使用标准 ASP.NET 成员资格表。
有没有办法在不恢复整个数据库的情况下恢复这些数据?成员资格表有点像迷宫......是否有现有的存储过程或实用程序?我不确定哪些表是必需的,哪些表不需要。
Had a recent issue with my CMS and discovered today that all of my users created in the last week were deleted. The good news is that I have a backup of the DB, and that it uses standard ASP.NET Membership tables.
Is there a way to do a restore of this data without restoring the whole DB? The membership tables are something of a maze... is there an existing stored proc or utility out there? I'm not sure which tables would be required and which ones would not.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不知道有任何单个存储过程或实用程序可以执行此操作。
如果您仅使用会员资格,则需要从以下位置复制:
如果您还使用角色,则需要从以下位置复制:
如果您还使用配置文件,则需要从以下位置复制:
所以基本上还不错。您只需要卷起袖子,编写 2 到 4 条插入语句即可。 (至少这是理论)
I'm not aware of any single sproc or utility to do this.
If you're using just the Membership, you'll need to copy from:
If you're also using Roles you'll need to copy from:
If you're also using Profile you'll need to copy from:
So basically it's not that bad. You just need to roll up your sleeves and write between 2 and 4 insert statements. (that's the theory at least)
Greg 的正确答案的后续...这是我使用的实际 SQL 脚本:
Follow-up to Greg's correct answer... here is the actual SQL script I used: