且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在所有数据库中创建程序?

更新时间:2023-12-01 11:05:40

不确定但可能的解决方案是创建单独的批处理来执行不同的语句,例如

Not sure but a possible solution can be creating separate batches for executing different statements like
execute master.sys.sp_MSforeachdb
GO

use [?];
if exists
(
select * from sys.tables
)
GO
 
create proc parentupdate
(
 
@fscode varchar(50),
@parent varchar(50)
 
)
as
begin
 
update Tbl_FS_Mst set C_Parent='@parent'
N_ptype=(select N_Type from Tbl_FS_Mst where C_Code='@parent') where 
C_Code='@fscode'
end
GO





N:B:不确定在没有进一步使用sys.tables的情况下检查sys.tables有什么用。



希望,它有帮助:)



N:B: Not sure what is the use of checking sys.tables without using it further.

Hope, it helps :)