Azure和独立SQL Server上的SqlMembership

时间:2022-01-29 02:46:25

I'm working on an ASP.NET Web Forms application with SqlMembershipProvider. As it is running on Azure too, I use KB2006191 Updated ASP.NET scripts for use with SQL Azure for tables and SPs.

我正在使用SqlMembershipProvider开发ASP.NET Web Forms应用程序。由于它也在Azure上运行,我使用KB2006191更新的ASP.NET脚本用于SQL Azure用于表和SP。

Apparently, they do not work smoothly with a standalone SQL Server 2008 R2 SP1. Especially dbo.aspnet_Users_DeleteUser fires an internal error:

显然,它们与独立的SQL Server 2008 R2 SP1无法顺利运行。特别是dbo.aspnet_Users_DeleteUser会触发内部错误:

Msg 8624, Level 16, State 1, Procedure aspnet_Users_DeleteUser, Line 111 Internal Query Processor Error: The query processor could not produce a query plan. For more information, contact Customer Support Services.

消息8624,级别16,状态1,过程aspnet_Users_DeleteUser,行111内部查询处理器错误:查询处理器无法生成查询计划。有关更多信息,请联系客户支持服务。

Edit:

编辑:

I broke down the issue to one SQL statement which actually fails (even if I hard-code a value for @UserId):

我将问题分解为一个实际失败的SQL语句(即使我硬编码@UserId的值):

DELETE FROM dbo.aspnet_Users WHERE UserId = @UserId

Original:

原版的:

I tried fixing my SQL Server installation by downloading a Cumulative Update Package and setting trace flag 4199. However, this did not help. To be honest, I'm not too sure whether I applied the patch properly. I'm doing further research on this.

我尝试通过下载累积更新包并设置跟踪标志4199来修复我的SQL Server安装。但是,这没有帮助。说实话,我不太确定我是否正确应用了补丁。我正在做进一步的研究。

Moreover, I tried to rewrite the SP a little, as I found some tips on the web. This did not help either, and the same query is generated by aspnet_regsql for standalone SQL Server anyway. Actually, I tried to get rid of a subquery around line 111 by turning this:

此外,我尝试重写SP一点,因为我在网上发现了一些提示。这也没有帮助,无论如何,aspnet_regsql为独立SQL Server生成相同的查询。实际上,我试图通过转动这个来摆脱第111行周围的子查询:

IF ((@TablesToDeleteFrom & 1) <> 0 AND
    (@TablesToDeleteFrom & 2) <> 0 AND
    (@TablesToDeleteFrom & 4) <> 0 AND
    (@TablesToDeleteFrom & 8) <> 0 AND
    (EXISTS (SELECT UserId FROM dbo.aspnet_Users WHERE @UserId = UserId)))

... into this:

......进入这个:

IF ((@TablesToDeleteFrom & 15) <> 0)

Did anybody come across similar issues dealing with membership and both Azure and standalone SQL Server?

是否有人遇到类似的问题处理成员资格以及Azure和独立SQL Server?

1 个解决方案

#1


3  

According to Scott Hanselman and this blog post, the ASP.NET Universal Providers For SqlExpress 1.1 package (System.Web.Providers) is the officially supported method of enabling the SQL membership, role and session providers across SQL Azure and standalone SQL Server.

根据Scott Hanselman和本博文的帖子,ASP.NET Universal Providers For SqlExpress 1.1软件包(System.Web.Providers)是官方支持的在SQL Azure和独立SQL Server中启用SQL成员资格,角色和会话提供程序的方法。

#1


3  

According to Scott Hanselman and this blog post, the ASP.NET Universal Providers For SqlExpress 1.1 package (System.Web.Providers) is the officially supported method of enabling the SQL membership, role and session providers across SQL Azure and standalone SQL Server.

根据Scott Hanselman和本博文的帖子,ASP.NET Universal Providers For SqlExpress 1.1软件包(System.Web.Providers)是官方支持的在SQL Azure和独立SQL Server中启用SQL成员资格,角色和会话提供程序的方法。