|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 5:41 PM
Points: 6,724,
Visits: 11,769
|
|
schleep (6/26/2012) This will exclude all non-user objects. I assume they're probably not required anyway.
Get-ChildItem | where {$_.IsSystemObject -eq $false}
That brings up a good point. I have replication enabled in my DB and see the repl procs under System Stored Procedures in SSMS but when I run just Get-ChildItem (i.e. without any filtering) at the StoredProcedures prompt in PS none of the repl procs are returned, in fact no system procs are returned, I only see my user-defined stored procedures.
__________________________________________________________________________________________________ There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Believe you can and you're halfway there. --Theodore Roosevelt
Everything Should Be Made as Simple as Possible, But Not Simpler --Albert Einstein
The significant problems we face cannot be solved at the same level of thinking we were at when we created them. --Albert Einstein
1 apple is not exactly 1/8 of 8 apples. Because there are no absolutely identical apples. --Giordy
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Today @ 8:00 AM
Points: 344,
Visits: 602
|
|
$Srv = New-object Microsoft.SqlServer.Management.SMO.Server "Mufasa" $Srv.Databases["Abb"].StoredProcedures | where {$_.issystemobject -eq $true} | select name
This returns 1300+ system procs -- including repls, and I don't have replication enabled.
P
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 5:41 PM
Points: 6,724,
Visits: 11,769
|
|
From the OP's code, modified for my machine for demo:
Add-PSSnapin SqlServerCmdletSnapin100 -ErrorAction SilentlyContinue Add-PSSnapin SqlServerProviderSnapin100 -ErrorAction SilentlyContinue
Set-Location SQLSERVER:\SQL\MyComputer\MyInstanceName\Databases\MyDataseName\StoredProcedures
Get-ChildItem | Select Name I only receive a list of user-defined procs.
__________________________________________________________________________________________________ There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Believe you can and you're halfway there. --Theodore Roosevelt
Everything Should Be Made as Simple as Possible, But Not Simpler --Albert Einstein
The significant problems we face cannot be solved at the same level of thinking we were at when we created them. --Albert Einstein
1 apple is not exactly 1/8 of 8 apples. Because there are no absolutely identical apples. --Giordy
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Today @ 8:00 AM
Points: 344,
Visits: 602
|
|
Confirmed.
Set-Location SQLSERVER:\SQL\MyServer\Default\Databases\MyDB\StoredProcedures dir | select name
does not return any system sprocs. I wonder why the repl sprocs would fall into the user category.
Weird...
P
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 5:41 PM
Points: 6,724,
Visits: 11,769
|
|
schleep (6/26/2012) Confirmed.
Set-Location SQLSERVER:\SQL\MyServer\Default\Databases\MyDB\StoredProcedures dir | select name
does not return any system sprocs. I wonder why the repl sprocs would fall into the user category.
Weird...
P Indeed. This was quite an entertaining exercise nonetheless
__________________________________________________________________________________________________ There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Believe you can and you're halfway there. --Theodore Roosevelt
Everything Should Be Made as Simple as Possible, But Not Simpler --Albert Einstein
The significant problems we face cannot be solved at the same level of thinking we were at when we created them. --Albert Einstein
1 apple is not exactly 1/8 of 8 apples. Because there are no absolutely identical apples. --Giordy
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Today @ 8:00 AM
Points: 344,
Visits: 602
|
|
PS: Is your picture Robert Hays in Airplane?
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 5:41 PM
Points: 6,724,
Visits: 11,769
|
|
Yes, it is a picture of Robert Hays as Ted Striker. I am not sure if you can see the detail in the picture but it's from the scene when he's trying to land the plane and the sweat is pouring off him in buckets.
__________________________________________________________________________________________________ There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Believe you can and you're halfway there. --Theodore Roosevelt
Everything Should Be Made as Simple as Possible, But Not Simpler --Albert Einstein
The significant problems we face cannot be solved at the same level of thinking we were at when we created them. --Albert Einstein
1 apple is not exactly 1/8 of 8 apples. Because there are no absolutely identical apples. --Giordy
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Today @ 8:00 AM
Points: 344,
Visits: 602
|
|
I remember it well. Hilarious!
|
|
|
|