我在 C# 中有以下代码:
context.Database.ExecuteSqlCommand(webpages_UsersInRolesScripts.dropConstraints);
和
public const string dropConstraints =
@"
USE [DBA];
SET ANSI_NULLS ON
DROP CONSTRAINT [webpages_Roles_UserProfiles_Target];
DROP CONSTRAINT [webpages_Roles_UserProfiles_Source];
";
这给了我一条错误消息:
Message=Incorrect syntax near the keyword 'CONSTRAINT'.