Skip to content
Advertisement

Tag: sql-server-2014

Getting wrong output in pivot query

Attendance Table Sample Data – Student Table Sample Data – StudentSubject Table Sample Data – Subject Table Sample Data – Output – Wrong output is displaying with parameters – As 2,1,0 and NA,NA,1 should be displayed instead 2,1,1 and 2,1,1 is displaying. Couldn’t point out the mistake I am making. Can somebody take a look ? Answer You are missing

Ignore Sunday while generating student attendance report in SQL

This code gives me the attendance report between two dates passed as a parameter. I will pass dates respective of the month selected from the C# code. But I want to skip Sundays while generating the attendance report. How can I achieve this? Answer How about changing #TempDates? This assumes that your internationalization settings are set to “English”.

How to check active transactions in SQL Server 2014?

I am using SQL Server 2014 and want to know how to check my active transactions? Answer Query with sys.sysprocesses DBCC OPENTRAN : helps to identify active transactions that may be preventing log truncation. DBCC OPENTRAN displays information about the oldest active transaction and the oldest distributed and nondistributed replicated transactions, if any, within the transaction log of the specified

Advertisement