Tuesday, January 31, 2017

SSISDB event counts

SELECT
  EventCounts.EventName,
  EventCounts.NumberOfEvents,
  CONVERT(FLOAT,(CONVERT(FLOAT,[NumberOfEvents]) / SUM(NumberOfEvents) OVER ()) * 100) AS 'Percentage'
FROM
  (
    SELECT
      EM.event_name AS 'EventName',
      COUNT(*) AS 'NumberOfEvents'
    FROM SSISDB.catalog.event_messages AS EM
    WHERE EM.event_name IS NOT NULL
    GROUP BY EM.event_name
  ) EventCounts
ORDER BY EventCounts.EventName ASC

Thursday, January 26, 2017

There is problem with website with secure ceritifcate

To fix this issue is control the level of security

1.C:\Program Files\Microsoft SQL Server\MSRS11.MSSQLSERVER\Reporting Services\ReportServer

open rsreportserver.config file

and change <Add Key="SecureConnectionLevel" Value="0"/

Monday, January 9, 2017

The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID

Error:

The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID
{2DC39BD2-9CFF-405D-A2FE-D246C976278C}
 and APPID
{DB336D8E-32E5-42B9-B14B-58AAA87CEB06}
 to the user Service Account SID (S-1-5-21-3909091765-2419812890-180511053-6712) from address LocalHost (Using LRPC) running in the application container Unavailable SID (Unavailable). This security permission can be modified using the Component Services administrative tool.


Run  DCOMCNFG

Right Click -> Microsoft SQL server integration services _> Sercurity -> in cusotmization -> grant service accounts to


Thursday, January 5, 2017

SET IDENTITY_INSERT Table ON

SET IDENTITY_INSERT Table  ON
INSERT INTO Table  (RowID, ExpenseRequestID, ExpenseCode, EstimateAmount, EstimateBy, EstimateOn, Comments, BillToClient, UpdatedBy, UpdatedOn)
VALUES (50565,13628,'AIR',1639.56,'jgordon','2017-01-04','',0,'jgordon','2017-01-04')
SET IDENTITY_INSERT Table Off

Wednesday, January 4, 2017

SQLServer data Dictionary script

select a.name [Table],
       b.name [Column],
       c.name [DataType],
       c.length [Size],
       b.isnullable [Allow Nulls?],
       CASE WHEN d.name is null THEN 0
            ELSE 1 END [PKey?],
       CASE WHEN e.parent_object_id is null THEN 0
            ELSE 1 END [FKey?],
       CASE WHEN e.parent_object_id is null THEN '-'
            ELSE g.name  END [Ref Table],
       CASE WHEN h.value is null THEN '-'
            ELSE h.value END [Description]
from sysobjects as a
join syscolumns as b
       on a.id = b.id
join systypes as c
       on b.xtype = c.xtype
left join (SELECT  so.id,sc.colid,sc.name
             FROM    syscolumns sc
             JOIN sysobjects so ON so.id = sc.id
             JOIN sysindexkeys si ON so.id = si.id
                  and sc.colid = si.colid
             WHERE si.indid = 1) d
       on a.id = d.id and b.colid = d.colid
left join sys.foreign_key_columns as e
       on a.id = e.parent_object_id
       and b.colid = e.parent_column_id  
left join sys.objects as g
       on e.referenced_object_id = g.object_id
left join sys.extended_properties as h
       on a.id = h.major_id and b.colid = h.minor_id
where a.type = 'U' order by a.name