-
use CNIPMI_PRESTAGE
go
SELECT d.name tableName,
a.colorder AS colorder,
't.'+ a.name + ',' AS columnName,
a.name + ',' AS columnName
FROM dbo.syscolumns a ,dbo.sysobjects d
where a.id = d.id
AND d.xtype = 'U'
and d.name = 'ORDUPM'
ORDER BY d.name, a.colorder
--------------------------------------------------------------------------------------------------------
use STAGE
go
declare @tablename varchar(100)
declare @procedurename varchar(100)
declare @tablealias varchar(10)
begin
set @tablename = 'ORDUNA'
set @tablealias = 'na.'
set @procedurename = 'USP_INCRLOAD_POLICYBANK_NEW_CNCI'
select distinct
a.name,
c.tablename,
c.columnname
from dbo.sysobjects a,
(select distinct t1.id,t2.name as tablename,t3.name as columnname
from dbo.syscomments t1,CNCI_PRESTAGE_CVM.dbo.sysobjects t2,CNCI_PRESTAGE_CVM.dbo.syscolumns t3
where upper(t1.text) like upper('%' + @tablealias + t3.name + '%')
and t2.id = t3.id
and t2.name = @tablename
and t2.type = 'U') c
where a.type = 'P'
and a.name = @procedurename
and a.id = c.id
order by a.name,c.tablename,c.columnname
end
--------------------------------------------------------------------------------------------
body { margin: 0 0 0 0; padding:0 0 0 0 }td,div { font-family:Tahoma;font-size:8pt;vertical-align:top }body { margin: 0 0 0 0; padding:0 0 0 0 }.transcript. { background-color:#d2d2d2; }.messageBlock { margin-left:4px; margin-bottom:3px }.message { margin-left:100px; word-wrap:break-word; white-space:-moz-pre-wrap; _white-space:pre; }.messageCont { margin-left:100px; word-wrap:break-word; white-space:-moz-pre-wrap; _white-space:pre;}.other { color:#39577a;vertical-align:top;font-weight:bold;font-style.:normal;float:left; width:95px; }.myself { color:#da8103;font-style.:normal;font-weight:bold;font-style.:normal;float:left; width:95px; }.otherCont { font-size:8px;text-align:right; color:#39577a;font-family:Arial,Lucida Grande;font-style.:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }.myselfCont { font-size:8px;text-align:right; color:#da8103;font-family:Arial,Lucida Grande;font-style.:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }.system { margin-left:4px; word-wrap:break-word;color:#da8103;font-style.:normal;font-weight:normal; white-space:-moz-pre-wrap; _white-space:pre; }.showTimestamp { margin-right:3px; float:right; color:#999999;font-style.:normal;font-weight:normal; }.other1 { color:#ac2000;vertical-align:top;font-weight:bold;font-style.:normal;float:left; width:95px; }.otherCont1 { font-size:8px;text-align:right; color:#ac2000;font-family:Arial,Lucida Grande;font-style.:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }.other2 { color:#3c9fa8;vertical-align:top;font-weight:bold;font-style.:normal;float:left; width:95px; }.otherCont2 { font-size:8px;text-align:right; color:#3c9fa8;font-family:Arial,Lucida Grande;font-style.:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }.other3 { color:#e25614;vertical-align:top;font-weight:bold;font-style.:normal;float:left; width:95px; }.otherCont3 { font-size:8px;text-align:right; color:#e25614;font-family:Arial,Lucida Grande;font-style.:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }.other4 { color:#0b6ac8;vertical-align:top;font-weight:bold;font-style.:normal;float:left; width:95px; }.otherCont4 { font-size:8px;text-align:right; color:#0b6ac8;font-family:Arial,Lucida Grande;font-style.:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }.other5 { color:#b23290;vertical-align:top;font-weight:bold;font-style.:normal;float:left; width:95px; }.otherCont5 { font-size:8px;text-align:right; color:#b23290;font-family:Arial,Lucida Grande;font-style.:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }.other6 { color:#02e7c7;vertical-align:top;font-weight:bold;font-style.:normal;float:left; width:95px; }.otherCont6 { font-size:8px;text-align:right; color:#02e7c7;font-family:Arial,Lucida Grande;font-style.:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }.other7 { color:#5b3284;vertical-align:top;font-weight:bold;font-style.:normal;float:left; width:95px; }.otherCont7 { font-size:8px;text-align:right; color:#5b3284;font-family:Arial,Lucida Grande;font-style.:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }.tsDisplay { display:block }use STAGE
go
select distinct a.name,
c.name
from dbo.sysobjects a,(select distinct t1.id,t2.name
from dbo.syscomments t1,CNCI_PRESTAGE_CVM.dbo.sysobjects t2
where t1.text like '%' + t2.name + '%') c
where a.type = 'P'
--and a.name = 'USP_INCRLOAD_ADDRESS_CN'
and a.id = c.id
order by a.name,c.name
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/7899089/viewspace-711563/ ,如需转载,请注明出处,否则将追究法律责任。