随笔分类 - Database
摘要:Sql Server 中使用case when then 判断某字段是否为null,和判断是否为字符或数字时的写法不一样,如果不注意,很容易搞错错误方法:CASE columnName WHEN null THEN 0 ELSE columnName END正确方法:CASE WHEN column
阅读全文
摘要:jdbc:sqlserver://PC;instanceName=sql2012;databaseName=xxxxx
阅读全文
摘要:主键约束 SELECT tab.name AS [表名], idx.name AS [主键名称], col.name AS [主键列名] FROM sys.indexes idx JOIN sys.index_columns idxCol ON (idx.object_id = idxCol.obj
阅读全文
摘要:HIVEMap Join is nothing but the extended version of Hash Join of SQL Server - just extending Hash Join into Distributed System.SMB(Sort Merge Bucket)J...
阅读全文
摘要:本文转自 http://www.cnblogs.com/kerrycode/archive/2012/12/14/2818421.html1:首先检查网络是否能ping通2:检查TNS配置(TNS配置也没有问题)GSP =(DESCRIPTION =(ADDRESS =(PROTOCOL = TCP...
阅读全文
摘要:关系型数据库系统以二维表的形式呈现数据,比如下面的员工表RowIdEmpIdLastnameFirstnameSalary00110SmithJoe4000000212JonesMary5000000311JohnsonCathy4400000422JonesBob55000上面的格式仅仅存在于理论...
阅读全文
摘要:select*from[Catalog]wherename='ReportName'--ScheduleID=SSISjobIDselect*fromreportschedulewherereportidin(selectItemIDfrom[Catalog]wherename='ReportName')select*fromsubscriptionswhereSubscriptionIDin(selectSubscriptionIDfromreportschedulewherereportidin(selectItemIDfrom[Catalog]wheren
阅读全文
摘要:Non-clustered The data is present in random order, but the logical ordering is specified by the index. The data rows may be randomly spread throughout the table. The non-clustered index tree contains the index keys in sorted order, with the leaf level of the index containing the pointer to the page
阅读全文
摘要:One is who ever read <Database System Concepts>, another is who does not read it.
阅读全文
摘要:SPID - the session ID of the current user processmore, we can use column filter "Like"/"Equal"/etc.to get trace datawhat weneed.
阅读全文
摘要:A database index is a data structure that improves the speed of data retrieval operations on a database table at the cost of slower writes and increased storage space.Indexes can be created using one ...
阅读全文
摘要:浅谈MS-SQL锁机制 锁的概述 一. 为什么要引入锁 多个用户同时对数据库的并发操作时会带来以下数据不一致的问题: 丢失更新 A,B两个用户读同一数据并进行修改,其中一个用户的修改结果破坏了另一个修改的结果,比如订票系统 脏读 A用户修改了数据,随后B用户又读出该数据,但A用户因为某些原因取消了对数据的修改,数据恢复原值,此时B得到的数据就与数据库内的数据产生了不一致 不可重复读 A...
阅读全文
摘要:今天在网上看到一篇随笔,以金庸小说里的人物练剑为例,道出了一个简单的道理。说是,华山派有两派:剑宗与气宗。两派之争一直就没有停息过。直接摘一段文字过来吧。 关于两宗的,上下优劣书中有不少笔墨,无非是各执一词,各护其短。其实说白了无非是个辨证法----剑宗一味追求技巧上的繁复多变,以为真把自己手中的剑练成了能给苍蝇蚊子开膛破肚的手术刀便能无敌于天下,气宗则沉稳老练一些,别看剑宗弟子的剑花一抖一抖的...
阅读全文
摘要:在SSAS(SQL Server Analysis Services)中构建Cube和编写MDX的时候,我们很容易被一些名词弄糊涂,比如:Dimension(维度),Measures Dimension(度量维度),Measure(度量),Hierarchy(层次结构),Attribute hierarchy(属性层次结构),Level(级别),Cell(单元),Member(成员),Member...
阅读全文
摘要:本文将对MSDN中ms-help://MS.MSDNQTR.v80.en/MS.MSDN.v80/MS.NETDEV.v10.en/dnreal/html/realworld03112005.htm的用法进行改写,因为它针对的是Sql Server 2005 beta版本。The following managed database objects are supported by SQL Ser...
阅读全文
摘要:这个可能真的是个BUG,大家都可以试下: 在generate script向导下,在select database下有个选项script all object.....,如果此时勾选了,在下面出现的设置窗口里选择script version为sql server 2000,则生成的脚本在2000里运行完全正常。但如果不选这个,而是在后面选择table时勾选select all,然后在scri...
阅读全文
摘要:/*********数据库压缩方法*********//*******************************/Declare @db nvarchar(20)-- 数据库名称SET @db = 'DBName' -- 清空日志DUMP TRANSACTION @db WITH NO_LOG -- 截断事务日志BACKUP LOG @db WITH NO_LOG -- 收缩数据库DBCC...
阅读全文
摘要:set ANSI_NULLS ONset QUOTED_IDENTIFIER ONgo ALTER function f_id(@parentid int) returns @re table(orderid int,parentid int,title nvarchar(50),level int) as begin decla...
阅读全文
浙公网安备 33010602011771号