摘要: IF(OBJECT_ID('tempdb..#Books') IS NOT NULL) BEGIN DROP TABLE #Books;END CREATE TABLE #Books (BookName NVARCHAR(20),BookCode NVARCHAR(20))INSERT INTO #Books( BookName, BookCode ) VALUES(N'C# 本质论','JC556874');INSERT INTO #Books( BookName, BookCode ) VALUES(N'JS 本质论', 阅读全文
posted @ 2011-10-24 15:18 踏歌长行 阅读(152) 评论(0) 推荐(0) 编辑
摘要: --先申明个变量 。DECLARE @Num INT;SET @Num=0; 1. IF 语句IF(@Num=0)BEGIN PRINT('Num value is '+CAST(@Num AS VARCHAR(4)));END 2. WHILE 语句(当......的时候,执行循环体)WHILE(@Num0)BEGIN PRINT('Num value is '+CAST(@Num AS VARCHAR(4)));END 3. CASE 语句(特殊)--创建测试临时表IF(OBJECT_ID('tempdb..#Books') IS NOT N 阅读全文
posted @ 2011-10-24 10:42 踏歌长行 阅读(260) 评论(0) 推荐(0) 编辑
摘要: --创建测试临时表IF(OBJECT_ID('tempdb..#Books') IS NOT NULL) BEGIN DROP TABLE #Books;ENDCREATE TABLE #Books ( BookName NVARCHAR(20), BookCode NVARCHAR(20))INSERT INTO #Books( BookName, BookCode ) VALUES(N'C# 本质论','JC556874');INSERT INTO #Books( BookName, BookCode ) VALUES(N'JS 本质 阅读全文
posted @ 2011-10-24 09:48 踏歌长行 阅读(204) 评论(0) 推荐(0) 编辑