执行 transact-sql 语句或批处理时发生异常

An exception occurred while executing a transact-sql statement or batch(执行 transact-sql 语句或批处理时发生异常)
本文介绍了执行 transact-sql 语句或批处理时发生异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我不断收到错误消息:

执行 transact-sql 语句或批处理时发生异常

an exception occurred while executing a transact-sql statement or batch

尝试在 SQL Server Management Studio 2016 中执行任何操作时.

when trying to do anything in SQL Server Management Studio 2016.

当我尝试创建或编辑登录名时,当我尝试创建新数据库时,基本上是在我做任何事情时,都会发生这种情况.

This occurs when I try to create or edit a login, when I try to create a new database, basically when I do anything.

我尝试了 SQL Server 2008 R2 Express 权限 -- 无法创建数据库或修改用户,但我无法编辑步骤 6 中指定的启动参数.

I tried the solution given in SQL Server 2008 R2 Express permissions -- cannot create database or modify users but I can't edit the Startup Parameters specified in step 6.

谁能解释一下问题是什么以及如何解决?

Can anyone explain what the issue is and how to solve it?

推荐答案

我在尝试附加数据库时收到此错误消息,如果是您的情况,请转到您的数据库所在的文件夹:

I got this error message while trying to attach DB, if it's your case, go to to the folder where your DB is:

  • 右键单击 => 属性 => 安全性 => 高级
  • 确保正确的用户具有完全控制"权限
  • 如果不是:
    • 点击更改权限"
    • 为相关用户(或所有用户)设置完全控制"权限

    它对我有用.

    这篇关于执行 transact-sql 语句或批处理时发生异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

    本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

SQL query to group by day(按天分组的 SQL 查询)
Include missing months in Group By query(在 Group By 查询中包含缺失的月份)
sql group by versus distinct(sql group by 与不同)
How to return a incremental group number per group in SQL(如何在SQL中返回每个组的增量组号)
Count number of records returned by group by(统计分组返回的记录数)
SQL GROUP BY CASE statement with aggregate function(带聚合函数的 SQL GROUP BY CASE 语句)