Create function getallWeekDayorWeekends ( @givenDate as date, @choice as int ) RETURNS Table as BEGIN if(@choice = 1) return (SELECT cast(DATEADD(DA
I am running a mcr.microsoft.com/mssql/server docker container for local development that works perfectly on one machine. But on my laptop the container is some
How primary key in one table connect to another table with the same primary key? I am trying to make it like this, which those two primary key in the table of C
I want to count the employees, by state and UF, but when I run my code it counts by department: CREATE PROCEDURE SP_DATA_MART_CARGA AS IF NOT EXISTS(SELECT *
I want to set local variables or pass parameters from Excel to SQL. I've found similar questions, but all referred to old versions of Excel and/or the answers s
I'm having issue in saving a PDF file in SQL Server database using stored procedure in Golang. Below is the code. tsql := fmt.Sprintf("DECLARE @tmp varbinary(ma
I'm trying to connect my local database with online database. I've followed the full procedure but Database Sync Group is showing a log error of following type
Please check my query and let me know what to do to get the proper result as expected - query: With ChemReq (AmdCode, ItemCode, itemcode1, D1K,D2K,D3K,D1,D2,D3)
I have a database backup from a client. This database has a SP that I am trying to execute. I am getting the following message: Msg 7202, Level 11, State 2, Pr
For example: SELECT DATEADD(month, 2, '2017/08/25') AS DateAdd; I think it would be more sense to define argument as a specificed data type s
i am accessing my website from another computer in same network. before when i was using localhost on same pc website was working fine when i chnaged that to IP
Using SQL Server 2016 and latest SSMS, I'm trying to take a csv string and split it and then insert into table-value parameter variable and I'm getting error sq
I have a fake table: CREATE TABLE #FAKEAddress ( AddressLin01 varchar(100)) INSERT INTO #FAKEAddress VALUES ('123 FAKE ROAD'), ('79 59th ROAD'), ('7890 COUNTY
I have a narrow table containing unique key and source data Unique_Key System 1 IT 1 ACCOUNTS 1 PAYROLL 2 IT 2 PAYROLL 3 IT 4 HR 5 PAYROLL I want to be able t
I am new to SQL Server, I have 3 tables consider an employee table empid name location 1 abc USA 2 efg UK Another table named location-table location holida
I have strange issue and I am getting more confused about this. I am using UWP on the .NET framework and using SQL Server as database. The problem is my applica
I want to base my select query on a condition so it is something like: --THE LOGIC TO BE IMPLEMENTED IF ( SELECT OrderPlacementDate from SellOrders WHERE SellOr
I have a table Age_cal, Vaccine Information and Medical_information table as follows: I am trying to write a stored procedure where, I will be able to insert
SQL Server has bit type column to store true and false. In where clause we check column_name = 'false' it works fine on SQL Server (dev and prod env) but it fai
I executed the SP3 update and afterwards my SQL Server won't start. Logs say that the master file is corrupted. I have backups of all the data