摘要:--when you don’t know the structure that the store procedure generates:CREATE TABLE ##1(ID1 INT)CREATE TABLE ##2(ID1 INT)INSERT ##1SELECT 1CREATE PROC UP_TESTAS BEGINSELECT * FROM ##1ENDINSERT I...
阅读全文
随笔分类 - SQL Server OLTP
摘要:Detect SQL timeout from ASP & Issue RollbackTransI developed an application that worked fine in development and single user testing, but when multiple users starting using the application, I ran i...
阅读全文
摘要:DROP DATABASE DEMO;GOCREATE DATABASE DEMO;GOUSE DEMO;GO--the database master key is always encrypted (using triple_DES) with user-supplier password--stored in the sys.symmetric_keys; and at the same t...
阅读全文
摘要:刚才在QA环境创建SQL replication 的时候报错,大致如下:Error 14274: 无法添加、更新或删除从MSX服务器上发起的作业.导致Replication不能够成功,如按如下角本解决:For example:tsql02\d2shp01SP_CONFIGURE 'ALLOW UPDATES',1 RECONFIGURE WITH OVERRIDE GO use msdb;gobe...
阅读全文
摘要:Useful LinksMicrosoft Related Resource Linkswww.microsoft.com/sql - SQL Server Home Pagewww.microsoft.com/sql/community - SQL Server Community Pagewww.microsoft.com/sql/community/newsgroups - SQL Serv...
阅读全文
摘要:Encrypting Data With the SQL Server Encrypt Function A common question I'm asked by clients is how to encrypt data and store it in SQL Server. One of the major problems I see in the field is when peop...
阅读全文
摘要:/* ***** This entire comment portion is not necessarily part of SP, just notes on subject ***** The purpose of this SP is to provide a method in T-SQL to launch another T-SQL thread without havin...
阅读全文
摘要:Sql Server数据库被置疑后解决方法 现象:数据库Log日志太大了,shrink不掉。于是想把数据库文件卸下来,删除log,再附加上。附加失败。 提示错误: 服务器: 消息 1813,级别 16,状态 2,行 1 未能打开新数据库 'metadb'。CREATE DATABASE 将终止。 设备激活错误。物理文件名 'd:\metadb.LDF' 可能有误。 环境:MSSQL SERV...
阅读全文
摘要:数据规范化!!! 以前看到有网友在提问问题给表例的时候,可以明显看出这个关系不符合最基本的INF,2NF, 3NF!下面我就简要介绍一下关系的规范化中的第一范式,第二范式和第三范式!这是关系规范化中最基本的! 第一范式:每个分量必须是不可再分的数据项!如你可以把姓和名分...
阅读全文
摘要:XML IN 20 MINUTES! http://www.sqlservercentral.com/columnists/lplatt/20010422115709_1.asp This article will quickly dive head first right into XML. I will take an everyday object and attempt to de...
阅读全文
摘要:the following is the SP demo: usingSystem; usingSystem.Data; usingSystem.Data.Sql; usingSystem.Data.SqlServer; usingSystem.Data.SqlTypes; publicpartialclassStoredProcedures { [SqlPr...
阅读全文
摘要:Why use Store procedure 第一:提高性能 第二:减少网络流量 第三:减少注入式攻击 3.1易受注入式攻击的代码: 3.2优化过的代码 3.3使用存储过程来减少注入攻击 第一:提高性能 当存储过程被创建,它要经过以下几步,第一步,它所包含的T-SQL语句将被分析和解析,并被存储.当第一次被执行时,它将被调出并被优化.SQLServer会根...
阅读全文
摘要:Microsoft SQL Server 2005 的 XML 最佳实施策略 日期:2004年7月30日 作者: Shankar Pal、Vishesh Parikh、Vasili Zolotov、Leo Giakoumakis、Michael Rys Microsoft C...
阅读全文
摘要:Injection Attach We ALL know (I hope) that certain formulations OF dynamic SQL expose the DBMS TO special security risks called "injection attacks". Now we will discuss it and give you a way to pr...
阅读全文
摘要:Main Monitor counts about SQLServer 2000 The following describle the main counts about SQL Server.include: TOC \o "1-1" \n \h \z \u 1.Monitoring Memory and Paging File Use 2.Processor 3.Mo...
阅读全文
摘要:How to configure a store proc automatically exec when SQL Server Services start 通过这个例子,我们将大致了解如何使用Raiserror抛出错误信息以及让SQLServer启动时自动运行存储过程. 1.先为我们的SQLServer增加一个错误号为50008的message,然后我们就可以使用这个信息,在本...
阅读全文
摘要:how to use danymic sql in SQL Server 2000 如何在T-SQL使用动态表名 declare @a nvarchar(1000) set @a='test11' set @a=N'create table '+@a+' ( a int) ' exec sp_executesql @a 另一种: declare @a nvarchar(1000) set @...
阅读全文
摘要:Unicode practice SELECT * FROM ::fn_helpcollations() note:now the database collation is:SQL_Latin1_General_CP1_CI_AS USE Northwind GO --Firs...
阅读全文
摘要:临时表 和 表变量 我们经常使用临时表和表变量,那现在我们就对临时表和表变量进行一下讨论. 临时表 局部临时表 全局临时表 表变量 临时表 临时表存储在TempDB数据库中,所有的使用此SQL Server 实例的用户都共享这个TempDB,因为我们应该确保用来存储TempDB数据库的硬盘有足够的空间,...
阅读全文
摘要:如何减少日志文件的空间 我们在应用程序开发过程中经常会出现由于要经常插入,删除和更改文件而导致我们的日志文件过大,此时我们就希望能够把减少日志文件所占有的空间.这经常有以下场景: 1.我们的日志对我们进行数据的恢复非常重要,如果我们以后要用它进行对数据进行恢复的话,我们就应该首先对它进行备份.备份过之后日志数据所占有的空间是少了,但...
阅读全文
浙公网安备 33010602011771号