Forum Replies Created

Viewing post 1 (of 1 total)

  • RE: Run same SQL or Stored Proc for multiple databases

    you can do the following:

    use master

    declare @dbname varchar(100)

    ,@sql varchar(max)

    create table #TempDBs (

    dbname nvarchar(100)

    , RecordCount int

    )

    declare db_cur cursor for

    SELECT name

    FROM master.dbo.sysdatabases where dbid>4

    open db_cur

    fetch next from db_cur...

Viewing post 1 (of 1 total)