c# must for projects
error log api log application error tracking
error log api log application error tracking
use dbname; DECLARE @Sql NVARCHAR(500) DECLARE @Cursor CURSOR SET @Cursor = CURSOR FAST_FORWARD FOR SELECT DISTINCT sql = ‘ALTER TABLE [‘ + tc2.TABLE_NAME + ‘] DROP [‘ + rc1.CONSTRAINT_NAME + ‘]’ FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS rc1 LEFT JOIN INFORMATION_SCHEMA.TABLE_CONSTRAINTS tc2 ON tc2.CONSTRAINT_NAME =rc1.CONSTRAINT_NAME OPEN @Cursor FETCH NEXT FROM @Cursor INTO @Sql WHILE (@@FETCH_STATUS = 0) BEGIN Exec …
Add Common Models to MFI_API_MODEL Project Build project and make error free Change Nuget Package Version in MFI_API_MODEL.nuspec file Generate Nuget Package from CMD using command: nuget pack mfi_api_model.nuspec -prop configuration=release Host Nuget Package to accessible server location in Ants or local computer Open Own UI project, Update Package version
SELECT sqltext.TEXT, req.session_id, req.status, req.command, req.cpu_time, req.total_elapsed_time FROM sys.dm_exec_requests req CROSS APPLY sys.dm_exec_sql_text(sql_handle) AS sqltext
SELECT OBJECT_NAME(i.OBJECT_ID) AS TableName, i.name AS IndexName, i.index_id AS IndexID, 8 * SUM(a.used_pages) AS ‘Indexsize_KB’ FROM sys.indexes AS i JOIN sys.partitions AS p ON p.OBJECT_ID = i.OBJECT_ID AND p.index_id = i.index_id JOIN sys.allocation_units AS a ON a.container_id = p.partition_id GROUP BY i.OBJECT_ID, i.index_id, i.name ORDER BY OBJECT_NAME(i.OBJECT_ID), i.index_id Next Query: SELECT t.NAME AS TableName, s.Name …
declare @MyTable table ( SN INT ,[Month] INT ,Acc INT ,Bal INT ) — GO INSERT INTO @MyTable VALUES (1, 7, 101, 1000), (2, 7, 101, 800), (3, 7, 101, 1700), (4, 8, 101, 1200), (5, 8, 101, 900), (6, 9, 101, 2500) — GO select distinct Acc, [Month], MinBal, AvgBal, MaxBal, LastVal from ( …
TSQL Min, Max, AVG and Last Value in single query Read More »
If controller is related to central only i.e it contains dbCore only it should inherit from BaseAsyncController If controller is related to Organisation also i.e it contains both dbCore and dbOrg it should inherit from BaseAsyncFOController While inheriting Any Controller from BaseAsyncController or BaseAsyncFOController, it should initialise base controller with respective variables also. eg For …
Whenever we restore db but user doesn’t exists and user is created after db restore only. following error appears. sp_change_users_login ‘AUTO_FIX’, ‘coop_sahakari_paanch’
use Async Task Run for async return redirecttoaction return await Task.Run<ActionResult>(() => { return RedirectToAction(“MultipleLoanEODFix”); });
— Shrink Database DBCC SHRINKDATABASE (AdventureWorks2008R2, TRUNCATEONLY); — Rebuild All Index on a table ALTER INDEX ALL ON Production.Product REBUILD WITH (FILLFACTOR = 80, SORT_IN_TEMPDB = ON, STATISTICS_NORECOMPUTE = ON); — Reorganize all indexes on the HumanResources.Employee table. ALTER INDEX ALL ON HumanResources.Employee REORGANIZE ; — Check DB for database consistency DBCC CHECKDB — Reclaims …
Some useful Commands for Check and Maintain MSSQL Database Read More »