将 ASP.NET 成员资格数据库迁移到 SQL Azure [英] Migrating ASP.NET Membership Database to SQL Azure

查看:33
本文介绍了将 ASP.NET 成员资格数据库迁移到 SQL Azure的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将数据库从 SQL Server 2008 迁移到 SQL Azure.我尝试迁移的数据库包括 ASP.NET Membership 数据库 (http://www.asp.net/web-forms/tutorials/moving-to-aspnet-20/membership).当我在 SQL Server 2008 数据库中运行该数据库时,它运行良好.但是,当我尝试针对 SQL Azure 对用户进行身份验证时,我收到一条错误消息:

I am trying to migrate a database from SQL Server 2008 to SQL Azure. The database that I am attempting to migrate includes the ASP.NET Membership database (http://www.asp.net/web-forms/tutorials/moving-to-aspnet-20/membership). This database works fine when I run it in my SQL Server 2008 database. However, when I try to authenticate a user against SQL Azure, I receive an error that says:

此版本的 SQL Server 不支持没有聚集索引的表.请创建聚集索引并重试."

"Tables without a clustered index are not supported in this version of SQL Server. Please create a clustered index and try again."

但是,我不知道该怎么做.当我尝试更新 aspnet_Applications 表上的索引时,我收到一个外键问题.我正在使用以下内容尝试将我的非聚集索引迁移到聚集索引:

However, I'm not sure what to do. When I try to update the index on the aspnet_Applications table, I receive a foreign key problem. I am using the following in an attempt to migrate my non-clustered index to a clustered index:

ALTER TABLE aspnet_Applications
DROP CONSTRAINT PK__aspnet_A__SOMEID

ALTER TABLE aspnet_Applications
ADD CONSTRAINT PK__aspnet_A__SOMEID PRIMARY KEY CLUSTERED(ApplicationId)

有人可以帮我解决这个问题吗?谢谢!

Can someone please help me overcome this issue? Thank you!

推荐答案

如果可以,请尝试使用 SqlExpress 1.1 的 ASP.NET 通用提供程序(我希望他们更改名称,因为它有点用词不当).这是官方支持的跨 SQL Azure 和独立 SQL Server 启用 SQL 成员资格、角色和会话提供程序的方法.

If you can, try to use the ASP.NET Universal Providers For SqlExpress 1.1 (I wish they'd change the name as it is a bit of a misnomer). This is the officially supported method of enabling the SQL membership, role and session providers across both SQL Azure and standalone SQL Server.

这里有几个其他链接供参考:

Here are a couple of other links for reference:

Scott Hanselman - 介绍 System.Web.Providers

SQL Azure 团队博客 - 使用 SQL Azure 进行会话状态

这篇关于将 ASP.NET 成员资格数据库迁移到 SQL Azure的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆