关于SQLite
摘要:1. 官网:http://www.sqlite.org/2. 初步看了一下,就是SQLite轻量级级,可用于10w日点击量级别的网站,但太高并发就不行了,另外只能用于单机。 适用场合详见:http://www.sqlite.org/whentouse.html3. 速用教程:http://www.cnblogs.com/achun8011/archive/2011/03/03/1970246.html
阅读全文
SQL SERVER – Difference Between Union vs. Union All – Optimal Performance Comparison
摘要:More than a year ago I had written articleSQL SERVER – Union vs. Union All – Which is better for performance?I have got many request to update this article. It is not fair to update already written article so I am rewriting it again with additional information.UNIONThe UNION command is used to selec
阅读全文
Error while creating db diagram:Cannot insert NULL into column diagram_id
摘要:Run the script:ALTER table [dbo].[sysdiagrams]DROP COLUMN [diagram_id]ALTER table [dbo].[sysdiagrams]ADD [diagram_id] [int] NOT NULL IDENTITY (1, 1)
阅读全文
char、varchar、text和nchar、nvarchar、ntext的区别
摘要:很多开发者进行数据库设计的时候往往并没有太多的考虑char, varchar类型,有的是根本就没注意,因为存储价格变得越来越便宜了,忘记了最开始的一些基本设计理论和原则,这点让我想到了现在的年轻人,大手一挥 一把人民币就从他手里溜走了,其实我想不管是做人也好,做开发也好,细节的把握直接决定很多东西。当然还有一部分人是根本就没弄清楚他们的区别,也就随便 选一个。在这里我想对他们做个简单的分析,当然...
阅读全文
SQL Server全程
摘要:Student(S#,Sname,Sage,Ssex) 学生表 Course(C#,Cname,T#) 课程表 SC(S#,C#,score) 成绩表 Teacher(T#,Tname) 教师表 问题: 1、查询“001”课程比“002”课程成绩高的所有学生的学号; select a.S# from (select s#,score from SC...
阅读全文
SQL Server多个字段分组后排序取top
摘要:想写一个SQL, 先分组(2个字段组合)再排序取出前N条记录, 用tnd的top n ... group by ... order by ...死活完不成这个任务, 郁闷了半天! 最终有2个方法来解决:1. 一精通SQL Server的朋友帮忙弄了一个function,利用游标装载2个字段中的1个字段能够出现的所有值(distinct),然后来top、group,所有select出的数据union...
阅读全文
Import data from files to SQL Server(用BULK INSERT命令导入数据详解)
摘要:本文将为大家演示如何利用BULKINSERT命令来导入数据,并讲解怎样通过改变该命令的一些选项以便更方便且更有效地插入数据。 BULKINSERT 在SQLServer中,BULKINSERT是用来将外部文件以一种特定的格式加载到数据库表的T-SQL命令。该命令使开发人员能够直接将数据加载到数据库表中,而不需要使用类似于IntegrationServices这样的外部程序。虽然BULKINSE...
阅读全文
Bulk insert & Bulk update
摘要:1. Bulk Copy OperationIntroductionBulk copying of data from one data source to another data source is a new feature added to ADO.NET 2.0. Bulk copy classes provide the fastest way to transfer a set of...
阅读全文