SQL Server元数据的管理与应用

  发布时间:2025-11-05 03:19:39   作者:玩站小弟   我要评论
复制 CREATE PROCEDURE [dbo].[pAdd_Application] @ServerName varchar(50), 。
SQL Server元数据的管理与应用
复制 CREATE PROCEDURE [dbo].[pAdd_Application] @ServerName varchar(50),元用 @DatabaseName varchar(100), @ApplicationName varchar(100) AS --Add any new databases created, but not recorded in the repository, to the repository UPDATE dbo.Database_Applications SET ApplicationName = @ApplicationName WHERE ServerName = @ServerName AND DatabaseName = @DatabaseName AND ApplicationName IS NULL --Determine if there is already an application for this database in the repository, if not, then add it IF (SELECT COUNT(*) FROM dbo.Applications WHERE ApplicationName = @ApplicationName) = 0    BEGIN    INSERT INTO dbo.Applications (ApplicationName)    VALUES (@ApplicationName)    PRINT Added new Application: + @ApplicationName + to Applications table    SELECT * FROM dbo.Applications WHERE ApplicationName = @ApplicationName    END    --List the new record in the repository    SELECT ServerName, DatabaseName, ApplicationName    FROM dbo.Database_Applications    WHERE ServerName = @ServerName    AND DatabaseName = @DatabaseName    AND ApplicationName = @ApplicationName1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.
  • Tag:

相关文章

最新评论