【關於外鍵約束的一些常見問題】 /********************************************************************Author:js_szyDate:2010-11-08 Version: Microsoft SQL Server 2005 - 9.00.1399.06 (Intel X86) Oct 14 2005 00:33:37 Copyright (c) 1988-2005 Microsoft
if object_id('Tempdb..#Roy') is not nulldrop table #Roycreate table #Roy (a int,b varchar(10),c int,d int)insert #Royselect 1, '小李', 1, 2 union allselect 2, '小王', 4, 5 union all select 1, '小李', 3, 4 union allselect 2, '小王', 6,
create table ta(number int)create trigger test_tr on tafor insertasbeginDECLARE @number int,@sql varchar(4000),@sql1 varchar(4000),@i intDECLARE roy CURSORFOR SELECT * from insertedOPEN royFETCH next FROM roy into @numberWHILE @@FETCH_STATUS =
---產生測試表Tif exists(select 1 from sysobjects where Name=N'T' and objectProperty(ID,N'IsUserTable')=1) drop table Tgoselect top 5 ID,Name into T from sysobjectsgo方法1:--建立輸出遊標變數的預存程序:create procedure P_cursor( @Roy_Test cur
源頁面代碼:Protected Sub Button4_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button4.Click Dim url As String url = "default3.aspx?name=" + TextBox1.Text + "&password=" + TextBox2.Text Response.Redirect(url)
use testgo--產生測試臨時表#if not object_id('Tempdb..#')is null drop table #select top 35 [Name]=cast( [Name] as nvarchar(50)) into # from syscolumns where Name>''-----35行分6列顯示select *from (select Name, [Ntile],
create table Student ( sno varchar(10) not null unique, sname varchar(8) not null, sex char(2), age int not null, //加上非空限制 dept varchar(20), constraint C_age default 20 for age, constraint C_sex check(sex in ('男','女')) ) go create table Studp145ent(
--> --> (Roy)產生測試數據 if not object_id('Class') is null drop table ClassGoCreate table Class([Student] nvarchar(2),[數學] int,[物理] int,[英語] int,[語文] int)Insert Classselect N'李四',77,85,65,65 union allselect N'張三',87,90,82,78godeclare @s nvarchar(
方式一:--利用SQL未公開的預存程序實現分頁 if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[p_splitpage]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) drop procedure [dbo].[p_splitpage] GO create
--> --> (Roy)產生測試數據set nocount on ;if not object_id('Tempdb..#T') is null drop table #TGoCreate table #T([Num] int,[Name] nvarchar(1))Insert #Tselect 1,N'A' union allselect 1,N'A' union allselect 2,N'B' union allselect 2,N'B'go--Delete;with
net use ---列出本機網路連接 net use \\IP\ipc$ "密碼" /user:"帳號" ---建立與指定IP的IPC$(空串連) net use z: \\IP\c$ "密碼" /user:"帳號" ---將對方的c盤映射為自己的z盤 net use \\IP\ipc$ /del--- 刪除與指定IP的IPC$串連 net use z: /del--- 刪除本機映射的z盤 net use * /del--- 刪除本機所有映射和IPC$串連