Questions tagged [sql-server]

0 votes
1 replies
A better way to group and count multiple columns SQL
I have a survey table that shows the answers that people have taken once a month when they enter a contest. I'm trying to find a better way to...
asked 4 months ago
0 votes
0 replies
SSIS call to SMO works in Visual Studio but fails when run from a SQL Agent Job on the server. Jobs not using SMO work fine
I wrote an SSIS 2017 package that uses SMO (sql server management ojects) to synch my disaster recovery (DR) server with my production server. B...
asked 4 months ago
0 votes
2 replies
Trigger to prevent double bookings always flagging up
Having an issue where a trigger is always flagging up positive, even though from what I can tell it's conditions aren't being met. I want it to f...
asked 4 months ago
1 votes
1 replies
Why does Microsoft SSMS syntax highlight the word “configuration”?
When using Microsoft SQL Server Management Studio 14.0.17254.0 and it's query editor, I noticed that the word configuration is always syntax high...
asked 4 months ago
-2 votes
1 replies
Which version of SQL Server 2016 does TFS 2018 require?
We're running TFS 2015. I'd like to upgrade us to TFS 2018. Searching on the 'net I've learned that TFS 2018 requires SQL Server 2016. What I don...
asked 4 months ago
0 votes
1 replies
Not in to not exists
I have a 'not in' that I am trying to turn into a 'not exists' within the where clause of my select I tried switching the bare minimum but nothi...
asked 4 months ago
-2 votes
0 replies
Why do selecting specific fields from a view blow up my query?
I'm helping someone debug a legacy query that is built upon two views that each have records with the same fields from different data sources. Th...
asked 4 months ago
0 votes
0 replies
Using a value in a table to create multiple simimlar records [duplicate]
I have a table basetable as given below id name qty price 2 a 2 20 3 d 3 10 4 b 5 60 i want to insert the record into ano...
asked 4 months ago
0 votes
2 replies
Return results where the string in a column has a certain amount of digits [closed]
I need to create a query that will return all the results where the string in a column has more than, say, 3 digits in it? How do I go about doi...
asked 4 months ago
0 votes
1 replies
How to avoid distinct records from database while inserting data using asp.net?
I'm building a program that imports data from an Excel file into a database, or by writing into textboxes (by an insert in asp.net) or both, but...
asked 4 months ago
1 votes
2 replies
Get results with wildcard
I am returning @ChangeStatus variable with 'Y', 'N', Null and need to show data based on that however column has different string than variable...
asked 4 months ago
-1 votes
0 replies
What is the atomic replace in SQL manager? [closed]
I would like to replace all tabs and new lines upon select in my sql table as so: SELECT REPLACE([<column_name>], char(9), ' ') as <col...
asked 4 months ago
0 votes
1 replies
Converting a String with Length of Time into Different DataType
I am working in sql server and have been provided with a file that has a column for "Duration" which contains string type values of length of tim...
0 votes
1 replies
Do SQL Server Connections closed on restarting IIS?
Due to connection leak there were hundreds of connection open on my dev-server. I fixed the connection leak, deployed it and restarted the IIS se...
asked 4 months ago
2 votes
2 replies
SQL XML Query returning Blank value
I'm trying to setup a query to read an XML variable and it appears to be returning an empty table. The XML I am using: <collection> <...
asked 4 months ago
0 votes
0 replies
NodeJs mssql connection string
I have a question becuse it ma getting error SQL Server Network Interfaces: Connection string is not valid what is wrong with connection string?...
asked 4 months ago
3 votes
1 replies
Rolling DAU, MAU using T-SQL
Situation: I have a login table with columns email and login_time. I would like to calculate the daily login time (DAU) and the rolling monthly...
asked 4 months ago
0 votes
3 replies
SQL IF ELSE insert into #temp table problem
I have a scenario I am unsure how to resolve. Below I have an if else statement along with inserting data into a temp table. IF @code= 'All'...
asked 4 months ago
1 votes
1 replies
The required column 'id' was not present in the results of a `FromSql` operation in EFcore
I have a major problem with FromSql and that's it : I have a model like this: public partial class model { public string name } I want t...
1 votes
1 replies
A way to draw tree hierarchy from the Adjacency Model + Nested Sets Model (MPTT)
I have a .NET Core 2.2 application with SQL Server DB and I'm storing the hierarchy of the users using the Adjacency Model + Nested Sets Model. I...
4 votes
2 replies
Best Way to insert multiple records in Database
I just came across a situation where i had to insert multiple records into the database. The records i had were in generic list and now i have fo...
asked 4 months ago
0 votes
1 replies
Can't retrive data from Azure Database
So I'm connected to an Azure SQL Database in Visual Studio, but for some reason I can't seem to be able to retrieve anything from the database it...
2 votes
1 replies
Validating Type 2 Slowly Changing Dimensions table
I have to validate TYPE 2 Slowly Changing Dimensions table, we had issue where new records are inserted into table but old records are not expire...
asked 4 months ago
0 votes
1 replies
check if fields of a sqlserver table are empty/full in a computed field
i need to add a computed field in a sqlserver table that shows me if the other fields of the table are empty or full (all, some of them, none) t...
0 votes
1 replies
How to Query and sort data by its count where the time interval between data are all longer than 5 mins
I want to query a list of data its data source like this: ID EVENT TIME -------------------------- A EVENT_1 2019-05-07 18:...
asked 4 months ago