自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Kevin's Blog SQL讨论群21426959 Dynamics AX 438084988

技术是靠累计的,每天记录一点。 关注数据库,BI,大树据,移动开发,云技术

  • 博客(25)
  • 资源 (12)
  • 收藏
  • 关注

原创 BULK INSERT 操作文件是不是被当做一个Transcation?

早上看到网上有人问将文件导入数据库的问题,其实可以用BCP或者BULK INSERT处理,这样性能很好。后来牵扯到了错误处理的问题,如果用BULK INSERT,是不是需要显示的Transcation(begin tran). 以前一直认为BULK INSERT是将每条语句当做Transcation处理的,如果100条记录,一条失败99条成功,那么你的数据库将会产生99条数据。但是在MSD

2012-09-21 17:20:55 1664

原创 SQL Server 2012 错误处理增强THROW

在C#中开发人员可以使用TryCatch/Throw语句对错误进行处理,虽然在2005后,SQL Server也引入了Try/Catch语句,但是Throw没有被移植过来。开发者需要使用RAISERROR语句将错误消息返回到应用程序中,对于自定义的错误信息,需要先在sys.Messages创建错误才可以在RAISEERROR中使用。 在2012中,微软终于增加了THROW语句,THROW包

2012-09-20 10:59:32 1930

原创 SQL Server 2012 SEQUENCE 对象

Oracle中有sequence的功能,SQL Server类似的功能使用Identity列实现,但是有很大的局限性。在2012中,微软终于增加了 sequence 对象,功能和性能都有了很大的提高。 我们可以在SSMS中创建也可以使用SQL Server脚本创建序列对象:   使用SQL创建序列对象: IF EXISTS(SELECT*FROMsys.se

2012-09-19 21:25:40 5474 3

原创 SQL Server访问Exchange数据

看到网上有人在寻找SQL Server存储Email数据,其实SQL Server提供了OLE DB Provider可以访问Exchange.  Microsoft OLE DB Provider for Exchange 以表格形式公开存储在 Microsoft Exchange 2000 Web Store 中的数据。可以使用类似于 OLE DB Provider for Micro

2012-09-19 11:48:05 1517

转载 Table restore and filegroups

Table restore and filegroupsThe story usually goes something like:Q - How can I restore only this table?A - Put it on its own filegroup and you can do filegroup level backup and restore. The

2012-09-19 11:39:13 1366

原创 DDL Trigger监控存储过程更改

下面的Trigger用于监控存储过程的更改。 创建监控表: CREATE TABLE AuditStoredProcedures(  DatabaseName sysname, ObjectName sysname, LoginName sysname, ChangeDate datetime, EventType sysname, Ev

2012-09-18 20:42:48 1114

转载 SQL Server: Is Replication Recovery Model dependent ?

There is a myth that for replication to work properly the databases always have to be in Full recovery mode. Well that is not at all true.First let me give a short overview on how replication work

2012-09-18 10:26:22 1066

原创 为什么无法重建2005/2008数据库日志

曾经有客户发Email给我说数据库日志文件损坏了,有没有办法让数据库上线。因为当时没有备份(备份在这种情况下作用就体现出来了,一定要做备份),所以只能尝试重建日志,通过重建日志将数据库恢复了。 但是重建日志功能不是对于所有情况适用用的,要满足两个条件:·        A clean shutdown of the database.·        All data files

2012-09-15 20:39:56 2954 3

原创 使用SQL Server 2008 Extended Events SSMS Addin轻松管理XEvents

微软在SQL Server 2008中引入了Extended Event,这个功能非常强大,对于Troubleshooting非常有帮助。但是在Management studio中确没有提供UI对Extended Event的操作(2012会提供),只能用语句实现,这给一些用户带来了不便。 但是CodePlex开发了Events Manager,安装以后可以继承到SSMS中,用户可以直

2012-09-15 15:41:19 3322 2

转载 SQL Server Extended Events使用2:查询使用锁最多的对象

当我们怀疑可能存在高度争用的资源,并希望了解这些对象占用多少锁定。一旦识别锁定频率最高的对象,便可采取一些措施来优化对争用对象的访问。使用SQL Server Extended Events可以帮助我们获得对象使用的锁资源。 --先删除LockCounts Event SessionIF EXISTS(SELECT*FROM sys.server_event_sessionsWHE

2012-09-15 14:52:02 1113

原创 新手学习Cognos BI 10

最近开始学习使用IBM Cognos 10.1建模开发报表. 以前从来没有接触过,虽然看了不少Cognos系列的书(handbook,user guide,Transfomer user guide,administrator),但是感觉要么理论太强,要么太繁琐,而且由于没有图文,很多选项找半天也不知道在哪里,对于刚开始学习的人有点摸不着头脑。 后来在IBM官网上找到了体验魅力 Cogno

2012-09-14 15:56:50 1592

原创 SQL Server Extended Events使用1: 查询运行时间久的SQL语句

SQL Server Extended Events是SQL Server 2008里新加的事件处理系统,用来取代SQL Server原先的SQL Trace的跟踪机制。事件处理系统对一个复杂服务器系统的排错,调试是极为关键的。和SQL Server原来的事件处理系统相比较,XEvent具有下列的优势:消耗更少的系统资源,更适用于在产品服务器上的排错和调试。并且每收集一个系统事件所消耗的资

2012-09-14 10:41:58 1738

原创 重新初始化SQL Server Log Shipping

这几天一直在忙其他事情,没有关注Log shipping的状态,今天早上查看报表发现一个Log shipping的数据库已经几天没有同步了,数据库的状态为Restoring,需要重新初始化。 步骤: 1.还原最近的数据库完整备份 2.还原完整备份之后的所有日志备份,使用下面的脚本可以将自上次完整备份之后的所有日志备份找出来,然后直接在Secondary数据库上执行:

2012-09-13 10:40:40 1785

转载 How does SQL Server really store NULL-s

Each row has a null bitmap for columns that allow nulls. If the row in that column is null then a bit in the bitmap is 1 else it's 0.For variable size datatypes the acctual size is 0 bytes.For fix

2012-09-13 09:50:33 1245

原创 SQL Server 2008 Partition 测试

--创建FileGroupALTER DATABASE AdventureWorksADDFILEGROUP [2003Q3]ALTER DATABASE AdventureWorksADDFILEGROUP [2000Q4]ALTER DATABASE AdventureWorksADDFILEGROUP [2001Q1]ALTER DATABASE AdventureWorks

2012-09-12 17:27:44 971

原创 SSRS如何将多值参数传递给存储过程

Reproting Servcie中提供了参数多值,但是在存储过程中如何使用参数多值呢? 网上有对值进行Split的,我这里使用了表变量。下面是我的解决办法: CustomerCode在Report中值可以多选,这里我是用JOIN函数将多值变为一个字符串。下面是Report中调用存储过程的语句: ="EXECUTE    dbo.usp_test "  &  "  '" &

2012-09-12 10:44:34 5140

原创 查看buffer pool数据密度

我们都知道SQL Server访问的数据会放到Buffer Pool中,但是你知道Buffer Pool中使用的数据密度吗? 如果Buffer Pool中我们要查询数据的密度小,说明很多无用的内存被占用了,导致内存的浪费。  那么如何查看buffer pool中数据的密度呢? SQL Server2005版本中提供了sys.dm_os_buffer_descriptors  DMV,使用这

2012-09-10 14:15:27 1220

原创 The owner () of job <Job Name> does not have server access.

早上看到有个数据库备份的Job失败(SQL Server 2005),错误如下:The owner () of job does not have server access. 这个Job的Owner是域用户,而且确定是有权限可以访问数据库的。直接用域账户从Management studio登陆没有问题。将Job Owner更改为SQL Server账户Job也可以运行。

2012-09-10 09:25:25 1272

原创 SSRS不浏览报表也可以直接导出报表文件

一般我们从Report Servcie导出报表都是先浏览之后再导出,如果我们只需要看报表的话,有没有办法不浏览Report直接导出报表呢?答案是使用URL访问。 通过 SQL Server Reporting Services (SSRS) 中报表服务器的 URL 访问,您可以通过 URL 请求将命令发送到报表服务器。例如,您可以自定义报表在本机模式报表服务器上或 SharePoint 库

2012-09-09 21:46:11 4447 3

原创 Msg 9002 The transaction log for database '' is full

今天有个朋友说他的数据库报错,错误信息如下: Msg 9002, Level 17, State 2, Line 4The transaction log for database '' is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sy

2012-09-09 16:02:37 3706

原创 如何获得64位 Jet Driver

以前SQL Server可以用JET直接访问Excel的数据,非常方便。但是现在使用64位的SQL Server会遇到问题,因为微软没有提供64位的Jet驱动程序,可以参考:Kb 957570 我们不提供 Microsoft OLE DB 提供程序的 64 位版本的 Jet。此外,我们不提供 64 位版本的 Jet ODBC 驱动程序。如果您使用 MicrosoftOLE DB 提供程序为

2012-09-06 16:28:22 3913

原创 The Excel Connection Manager is not supported in the 64-bit version of SSIS

今天SSIS导Excel数据的时候遇到下面的错误: [Connectionmanager "Excel Connection Manager"] Error: SSIS Error Code DTS_E_OLEDB_EXCEL_NOT_SUPPORTED: The ExcelConnection Manager is not supported in the 64-bit version

2012-09-06 15:27:14 2185

原创 如何让Log shipping成功的备份信息不出现在SQL Server error log

配置了SQL Server 日志传送后,因为备份的数据库比较多而且时间频繁所以造成SQL Server日志非常大。如下图:   由于我们已经有了Log shipping的监控,所以这些备份信息对于我们来说基本上没什么用处。 那有没有办法使这些信息部出现在数据库错误日志中呢? 答案是 Trace Flag3226 下面内容来自MSDN: 3226

2012-09-03 15:28:31 1660

原创 使用SQL Server RML工具评估新SQL Server服务器性能

测试新SQL Server的性能是个麻烦的工作,有一个工具(SQL Server RML )可以用来重播跟踪文件针对 SQL Server 的另一个实例,这样可以评估新服务器的性能。 另外 SQL Server RML 实用程序还可以执行以下任务: 您可以确定应用程序、 数据库、 SQL Server 登录名或使用资源最多的查询。您可以确定是否捕获的批跟踪时更改为一个批处理

2012-09-02 08:45:46 1090

原创 你的数据库使用特定于本版本的功能吗?

由于SQL Server不同版本之间会有一些不同的功能,比如在SQL Server 2008 企业版中可以使用数据压缩,但是在标准版中却不支持这个功能。我们不能将包含这些功能的数据库迁移到不支持这些功能的 SQL Server 版本。 下面我尝试将使用数据压缩的数据库还原到标准版会出现错误:  所以如果要还原到其他版本的数据库,我们需要知道当前数据库是不是启用了特殊功能。使

2012-09-02 08:34:54 1483

Microsoft Private Cloud Computing

Written by a team of expert authors who are MVPs and leaders in their respective fields, this one-of-a-kind book is an essential resource for IT administrators who are responsible for implementing and managing a cloud infrastructure. You’ll quickly learn how cloud computing offers significant cost savings while also providing new levels of speed and agility. Serving as a how-to guide, Microsoft Private Cloud Computing walks you through building a secure, internal cloud and delivering it as a service to your company using Microsoft Windows Server Hyper-V and Microsoft System Center Virtual Machine Manager 2012.

2013-01-15

The Guru's Guide to SQL Server Architecture and Internals.chm

I can pretty much guarantee that anyone who uses SQL Server on a regular basis (even those located in Redmond working on SQL Server) can learn something new from reading this book.&quot;

2009-10-13

Windows Server 2003 用户管理指南

由微软资深顾问,微软MVP所著,很精彩的一本书,希望对大家都有帮助

2009-09-27

Sqlserver性能调整

很多客户偶尔会遇到SQL Server 数据库性能下降。原因可能涉及从不良好的数据库设计到不正确的负载配置。作为一个管理员,你应该预先阻止或最小化问题,并当问题发生时,诊断原因并尽可能的做出正确的操作来解决问题。这片白皮书所述的问题通常来源于Microsoft® Corporation 的Customer Support Service(CSS or PSS)部门所遇到的,因为将所有可能的问题都详尽的分析是不合实际的。我们提供了按部就班的指导,通过使用可用的工具例如SQL Server Profiler,System Monitor和在SQL Server 2005中新的Dynamic Management View来为一般的性能问题诊断和排错。

2009-09-27

使用CPU计数器监视SQL Server性能的

当使用CPU计数器测量CPU活动时,记住下面是SQL Server中耗用CPU资源最多的进程: • 上下文切换:当SQL Server在多个CPU之间切换线程时就会发生上下文切换,过多的上下文切换会吃掉CPU资源。有些情况下,打开LightweightPooling选项可以减少上下文切换。

2009-09-27

inside-microsoft-r-sql-server-tm-2005-the-storage-engine

Although one goal of ours was to minimize the amount of overlap between volumes so that readers of the complete series would not have to deal with duplicate content, we also realized that not everyone would start with the same volume. Itzik and I have different approaches to describing SQL Server query processing, index use, and tuning, so when those topics are covered in more than one volume, that duplication is actually a bonus.

2009-09-27

SQL SERVER 2005

Written by a T-SQL guru, this thorough, hands-on reference for database developers and administrators focuses on language features and how they are interpreted and processed by the SQL Server execution engine.

2009-09-27

SQL+Server+2005技术内幕-存储引擎1-5章.pdf

Dive deep into the internals of query tuning and optimization in SQL Server 2005 with this comprehensive reference. Understanding the internals of SQL Server helps database developers and administrators to better create, access, and effectively process information from enterprise data. Written by experts on SQL Server, this volume from the Inside Microsoft SQL Server series of books focuses on query tuning and optimization. You'll take an in-depth look at the best ways to make queries more efficient and effective, while maximizing existing resources. Includes extensive code samples and table examples to help database developers and administrators understand the intricacies and help promote mastery of query tuning and optimization.

2009-09-24

Microsoft Press - Inside Microsoft SQL Server 2005 Query Tuning and Optimization (Sep 2007).chm

Dive deep into the internals of query tuning and optimization in SQL Server 2005 with this comprehensive reference. Understanding the internals of SQL Server helps database developers and administrators to better create, access, and effectively process information from enterprise data. Written by experts on SQL Server, this volume from the Inside Microsoft SQL Server series of books focuses on query tuning and optimization. You'll take an in-depth look at the best ways to make queries more efficient and effective, while maximizing existing resources. Includes extensive code samples and table examples to help database developers and administrators understand the intricacies and help promote mastery of query tuning and optimization.

2009-09-24

Inside Microsoft SQL Server 2005: T-SQL Programming

Written by a T-SQL guru, this thorough, hands-on reference for database developers and administrators focuses on language features and how they are interpreted and processed by the SQL Server execution engine.

2009-09-24

SQL.Server.2005.Administration

There you are, standing in front of the book rack at your favorite book store, leafing through these pages, wondering if this is the one you are looking for. Go ahead; look around to see if I’m watching you. I’ll wait.... OK, the coast is clear. So, did we write this book for you? Since you’re reading this, it’s very likely. Our primary audience is IT professionals (both developers and administrators) who have found themselves responsible for the management and maintenance of a SQL Server 2005 database. You may have been responsible for a SQL Server 2000 database and were just getting used to that when your company decided to move to SQL Server 2005. The new features and new tool set can be intimidating. We wrote this book for you. You may be thinking, “I’m a senior DBA and this book’s title is Beginning SQL Server 2005 Administration. I am not a beginner.” I understand. However, we also wrote this book for you. SQL Server 2005 is a dramatic departure from its predecessors and, even if you are an expert on SQL Server 2000 or SQL Server 7, you will find a great deal of very useful information in this book. Go ahead, flip through the pages, and check it out for yourself. I believe you will find what you’re looking for.

2009-05-25

TSQL Query Tuning

This article is the second in a series that describes a variety of performance tuning techniques that you can apply to your Microsoft SQL Server Transact-SQL programs. In many cases, you could use the graphic user interface provided in Microsoft SQL Enterprise Manager or Microsoft SQL Query Analyzer to achieve the same or similar results to those described here. However, this series focuses on using Transact-SQL as the basis for our solutions. All examples and syntax are verified for Microsoft SQL Server 2000.

2009-05-25

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除