随笔分类 - T-SQL
摘要:[转] http://www.cnblogs.com/luxh/archive/2012/10/15/2724091.html
阅读全文
摘要:select * into linshi from OpenRowset('MSDASQL', 'Driver={Microsoft Text Driver (*.txt; *.csv)};DefaultDir=F:\web\;','select sCode from 1.txt')
阅读全文
摘要:http://kb.cnblogs.com/page/103975/
阅读全文
摘要:http://blog.csdn.net/kk185800961/article/details/45568511
阅读全文
摘要:http://www.cnblogs.com/maanshancss/archive/2013/03/13/2957108.html
阅读全文
摘要:http://www.cnblogs.com/CareySon/archive/2012/03/07/2383690.html
阅读全文
摘要:http://bbs.csdn.net/topics/390888927
阅读全文
摘要:http://database.51cto.com/art/201106/271889.htm
阅读全文
摘要:http://www.cnblogs.com/oneivan/archive/2012/02/16/2353796.html [转]
阅读全文
摘要:use [New_BeiJingGuoMaoGame_www.bjifeicuiedu.com_1_new]go with list as( SELECT ROW_NUMBER() OVER(order by Id) AS num,* FROM dbo.FcArticle )select * fro
阅读全文
摘要:SELECT top 2 *FROM dbo.AdsFOR XML AUTO, ELEMENTSselect * from 表名 for XML auto 以下是详细介绍: FOR 子句 FOR 子句用于指定 BROWSE 或 XML 选项(BROWSE 和 XML 是不相关的选项)。 语法 [ FOR { BROWSE | XML { RAW | AUTO | EXPLICIT } [ , XMLDATA ] [ , ELEMENTS ] [ , BINARY BASE64 ] } ] 参数 BROWSE 指定当查看 DB-Library 浏览模式游标中的数据...
阅读全文
摘要://视图创出自动增张列,相当于增加了一张表select id=identity(int,1,1),* into NoEntryScore_Select from dbo.View_NoEntryScore_Select//查询“增加完自增列”后的表select * from View_NoEntryScore_Select//删除增加的表drop table View_NoEntryScore_Select
阅读全文
摘要:SQL中常用的批量处理可以通过事务、循环语句、批量处理语句以及存储过程等方式实现,比较常用而且简单是事务、循环语句和批量处理语句,下面重点介绍! 1、事务 程序中批量执行SQL语句时可以通过事务保证执行任务的完整性!实例代码如下: CDatebasem_myDB;m_myDB.Open(....);...if(!m_myDB.BeginTrans())//开始事务returnFALSE;try{//批量处理语句m_myDB.ExecuteSQL(strSQL1);m_myDB.ExecuteSQL(strSQL2);...m_myDB.CommitTrans();//提交事务}catch(C.
阅读全文
摘要:自动生成分页存储过程http://www.webdiyer.com/Controls/AspNetPager/SpGenerator
阅读全文
摘要:1. select ... into new_tablename where ... 2. insert (into) old_tablename select ... from ... where ... 区别是前者把数据插入一个新表(先建立表,再插入数据),后者是把数据插入已经存在的一个表中,我个人喜欢后者,因为在编程的结构上,应用的范围上,第二条语句强于前者。 (注意 如果包含主键则报"仅当使用了列列表并且 IDENTITY_INSERT 为 ON 时,才能为表'dbo.fuzhi'中的标识列指定显式值。"这个错误)
阅读全文
摘要:USE [TCM_Channels]GO/****** Object: Test_Kind[dbo].[pro_Test_Kind_Select_Page] Script Date: 07/20/2010 09:24:49 ******/SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGO-- =================================...
阅读全文
摘要:Alter PROCEDURE GetResInfo --注意数据类型 @BuildBasicID int =null, @CompanyName VARCHAR(80)=null AS declare @sql varchar(8000) set @sql='' if @BuildBasicID is not null BEGIN SET @sql=@sql +' and Buil...
阅读全文
摘要:delete from dbo.CompanyInfo where CompanyName in (select CompanyName from CompanyInfo group by CompanyName having count(CompanyName) > 1) and CompanyID not in (select min(CompanyID) from CompanyInf...
阅读全文

浙公网安备 33010602011771号