![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
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 · 770 阅读 · 0 评论 -
sql中的类型转换和拼接sql
declare @count int ,@CatayCode varchar(50) set @count =(select COUNT(CatayCode) from item where ParentId=20) if @count=0 begin set @CatayCode=( select CatayCode from item where id=20)+'001' end转载 2014-05-20 23:32:05 · 422 阅读 · 0 评论 -
分支于句
SELECT ActivityID , Title , IsRelease , CarrierType , CarrierID , CarrierValue = ( CASE WHEN CarrierType = 1 THEN ( SELECT转载 2014-05-23 17:17:56 · 348 阅读 · 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 · 538 阅读 · 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 · 329 阅读 · 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 ON GO SET QUOTED_IDENTIFIER ON GO转载 2014-06-20 14:08:44 · 479 阅读 · 0 评论