首先看看Left Join 与Right Join 与 Inner Join 与 Full Join对表进行操作后得到的结果。在数据库中新建两张表,并插入要测试的数据。新建表:[sql] USE[Test]GO/******对象:Table[dbo].[EMP]******/SETANSI_NULL...
分类:
数据库 时间:
2014-08-27 12:43:07
阅读次数:
252
CREATE TABLE [dbo].[GoodsCategories]( [ID] [int] NOT NULL, [ClassName] [nvarchar](20) NOT NULL, [ParentID] [int] NOT NULL, [Depth] [int] NOT NULL, [Ro...
分类:
其他好文 时间:
2014-08-27 12:27:37
阅读次数:
241
在SQLServer,触发器,插入、更新、删除状态:CREATE TRIGGER t_inms_alarms ON [PHS].[dbo].[AlarmCurrent] FOR INSERT, DELETE AS DECLARE @rows int SELECT @rows = @@ro...
分类:
数据库 时间:
2014-08-26 16:56:36
阅读次数:
210
--Parent-Child reationship--涂聚文 2014-08-25--得位置的子節點函數表(包含本身)if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[GetBookPlaceChildren...
分类:
数据库 时间:
2014-08-25 16:59:04
阅读次数:
269
--Description: 字符处理 --使用: 放到查询分析器里执行就可以了 --示例: select * from dbo.splitstr('12 44 45 50 56 87',' ') order by F1 asc --ALTER function split...
分类:
数据库 时间:
2014-08-25 16:19:24
阅读次数:
201
--提取分页数据,返回总记录数 ALTER procedure [dbo].[sp_Common_GetDataPaging_ReturnDataCount] ( @SqlString varchar(max), --查询语句 @PageNumber int, --当前的页码 @Pa...
分类:
数据库 时间:
2014-08-25 11:31:24
阅读次数:
223
CREATE PROCEDURE [dbo].[GoodsCategories_Insert]@parentId int, --父类Id@className nvarchar(50) --分类名称ASBEGIN SET NOCOUNT ON; --不返回计数(表示受 Transact-SQL 语句影...
分类:
其他好文 时间:
2014-08-25 09:56:34
阅读次数:
181
--更新约束alter TABLE [dbo].[Sk_Recruit]dropconstraintDF_Sk_Recruit_lastcommenttimegoalter TABLE [dbo].[Sk_Recruit]addconstraintDF_Sk_Recruit_lastcommentt...
分类:
其他好文 时间:
2014-08-21 09:37:13
阅读次数:
184
declare @time datetimedeclare @ms intset @time= getdate()select ID,name from (select row_number() over(order by ID) as rowNum,* from dbo.testb) as t ....
分类:
数据库 时间:
2014-08-20 21:00:33
阅读次数:
191
一张表保存一个无限级树形目录:/****** Object: Table [dbo].[TreeMenue] Script Date: 08/20/2014 18:03:00 ******/SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOSET AN...
分类:
其他好文 时间:
2014-08-20 19:26:42
阅读次数:
491