All pastes #79560 Raw Edit

AJ

public sql v1 · immutable
·published 2006-07-05 14:45 UTC
rendered paste body
SELECTsp.name AS [Name],sp.object_id AS [ID],sp.create_date AS [CreateDate],sp.modify_date AS [DateLastModified],SCHEMA_NAME(sp.schema_id) AS [Schema],CAST( case     when sp.is_ms_shipped = 1 then 1    when (        select             major_id         from             sys.extended_properties         where             major_id = sp.object_id and             minor_id = 0 and             class = 1 and             name = N'microsoft_database_tools_support')         is not null then 1    else 0end                       AS bit) AS [IsSystemObject],CAST(OBJECTPROPERTYEX(sp.object_id,N'ExecIsAnsiNullsOn') AS bit) AS [AnsiNullsStatus],CAST(OBJECTPROPERTYEX(sp.object_id,N'ExecIsQuotedIdentOn') AS bit) AS [QuotedIdentifierStatus],CAST(CASE WHEN ISNULL(smsp.definition, ssmsp.definition) IS NULL THEN 1 ELSE 0 END AS bit) AS [IsEncrypted],CAST(ISNULL(smsp.is_recompiled, ssmsp.is_recompiled) AS bit) AS [Recompile],case when amsp.object_id is null then N'' else asmblsp.name end AS [AssemblyName],case when amsp.object_id is null then N'' else amsp.assembly_class end AS [ClassName],case when amsp.object_id is null then N'' else amsp.assembly_method end AS [MethodName],case when amsp.object_id is null then case isnull(smsp.execute_as_principal_id, -1) when -1 then 1 when -2 then 2 else 3 end else case isnull(amsp.execute_as_principal_id, -1) when -1 then 1 when -2 then 2 else 3 end end AS [ExecutionContext],case when amsp.object_id is null then ISNULL(user_name(smsp.execute_as_principal_id),N'') else user_name(amsp.execute_as_principal_id) end AS [ExecutionContextPrincipal],CAST(ISNULL(spp.is_auto_executed,0) AS bit) AS [Startup],CAST(CASE sp.type WHEN N'RF' THEN 1 ELSE 0 END AS bit) AS [ForReplication],CASE WHEN sp.type = N'P' THEN 1 WHEN sp.type = N'PC' THEN 2 ELSE 1 END AS [ImplementationType]FROMsys.all_objects AS spLEFT OUTER JOIN sys.sql_modules AS smsp ON smsp.object_id = sp.object_idLEFT OUTER JOIN sys.system_sql_modules AS ssmsp ON ssmsp.object_id = sp.object_idLEFT OUTER JOIN sys.assembly_modules AS amsp ON amsp.object_id = sp.object_idLEFT OUTER JOIN sys.assemblies AS asmblsp ON asmblsp.assembly_id = amsp.assembly_idLEFT OUTER JOIN sys.procedures AS spp ON spp.object_id = sp.object_idWHERE(sp.type = N'P' OR sp.type = N'RF' OR sp.type='PC')and(sp.name=N'sp_creatediagram' and SCHEMA_NAME(sp.schema_id)=N'dbo')