摘要:
Insert-Exec语句:· 示例:Insert Into @MERC_Flatfile_Product_Attribute_V52Exec dbo.Merc_GEN_Product_Attribute_V52 @catalogId· 我们所知道的:这是一个插入语句,同时还是一个调用语句,它将Merc_GEN_Product_Attribute_V52这个存储过程中返回的结果保存到@MERC_FlatFile_Product_Attribute_V52这个表变量中。· 我们所不知道的:这是一个事物,一个很大的事物;这个事物会在整个存储过程执行完,并且将返回的结果 阅读全文
摘要:
declare @cmd nvarchar(4000)set @cmd = N'exec [?].sys.sp_change_users_login @Action = ''Auto_Fix'' , @UserNamePattern = ''qa'' , @LoginName = null , @Password = ''abc'' ' exec sp_msforeachdb @cmd 阅读全文
摘要:
Initiator Instance:use mastergo/*1. create user, login, certificate and endpoint2. export the certificate*/if not exists(select * from sys.symmetric_keys as sk where name = '##MS_DatabaseMasterKey##') create master key encryption by password = 'Password#123'goif exists(select * from 阅读全文
摘要:
create table test(c1 char(1),c2 char(1),c3 char(1),c4 char(1),c5 char(1))godeclare @n int = 1;while(@n < 1000)begininsert into test values(char(65+((cast(rand()*100 as int)) % 26)),char(65+((cast(rand()*100 as int)) % 26)),char(65+((cast(rand()*100 as int)) % 26)),char(65+((cast(rand()*100 as int 阅读全文
摘要:
DECLARE @TableName VARCHAR(128); SET @TableName = 'Order_Item' DECLARE @FieldInfo TABLE(FieldName SYSNAME, TypeName SYSNAME); INSERT INTO @FieldInfo SELECT c.[name],t.[name] FROM sys.[columns] c... 阅读全文
摘要:
Cherié Warren 概览: 发生锁升级的原因 避免不必要的阻塞 优化查询 监视锁定对性能的影响 锁定对支持数据库的并发读写活动而言是必需的,但阻塞却会对系统性能产生负面影响,有时让人难以觉察。在本文中,我将介绍如何优化 SQL Server 2005 或 SQL Server 2008 数据库以最大程度降低 阻塞,以及如何监视系统以更好地了解锁定如何对性能产生影响。 锁定和升级 SQ... 阅读全文
摘要:
锁升级阈值 如果没有使用 ALTER TABLE SET LOCK_ESCALATION 选项来禁用表的锁升级并且满足以下任一条件时,则将触发锁升级: 单个 Transact-SQL 语句在单个无分区表或索引上获得至少 5,000 个锁。 单个 Transact-SQL 语句在已分区表的单个分区上获得至少 5,000 个锁,并且 ALTER TABLE SET LOCK_ESCALATION 选项... 阅读全文
摘要:
slavao 18 Mar 2005 12:19 PM Comments 7 Yukon caching vs SQL2000 What makes Yukon memory management different from SQL2000 is elaborative caching framework. In SQL2000 there are two major caches: data... 阅读全文
摘要:
Published: June 26, 2006 SQL Server Technical Article Writers: Wei Xiao, Matt Hink, Mirek, Sunil Agarwal Technical Reviewer: Wei Xiao Applies To: SQL Server 2005 Summary: This white paper describ... 阅读全文
摘要:
SQLOS's memory manager and SQL Server's Buffer Pool SQLOS's memory manager consists of several components such as memory nodes, memory clerks, memory caches, and memory objects. Fig 1. depicts memory... 阅读全文