SQL
曾国藩
虽然现在我是个菜鸟但是我终究会变成大神的
展开
-
建立sql数据字典的
select [表名]=c.Name, [表说明]=isnull(f.[value],''), [列名]=a.Name, [列序号]=a.Column_id, [标识]=case when is_identity=1 then '√' else '' end, [主键]=case when exists(sele转载 2014-05-12 16:32:53 · 765 阅读 · 0 评论 -
sql中的类型转换和拼接sql
declare @count int ,@CatayCode varchar(50)set @count =(select COUNT(CatayCode) from item where ParentId=20)if @count=0beginset @CatayCode=( select CatayCode from item where id=20)+'001'end转载 2014-05-20 23:32:05 · 419 阅读 · 0 评论 -
分支于句
SELECT ActivityID , Title , IsRelease , CarrierType , CarrierID , CarrierValue = ( CASE WHEN CarrierType = 1 THEN ( SELECT转载 2014-05-23 17:17:56 · 346 阅读 · 0 评论 -
数据库中空的时间处理
public string CompleteDateValue { get { return (CompleteDate.ToString("yyyy-MM-dd") == "1900-01-01" || CompleteDate.ToString("yyyy-MM-dd") == "0001-01-01") ? "" : CompleteDate.To转载 2014-05-23 14:48:03 · 526 阅读 · 0 评论 -
分页sql
DECLARE @sql NVARCHAR(max) SET @sql=' ;WITH orderList AS( SELECT ROW_NUMBER() OVER ( ORDER BY ' + @OrderBy + ' ) AS Row , ca.ArticleId ,原创 2014-05-23 16:51:14 · 327 阅读 · 0 评论 -
存储过程
USE [IFCANet_R2_8_ZH_FMS]GO/****** Object: StoredProcedure [dbo].[Proc_FM_AnalyseOfBudget] Script Date: 06/20/2014 14:06:38 ******/SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGO转载 2014-06-20 14:08:44 · 459 阅读 · 0 评论