Forum Replies Created

Viewing 15 posts - 106 through 120 (of 136 total)

  • RE: Data Base mail Not showing any logs

    Check to make sure service broker is enabled?

    SELECT is_broker_enabled FROM sys.databases WHERE name = 'msdb';

  • RE: Log Full

    Are you seeing the errors in the logs after the fact? Perhaps there's transaction blowing out the log and then rolling back so by the time you see the error...

  • RE: using sp_MSforeachtable in all databases on a server

    GT-897544 (2/10/2010)


    How about using "SP_MSFOREACHDB"

    But where's the fun in that?

    DECLARE @CMD NVARCHAR(500)

    SET @CMD = '

    if db_id(''*'') > 4

    USE [*]

    EXEC sp_msforeachtable @command1=''DBCC DBREINDEX (''''?'''','''''''', 100)'', @command2=''print ''''?''''''

    '

    EXEC sp_msforeachdb @CMD, @replacechar =...

  • RE: Administration

    SQLBOT (2/10/2010)


    Only do what GT says if you like running the snapshot agent and doing table locks on the publisher.

    If you just wait it will all catch up when...

  • RE: sp_MSForeachdb

    I believe my "USE [?]" that is exexuted in the sp_MSForeachdb, will effectively test a connection to each db that is online

    I was just about to respond that the...

  • RE: using sp_MSforeachtable in all databases on a server

    Woops, sorry, yes I misunderstood your problem.

    Revised.. 🙂

    declare @dbname varchar(255), @sql varchar(255)

    declare c_dblist cursor for

    select name from master.dbo.sysdatabases order by name

    open c_dblist

    fetch next from c_dblist into @dbname

    while @@fetch_status =...

  • RE: using sp_MSforeachtable in all databases on a server

    tim-407748 (2/9/2010)


    Hoping you can help me.

    </snip>

    now the moment uncomment the following line

    --execute sp_MSforeachtable @command1='DBCC DBREINDEX ([?], '''', 100)', @command2='print [?]'

    </snip>

    How can I loop through each database on a server...

  • RE: HOw to script out all the jobs from one instance

    SSMS | Click the "Jobs" node | Select requited job | Right Click | Script job As...

    Also, if you have the Object Explorer Details panel open, once you've selected the...

  • RE: sp_MSForeachdb

    It might be easier to just query sys.databases state and state_desc columns to see the current state of the database. If you're dead set on touching the db you could...

  • RE: Database Research

    i took the liberty to update the script a little bit to allow better sorting based on different columns, such as Data.

    By changing the Data column to a BigInt and...

  • RE: Database Research

    Yes I agree but I recommend to eliminate the sys schema!

    Oops, yeah that's also a remnant from our environmental needs. The information in our current version also contains servernames, dbnames,...

  • RE: Database Research

    Using sp_mstablespace won't give you any unused space that the table is holding and sp_msforeachtable won't return internal tables. We were having issues pinpointing our space discrepancies, which were largely...

  • RE: Avoiding the XP_cmdshell

    That's the "RBarryYoung" technique that they have been talking about (follow the link above).

    I wasn't trying to steal your thunder, that's where I learned it from 😀

    I was just trying...

  • RE: Avoiding the XP_cmdshell

    The client_net_address should represent the address of the client machine making the connection. If you're connecting directly from your machine it should show your address. If you're connecting through, say,...

  • RE: Where are you?

    Seattle, WA

Viewing 15 posts - 106 through 120 (of 136 total)