Can you omit database snapshots in DMO?


to loop through databases in of maintenance scripts, use dmo each...

for each odatabase in oserver.databases

well, snapshots show database , causing problems. without rewritting of these yet in or taking them direct queries, there easy way omit snapshot in dmo?

thanks

in smo can check database property this:

 

code block

    if dbdatabase.compatibilitylevel compatibilitylevel.version90 then 
        if 
dbdatabase.isdatabasesnapshot 
then 
            
' here if it's snapshot

        else

            ' here if it's not
        end if 
    end if

 

 

 

however, dmo not updated provide support features in sql server 2005 , beyond.  best served converting code smo.  if code written in vb or c# you'll fine.  if you're using vbscript you'll want take @ powershell, because smo doesn't have com interface necessary manage servers vbscript.

 



SQL Server  >  SQL Server SMO/DMO



Comments

Popular posts from this blog

Conditional formatting a graph vertical axis in SSRS 2012 charts

Register with Power BI failed

SQL server replication error Cannot find the dbo or user defined function........