- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试运行下面的 SQL 语句:
ALTER DATABASE DBNAME
SET READ_COMMITTED_SNAPSHOT ON
最佳答案
完成此命令需要立即成为针对数据库打开的唯一事务。在我看来,这几乎需要您将数据库简单地置于单用户模式。但也许如果你只是让查询(试图)在一夜之间运行,在某个时候你会得到那个神奇的瞬间。
这里有更多关于这个主题的内容:http://www.brentozar.com/archive/2013/01/implementing-snapshot-or-read-committed-snapshot-isolation-in-sql-server-a-guide/
编辑:在线书籍提供了更多细节:
When you set ALLOW_SNAPSHOT_ISOLATION to a new state (from ON to OFF, or from OFF to ON), ALTER DATABASE does not return control to the caller until all existing transactions in the database are committed. If the database is already in the state specified in the ALTER DATABASE statement, control is returned to the caller immediately. If the ALTER DATABASE statement does not return quickly, use sys.dm_tran_active_snapshot_database_transactions to determine whether there are long-running transactions. If the ALTER DATABASE statement is canceled, the database remains in the state it was in when ALTER DATABASE was started. The sys.databases catalog view indicates the state of snapshot-isolation transactions in the database. If snapshot_isolation_state_desc = IN_TRANSITION_TO_ON, ALTER DATABASE ALLOW_SNAPSHOT_ISOLATION OFF will pause six seconds and retry the operation.
关于tsql - 将 READ_COMMITTED_SNAPSHOT 设置为 ON 运行更改数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31167115/
CREATE TABLE [dbo].[tblLocations]( [latitude] [float] NOT NULL, [longitude] [float] NOT NULL
有没有办法在相似的表中递归读取记录并按深度级别排序? #table: id int | parent int | value string --------------------
尝试从旧数据库迁移到存储数据的新数据库有点不同。 在一种特定情况下,我有一列用分号分隔的值,我想将其分隔成多行。 这是一个例子: SELECT p.idperson, p.rolepe
我用谷歌搜索并查看了 MSDN TSQL 引用,但无法找到“ .. ”的含义或作用的定义或解释。 示例 if OBJECT_ID('tempdb..#temp') is not null drop t
我需要以下内容: 检查 Public 或 guest 是否被授予对对象(数据库角色和服务器角色)的任何权限 检查是否有任何用户被授予对对象而非角色的权限。 检查用户是否对对象 拥有 with gran
DECLARE @query as varchar(200); SET @query = 'SELECT COUNT(*) FROM table'; 如何执行@query,此外,在分配变量时是否可以直
我正在编写报告,并希望获取年龄列的平均值。问题在于,并非所有行都具有年龄。 如果该列的值为0 2 4,我希望返回3,而不是2。我不能简单地使用WHERE排除零行,因为我正在使用那些行中的其他列。是否存
我尝试在 tsql 中左修剪换行符。所以我想删除领先的 字符(13) + 字符(10) 我在一个字段中的数据。并确保不会删除其他换行符。 我的意思是: ' Kanne Oliver Rosa-Luxe
这个问题在这里已经有了答案: 关闭 11 年前。 Possible Duplicate: How to execute mathematical expression stored in a var
我认为最好以简单示例的形式提出这个问题。以下 SQL 块会导致“DB-Library Error:20049 Severity:4 Message:Data-conversion导致溢出”消息,但怎么
我们的一位用户在开发服务器中执行了插入语句。插入工作正常。但是在生产服务器执行同样的insert语句时,却遇到了如下错误: Error:.Net SqlClient Data Provider Err
我如何编写 TSQL 来计算以下内容: 当前日期和午夜,例如 2010-12-01 00:00:00.000 当前日期和下午 6 点,例如 2010-12-01 18:00:00.000 谢谢.. 最
我最近有一个关于在 TSQL 中使用游标的争论...... 首先,我不是辩论中的啦啦队长。但是每次有人说 cursor 时,总会有一些笨蛋(或 50 个)用强制性的“光标是邪恶的”咒语来猛扑。我知道
是否可以在不显式定义列的情况下在 sql 中声明变量? 类似 declare @tab as select * from myTable 最佳答案 你可以选择一个临时表......看起来它会做你想要的
我们遇到的问题简化为以下两个语句: select convert(float, (convert(float,5741.61)/convert(float, 196.00)) * convert(fl
我有一个 ADO.NET/TSQL 性能问题。我们的应用程序中有两个选项: 1) 一个具有多个结果集的大型数据库调用,然后在代码中逐步遍历每个结果集并填充我的对象。这会导致一次到数据库的往返。 2)
问题背景 生成和访问固定列布局的数据很容易。您可以预先创建本地临时表,并通过调用存储过程来填充它们。 另一方面,如果要生成具有动态列布局的数据,通常必须动态构建 SQL 语句并使用“exec sp_e
我有一个SQL Server 2005查询,该查询生成较大的结果集(最大为数GB): SELECT * FROM Product FOR XML PATH('Product') 运行查询将生成包含包含
我使用此代码在 sql server 中读取 .mp3 文件字节。当我使用本地连接时,它工作正常。但是,当我更改与服务器的连接(例如: 192.168.1.1 和 windows 身份验证模式 )并运
这不会在 ColdFusion 11 中崩溃,但会在 ColdFusion 2016 中崩溃 SELECT * FROM dbo.Roles WITH (NOLOCK) WHERE Cod
我是一名优秀的程序员,十分优秀!