砼澆注施工高處墜落預防專項措施_第1頁
砼澆注施工高處墜落預防專項措施_第2頁
砼澆注施工高處墜落預防專項措施_第3頁
砼澆注施工高處墜落預防專項措施_第4頁
砼澆注施工高處墜落預防專項措施_第5頁
已閱讀5頁,還剩8頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領

文檔簡介

1、= quotename(table_owner)endelsebeginSELECT full_table_name = quotename(table_owner) +. + quotename(table_name)endend/* Get Object ID */SELECT table_id = object_id(full_table_name)selectTABLE_QUALIFIER = convert(sysname,db_name(),TABLE_OWNER = convert(sysname,user_name(o.uid),TABLE_NAME = convert(sys

2、name,),COLUMN_NAME = convert(sysname,),KEY_SEQ =casewhen = index_col(full_table_name, i.indid, 1) then convert (smallint,1)when = index_col(full_table_name, i.indid, 2) then convert (smallint,2)when = index_col(full_table_name, i.indid, 3) then convert (smallint,3)wh

3、en = index_col(full_table_name, i.indid, 4) then convert (smallint,4)when = index_col(full_table_name, i.indid, 5) then convert (smallint,5)when = index_col(full_table_name, i.indid, 6) then convert (smallint,6)when = index_col(full_table_name, i.indid, 7) then convert (s

4、mallint,7)when = index_col(full_table_name, i.indid, 8) then convert (smallint,8)when = index_col(full_table_name, i.indid, 9) then convert (smallint,9)when = index_col(full_table_name, i.indid, 10) then convert (smallint,10)when = index_col(full_table_name, i.indid, 11)

5、then convert (smallint,11)when = index_col(full_table_name, i.indid, 12) then convert (smallint,12)when = index_col(full_table_name, i.indid, 13) then convert (smallint,13)when = index_col(full_table_name, i.indid, 14) then convert (smallint,14)when = index_col(full_table

6、_name, i.indid, 15) then convert (smallint,15)when = index_col(full_table_name, i.indid, 16) then convert (smallint,16)end,PK_NAME = convert(sysname,)fromsysindexes i, syscolumns c, sysobjects o -, syscolumns c1whereo.id = table_idand o.id = c.idand o.id = i.idand (i.status & 0 x800) =

7、0 x800and ( = index_col (full_table_name, i.indid, 1) = index_col (full_table_name, i.indid, 2) = index_col (full_table_name, i.indid, 3) = index_col (full_table_name, i.indid, 4) = index_col (full_table_name, i.indid, 5) = index_col (full_table_nam

8、e, i.indid, 6) = index_col (full_table_name, i.indid, 7) = index_col (full_table_name, i.indid, 8) = index_col (full_table_name, i.indid, 9) = index_col (full_table_name, i.indid, 10) = index_col (full_table_name, i.indid, 11) = index_col (full_t

9、able_name, i.indid, 12) = index_col (full_table_name, i.indid, 13) = index_col (full_table_name, i.indid, 14) = index_col (full_table_name, i.indid, 15) = index_col (full_table_name, i.indid, 16)order by 1, 2, 3, 5gogrant execute on sp_pkeys to publicgodump tran m

10、aster with no_loggoprint creating sp_server_infogocreate proc sp_server_info (attribute_id int = null)asif attribute_id is not nullselect *where attribute_id = attribute_idelseselect *order by attribute_idgogrant execute on sp_server_info to publicgodump tran master with no_loggoprint creating sp_sp

11、ecial_columnsgo/* Procedure for pre-6.0 server */CREATE PROCEDURE sp_special_columns (table_name varchar(32),table_owner varchar(32) = null,table_qualifier varchar(32) = null,col_type char(1) = R,scope char(1) = T,nullable char(1) = U,ODBCVer int = 2)ASDECLARE indid intDECLARE table_id intDECLARE fu

12、ll_table_name varchar(65) /* 2*32+1 */DECLARE scopeout smallintif col_type not in (R,V) or col_type is nullbeginraiserror 20002 Rush_42returnendif scope = Cselect scopeout = 0else if scope = Tselect scopeout = 1elsebeginraiserror 20002 Rush_43returnendif nullable not in (U,O) or nullable is nullbegi

13、nraiserror 20002 Rush_44returnendif table_qualifier is not nullbeginif db_name() table_qualifierbegin /* If qualifier doesnt match current database */raiserror 20001 Rush_5returnendendif table_owner is nullbegin /* If unqualified table name */SELECT full_table_name = table_nameendelsebegin /* Qualif

14、ied table name */SELECT full_table_name = table_owner + . + table_nameend/* Get Object ID */SELECT table_id = object_id(full_table_name)if col_type = VBEGIN /* if ROWVER, just run that query */SELECTSCOPE = convert(smallint,NULL),COLUMN_NAME = convert(varchar(32),),DATA_TYPE = convert(smallint

15、, -3),TYPE_NAME = ,PRECISION = convert(int,8),LENGTH = convert(int,8),SCALE = convert(smallint, NULL),PSEUDO_COLUMN = convert(smallint,1)FROMsystypes t, syscolumns cWHEREc.id = table_idAND c.usertype = 80 /* TIMESTAMP */AND t.usertype = 80 /* TIMESTAMP */RETURNEND/* ROWID, now find the id of t

16、he best index for this table */IF nullable = O /* Dont include any indexes that containnullable columns. */SELECT indid = MIN(indid)FROM sysindexes i,syscolumns c,syscolumns c2WHEREi.status&2 = 2 /* If Unique Index */AND c.id = i.idAND c2.id = c.idAND c2.colid 0 /* Eliminate Table Row */AND =

17、 index_col(table_name,i.indid,c2.colid)GROUP BY indid HAVING SUM(c.status&8) = 0ELSE /* Include indexes that are partially nullable. */SELECT indid = MIN(indid)FROM sysindexes iWHEREstatus&2 = 2 /* If Unique Index */AND id = table_idAND indid 0 /* Eliminate Table Row */SELECTSCOPE = scopeout,COLUMN_

18、NAME = convert(varchar(32),INDEX_COL(full_table_name,indid,c2.colid),d.DATA_TYPE,TYPE_NAME = ,PRECISION = isnull(d.data_precision, convert(int,c.length),LENGTH = isnull(d.length, convert(int,c.length),SCALE = d.numeric_scale,PSEUDO_COLUMN = convert(smallint,1)FROMsysindexes x,syscolumns c,mast

19、er.dbo.spt_datatype_info d,systypes t,syscolumns c2 /* Self-join to generate list of index columns and */* to extract datatype names */WHEREx.id = table_idAND = INDEX_COL(full_table_name,indid,c2.colid)AND c.id = x.idAND c2.id = x.idAND c2.colid keycnt+(x.status&16)/16AND x.indid = indidAND t

20、.type = d.ss_dtypeAND c.length = d.fixlenAND c.usertype = t.usertypegoif (charindex(6.00, version) = 0 andcharindex(6.50, version) = 0 andcharindex(7.00, version) = 0 andcharindex(8.00, version) = 0)beginprint print print Warning:print you are installing the stored procedures print on a pre 6.0 SQL

21、Server.print Ignore the following errors.endelsedrop proc sp_special_columnsgo/* Procedure for 6.0 and 6.50 servers */CREATE PROCEDURE sp_special_columns (table_name varchar(32),table_owner varchar(32) = null,table_qualifier varchar(32) = null,col_type char(1) = R,scope char(1) = T,nullable char(1)

22、= U,ODBCVer int = 2)ASDECLARE indid intDECLARE table_id intDECLARE full_table_name varchar(65) /* 2*32+1 */DECLARE scopeout smallintif col_type not in (R,V) or col_type is nullbeginraiserror (15251,-1,-1,col_type,R or V)returnendif scope = Cselect scopeout = 0else if scope = Tselect scopeout = 1else

23、beginraiserror (15251,-1,-1,scope,C or T)returnendif nullable not in (U,O) or nullable is nullbeginraiserror (15251,-1,-1,nullable,U or O)returnendif table_qualifier is not nullbeginif db_name() table_qualifierbegin /* If qualifier doesnt match current database */raiserror (15250, -1,-1)returnendend

24、if table_owner is nullbegin /* If unqualified table name */SELECT full_table_name = table_nameendelsebegin /* Qualified table name */SELECT full_table_name = table_owner + . + table_nameend/* Get Object ID */SELECT table_id = object_id(full_table_name)if col_type = VBEGIN /* if ROWVER, just run that

25、 query */SELECTSCOPE = convert(smallint,NULL),COLUMN_NAME = convert(varchar(32),),DATA_TYPE = convert(smallint, -2),TYPE_NAME = ,PRECISION = convert(int,8),LENGTH = convert(int,8),SCALE = convert(smallint, NULL),PSEUDO_COLUMN = convert(smallint,1)FROMsystypes t, syscolumns cWHEREc.id = t

26、able_idAND c.usertype = 80 /* TIMESTAMP */AND t.usertype = 80 /* TIMESTAMP */RETURNEND/* ROWID, now find the id of the best index for this table */IF nullable = O /* Dont include any indexes that containnullable columns. */SELECT indid = MIN(indid)FROM sysindexes i,syscolumns c,syscolumns c2WHEREi.s

27、tatus&2 = 2 /* If Unique Index */AND c.id = i.idAND c2.id = c.idAND c2.colid 0 /* Eliminate Table Row */AND = index_col(table_name,i.indid,c2.colid)GROUP BY indid HAVING SUM(c.status&8) = 0ELSE /* Include indexes that are partially nullable. */SELECT indid = MIN(indid)FROM sysindexes iWHEREst

28、atus&2 = 2 /* If Unique Index */AND id = table_idAND indid 0 /* Eliminate Table Row */SELECTSCOPE = scopeout,COLUMN_NAME = convert(varchar(32),INDEX_COL(full_table_name,indid,c2.colid),d.DATA_TYPE,convert(varchar(32),casewhen (t.usertype 100 or t.usertype in (18,80)then else d.TYPE_NAMEend) TY

29、PE_NAME,convert(int,casewhen d.DATA_TYPE in (6,7) then d.data_precision /* FLOAT/REAL */else isnull(convert(int,c.prec), 2147483647)end) PRECISION,convert(int,casewhen d.ss_dtype IN (106, 108, 55, 63) then /* decimal/numeric types */convert(int,c.prec+2)elseisnull(d.length, c.length)end) LENGTH,SCAL

30、E = convert(smallint, c.scale),PSEUDO_COLUMN = convert(smallint,1)FROMsysindexes x,syscolumns c,master.dbo.spt_datatype_info d,systypes t,syscolumns c2 /* Self-join to generate list of index columns and */* to extract datatype names */WHEREx.id = table_idAND = INDEX_COL(full_table_name,indid,

31、c2.colid)AND c.id = x.idAND c2.id = x.idAND c2.colid x.keycnt+(x.status&16)/16AND x.indid = indidAND t.type = d.ss_dtypeAND (d.ODBCVer is null or d.ODBCVer = ODBCVer)AND isnull(d.AUTO_INCREMENT,0) = (c.status&128)/128AND c.usertype = t.usertypegoif (charindex(7.00, version) = 0 andcharindex(8.00, ve

32、rsion) = 0)beginprint print print Warning:print you are installing the stored procedures print on a pre 7.0 SQL Server.print Ignore the following errors.endelsedrop proc sp_special_columnsgo/* Procedure for 7.0 servers */CREATE PROCEDURE sp_special_columns (table_name sysname,table_owner sysname = n

33、ull,table_qualifier sysname = null,col_type char(1) = R,scope char(1) = T,nullable char(1) = U,ODBCVer int = 2)ASDECLARE indid intDECLARE table_id intDECLARE full_table_name nvarchar(257)DECLARE scopeout smallintif col_type not in (R,V) or col_type is nullbeginraiserror (15251,-1,-1,col_type,R or V)

34、returnendif scope = Cselect scopeout = 0else if scope = Tselect scopeout = 1elsebeginraiserror (15251,-1,-1,scope,C or T)returnendif nullable not in (U,O) or nullable is nullbeginraiserror (15251,-1,-1,nullable,U or O)returnendif table_qualifier is not nullbeginif db_name() table_qualifierbegin /* I

35、f qualifier doesnt match current database */raiserror (15250, -1,-1)returnendendif table_owner is nullbegin /* If unqualified table name */SELECT full_table_name = quotename(table_name)endelsebegin /* Qualified table name */if table_owner = begin /* If empty owner name */SELECT full_table_name = quo

36、tename(table_owner)endelsebeginSELECT full_table_name = quotename(table_owner) +. + quotename(table_name)endend/* Get Object ID */SELECT table_id = object_id(full_table_name)if col_type = VBEGIN /* if ROWVER, just run that query */SELECTSCOPE = convert(smallint,NULL),COLUMN_NAME = convert(sysname,c.

37、name),DATA_TYPE = convert(smallint, -2),TYPE_NAME = ,PRECISION = convert(int,8),LENGTH = convert(int,8),SCALE = convert(smallint, NULL),PSEUDO_COLUMN = convert(smallint,1)FROMsystypes t, syscolumns cWHEREnot (table_id is null)AND c.id = table_idAND = timestamp /* TIMESTAMP */AND t.xtype

38、 = c.xtypeAND t.xusertype = c.xusertypeRETURNEND/* ROWID, now find the id of the best index for this table */IF nullable = O /* Dont include any indexes that containnullable columns. */SELECT indid = MIN(indid)FROM sysindexes x, syscolumns c, syscolumns c2WHEREnot (table_id is null)AND x.status&2 =

39、2 /* If Unique Index */AND c.id = x.idAND c2.id = c.idAND c2.colid 0 /* Eliminate Table Row */AND = index_col(table_name,x.indid,c2.colid)GROUP BY indid HAVING SUM(c.status&8) = 0ELSE /* Include indexes that are partially nullable. */SELECT indid = MIN(indid)FROM sysindexes xWHEREnot (table_i

40、d is null)AND status&2 = 2 /* If Unique Index */AND id = table_idAND indid 0 /* Eliminate Table Row */SELECTSCOPE = scopeout,COLUMN_NAME = convert(sysname,INDEX_COL(full_table_name,indid,c2.colid),d.DATA_TYPE,convert(sysname,casewhen t.xusertype 255 then else d.TYPE_NAMEend) TYPE_NAME,convert(

41、int,casewhen d.DATA_TYPE in (6,7) then d.data_precision /* FLOAT/REAL */else OdbcPrec(c.xtype,c.length,c.xprec)end) PRECISION,convert(int,casewhen type_name(d.ss_dtype) IN (numeric,decimal) then /* decimal/numeric types */OdbcPrec(c.xtype,c.length,c.xprec)+2else isnull(d.length, c.length)end) LENGTH

42、,SCALE = convert(smallint, OdbcScale(c.xtype,c.xscale),PSEUDO_COLUMN = convert(smallint,1)FROMsysindexes x,syscolumns c,master.dbo.spt_datatype_info d,systypes t,syscolumns c2 /* Self-join to generate list of index columns and */* to extract datatype names */WHEREnot (table_id is null)AND x.id = tab

43、le_idAND = INDEX_COL(full_table_name,indid,c2.colid)AND c.id = x.idAND c2.id = x.idAND c2.colid x.keycnt + (x.status&16)/16AND x.indid = indidAND t.xtype = d.ss_dtypeAND (d.ODBCVer is null or d.ODBCVer = ODBCVer)AND isnull(d.AUTO_INCREMENT,0) = isnull(ColumnProperty (c.id, , IsIdentity)

44、,0)AND c.xusertype = t.xusertypegoif (charindex(8.00, version) = 0)beginprint print print Warning:print you are installing the stored procedures print on a pre 8.0 SQL Server.print Ignore the following errors.endelsedrop proc sp_special_columnsgo/* Procedure for 8.0 and later servers */CREATE PROCEDURE sp_special_columns (table_name sysname,table_owner sysname = null,table_qualifier sysname = null,col_type char(1) = R,sco

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論