Posts

Create SSISDB Catalog

Image
 Step 1:Go to SQL server and connect instance. Right click on Integration Services Catalog and select create catalog Step 2: Enable CLR Integration and provide password

Basic SQL DBA Commands

  --To check for Blocked Processes: Sp_who2      --To find all the log files and the percentage space used of those log files in an instance: dbcc sqlperf ( logspace )     --To list all the files and their details in a particular database: exec sp_helpfile   --To list all the databases and their details in a instance: exec sp_helpdb   --To shrink a database file without specifying target size(preferred for log files): dbcc shrinkfile ( fileid )   --To shrink a database file with specifying target size(preferred for datafiles): dbcc shrinkfile ( fileid , target_size )   --To find the details about locks currently held by the processes: exec sp_lock   --To find all the drive spaces through MS SQL: EXEC master .. xp_fixeddrives   --To put the database in single user mode at command prompt: sqlservr . exe – m   --To put the database in Minimal mode at command prompt: sqlservr . exe...

SQL Table hit count

SET ANSI_NULLS ON GO   SET QUOTED_IDENTIFIER ON GO   CREATE TABLE [dbo] . [TableHitCount] (        [DateOn] [date] NULL,        [DatabaseName] [nvarchar] ( 128 ) NULL,        [TableName] [sysname] NOT NULL,        [NbrTimesAccessed] [bigint] NULL,        [dateInserted] [datetime] NULL ) ON [PRIMARY] GO   ALTER TABLE [dbo] . [TableHitCount] ADD   CONSTRAINT [DF_TableHitCount_dateInserted]  DEFAULT ( getdate ()) FOR [dateInserted] GO   Insert into Test .. TableHitCount ( [DateOn]            , [DatabaseName]             , [TableName]            , [NbrTimesAccessed] )   SELECT    ...