我是MVC 4和实体框架的新手,当我从包管理器控制台运行此命令时:
Enable-Migrations -ContextTypeName MyFirstMvcApp.Models.InventoryDbContext
Run Code Online (Sandbox Code Playgroud)
Join-Path:无法将参数绑定到参数'Path',因为它为null.
我收到以下错误:
Join-Path : Cannot bind argument to parameter 'Path' because it is null.
At D:\GitProjects\MyFirstMvcApp\trunk\packages\EntityFramework.6.0.0-alpha2\tools\EntityFramework.psm1:363 char:27
+ $toolsPath = Join-Path <<<< $installPath tools
+ CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand
Join-Path : Cannot bind argument to parameter 'Path' because it is null.
At D:\GitProjects\MyFirstMvcApp\trunk\packages\EntityFramework.6.0.0-alpha2\tools\EntityFramework.psm1:392 char:73
+ $utilityAssembly = [System.Reflection.Assembly]::LoadFrom((Join-Path <<<< $toolsPath EntityFramework.PowerShell.Utility.dll))
+ CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand
You cannot call a method on a …Run Code Online (Sandbox Code Playgroud) 如何创建只能运行SELECT查询和存储过程的自定义 SQL Server 数据库服务器角色?
这意味着,该角色的用户不允许执行自定义查询,但可以运行具有 CRUD 和 SysAdmin 语句的存储过程 - UPDATES、DELETES、ALTERS、DROPS。
我尝试创建此自定义角色,但在运行更改表的 SP 时失败。
CREATE ROLE SupportStaff
GRANT SELECT TO SupportStaff
GRANT EXECUTE TO SupportStaff
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
好的,所以我发现上面的代码允许使用 INSERT/UPDATE/DELETE 语句的存储过程。但它不允许 ALTER、TRUNCATE 或 DROP INDEX 语句。
对于 ALTER,我只需要添加GRANT ALTER TO SupportStaff
但我需要做什么才能允许TRUNCATE和DROP INDEX?