Tag: database

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 […]

SQL removing duplicates in a certain column

Good afternoon all! Had a question regarding the removal of duplicates in one column and making it remove the whole row. I will provide an example in a screenshot in Excel as to not provide proprietary info. I am looking to remove one of the rows highlighted in yellow for example but do not want […]

Does a byte data type exist or is there an equivalent in SQL Server?

I’m trying to find out if Byte is a valid datatype in SQL Server, and if it has an equivalent. I’m not sure if there is an equivalent type for that

MS SQL prepare execute PHP

I’m getting nowhere with MS Sql and some php queries. function getBillet($idBillet) { $connection = getBdd(); $sql = ‘select BIL_ID as id, BIL_DATE as date, BIL_TITRE as titre, BIL_CONTENU as contenu from t_billet where BIL_ID=?’; $billet = $connection->prepare($sql); $billet->execute(array($idBillet)); if ($billet->rowCount() == 1) return $billet->fetch(); else throw new Exception(‘Aucun billet ne correspond à l\’identifiant’ . […]

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