adminbd

Записи по mssql,oracle,windows и linux

All posts tagged info

Сбор информации о базах данных на сервере

USE [master]
GO

/****** Object:  StoredProcedure [dbo].[rkur_gooddba_whd]    Script Date: 08/18/2015 10:13:03 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

 
-- =============================================
-- Author:                    Ruslan Kurianov
-- Create date: 2015-05-29
-- Description:          Сбор информации о базах данных на сервере
-- Version:                    0.1
-- =============================================
CREATE PROCEDURE [dbo].[rkur_gooddba_whd] 
          -- Add the parameters for the stored procedure here
          @sn nvarchar(32)= 'xxx', 
          @dbn nvarchar(32)='rkur_dbastat',
          @schn nvarchar(32)='dbo',
          @tbn nvarchar(64)='gooddba_whd'
AS
BEGIN
          -- SET NOCOUNT ON added to prevent extra result sets from
          -- interfering with SELECT statements.
          SET NOCOUNT ON;
          if @sn <> 'xxx'
          BEGIN
          declare @whd nvarchar(128)
          set @whd='['+@sn+'].['+@dbn+'].['+@schn+'].['+@tbn+']'
 
          IF OBJECT_ID('tempdb..#tmpGood_DBA_project') IS NOT 
Читать далее