随笔分类 -  数据库部分

摘要:Sql Server 中一个非常强大的日期格式化函数Select CONVERT(varchar(100), GETDATE(), 0): 05 16 2006 10:57AMSelect CONVERT(varchar(100), GETDATE(), 1): 05/16/06Select CON... 阅读全文
posted @ 2015-10-30 16:02 吴枫 阅读(470) 评论(0) 推荐(0)
摘要:SQL查询优化维护项目时,需要加载某页面,总共加载也就4000多条数据,竟然需要35秒钟,要是数据增长到40000条,我估计好几分钟都搞不定。卧槽,要我是用户的话估计受不了,趁闲着没事,就想把它优化一下,走你。 先把查询贴上: 1.select Pub_AidBasicInformation.Aid... 阅读全文
posted @ 2015-07-28 14:19 吴枫 阅读(270) 评论(0) 推荐(0)
摘要:使用distinct 函数获取DataFromCountry 字段不同的值select distinct DataFromCountry from PAP_Selloutselect distinct DataFromCountry from PAP_Inventory 阅读全文
posted @ 2015-01-28 11:27 吴枫 阅读(170) 评论(0) 推荐(0)
摘要:C#开发命名规范 1. 定义 Pascal大写:一种大小写形式,所有单词第一个字母大写,其他字母小写。 Camel 大写:一种大小写形式,除了第一个单词,所有单词第一个字母大写,其 他字母小写。 例:HelloWorld(Pascal大写),helloWorld(Camel 大写)。 Camel ... 阅读全文
posted @ 2015-01-26 10:26 吴枫 阅读(314) 评论(0) 推荐(0)
摘要:简单的方法想日志中追加内容public static void updateSql(string Name,string str) { FileStream fs = new FileStream(@"D:\Acer\logSql.txt", FileMode.A... 阅读全文
posted @ 2015-01-23 15:21 吴枫 阅读(203) 评论(0) 推荐(0)
摘要:一些参考案例下面是一些常用的ftp操作文件的方法案列1using System;using System.Collections.Generic;using System.Text;using System.IO;using System.Net;using System.Windows.Forms... 阅读全文
posted @ 2015-01-21 17:54 吴枫 阅读(627) 评论(0) 推荐(0)
摘要:使用Epplus方法把sql数据库中表的数据导出到excel中去:需要使用EPPlus.dll引用。using System.IO;using OfficeOpenXml; public static string Create(string[] tables) { ... 阅读全文
posted @ 2014-12-03 14:01 吴枫 阅读(513) 评论(0) 推荐(0)
摘要:我们操作数据库大量数据时,可能会出现死锁现象。所谓死锁: 是指两个或两个以上的进程在执行过程中,因争夺资源而造成的一种互相等待的现象,若无外力作用,它们都将无法推进下去。此时称系统处于死锁状态或系统产生了死锁,这些永远在互相等待的进程称为死锁进程。 由于资源占用是互斥的,当某个进程提出申请资源后,使... 阅读全文
posted @ 2014-08-19 17:42 吴枫 阅读(474) 评论(1) 推荐(1)
摘要:使用游标例--table1结构如下id intname varchar(50)declare @id intdeclare @name varchar(50)declare cursor1 cursor for --定义游标cursor1select * from table... 阅读全文
posted @ 2014-08-15 16:40 吴枫 阅读(182) 评论(0) 推荐(0)