Tag: database

How do I avoid “sleeping” processes in MSSQL?

Currently I’m experiencing alot of issues with Server Processes (Seen from sp_who2) that is “sleeping” instead of just, finishing (being removed), when I connection to my MSSQL Database, calls a Stored Procedure, get some data and then closing the connection. What’s the best way in C#/.NET to connect to a MSSQL database, call a Stored […]

Pulling data from multiple databases on different db connections with a common target table

think of this scenario.. We have a web service that communicates with and pulls data from multiple, say 5, 6 or even 10K, databases. Each database has its very own design, tables and columns but they all implement a “Users” table. Our web service must look in each of those “Users” tables and access their […]

SQL Server Auditing- AD Groups are not audited

I need to configure Database Auditing in SQL Server. I did configure everything but looks like I am not getting expected result. What I need to do. Audit DML operations (Insert,Update,Delete) for few SQL Server AD GROUPS as most of the users are grouped in AD groups so we need to Audit AD Groups not […]

Create Sql DB with powershell searching for dacpac and naming db with Folder its located in

I am trying to create databases in Sql Server by searching for *.dacpac files within a folder, For each .dacpac found I need to create a DB with the name of the Folder the .dacpac was found in. Example C:\Folder\ contains C:\Folder\Project1\mydatabase.dacpac C:\Folder\Project2\mydatabase.dacpac C:\Folder\Project3\mydatabase.dacpac Script to create Db cd “C:\Program Files (x86)\Microsoft SQL Server\130\DAC\bin” $createDB […]

DbDataReader inner working

We have high load system which consist from SQL Server and .NET apps. We are using DbDataReader to retrieve data from SQL and persist it into JSON to send it across the wire. Our system uses time stamp for all the records that were inserted or modified in order to only send updated data over […]

AlterColumn fails for indexed properties on db migration in entity framework

I have the following Entity for which I have successfully created the table in my db. Now on migration I am changing the ‘CreatedOn’ column to have default value.But every time I run the Alter command I get the following Error. Entity public class MyTeam { [Key] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int Id { get; set; } […]

How to determine max IOPS of your application

Want to get input from master here. Recently my user asking, what is your maximum IOPS database for your application to be working fine. Is there anyone have suggestion or recommendation tools to determine this. Thanks in advance

How to create SQL custom 4-4-5 Finanical Period date table

I’m trying to create a SQL script to generate custom financial date table for reporting between years 2010 – 2030. The calendar is loosely based on a 4-4-5 calendar except there are specific rules for periods. The rules are as follows; The fiscal year always starts on the 1 of January The fiscal year always […]

Convert Oracle stored procedure to SQL Server stored procedure

Dear all can any one help me to convert the following Oracle stored procedure to SQL Server Version CREATE PROCEDURE Schedule_Employees ( param_from IN VARCHAR2, param_to IN VARCHAR2, param_template_id IN NUMBER) AS start_date NUMBER; end_date NUMBER; template_type NUMBER; rec_no NUMBER; days_no NUMERIC; day_date VARCHAR2 (20); shifts_value VARCHAR2 (10); current_shift VARCHAR2 (10) := ‘-1’; current_index NUMERIC […]

derive data calculation

I want use derived data to get the total salary calculated based on the appointment handled (20 pounds for each) and the basic salary is 1000 pound. Also, the salary should be ordered by the month and year. The appointment table have appointment date and time, Worker table have WorkerID and WorkerName and the salary […]

MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.