336,609 questions
0
votes
0
answers
43
views
Optimizing a view's definition that takes 120 minutes to SELECT all rows from
I have a view in SQL Server that's taking 120+ minutes to execute, and I'm trying to understand if this is an indexing issue or a fundamental design problem.
Schema Overview
Table_A (base table): ~...
0
votes
1
answer
72
views
SQL query running slow
I have the following query generated by EF:
SELECT
[t].[Id], [t].[ActiveStateLicenseId], [t].[AvailableDate], [t].[City],
[t].[CreatedBy], [t].[CreatedOn], [t].[DateOfBirth], [t].[Email],
...
0
votes
1
answer
129
views
Optimize a SQL query
I have a query set that determines the amount of phone numbers that should be included into a count. The problem is that it is currently counting the user IDs but many user IDs have the same number. ...
0
votes
0
answers
94
views
How can I speed up a stored procedure Cross Apply function
I currently have a stored procedure that takes about 11 to 15 minutes to complete. I've put in timestamps to see which section is taking the longest and have narrowed it down to a cross-apply which ...
Best practices
0
votes
3
replies
66
views
Union vs (Distinct + Union All)
I am doing Union All in multiple sub query and then on the final result doing distinct of whole record. Since data is huge, is this safe in terms of performance?
Eg:
select distinct idn
from
(
sq1 ...
3
votes
1
answer
134
views
Removing duplicates in a sequence
I have recently investigated an audit table that had a wee bit of a bug with events that led to its data population, which I identified and fixed. Now there is the issue of past data that has ...
-4
votes
1
answer
79
views
Set SQL Server Job to run every 90 seconds [closed]
In SQL Server Management Studio, I want to create a job to run every 90 seconds.
Using the UI to create a job, you can create a scheduled task to run every x hours/minutes/seconds. But the UI forces ...
0
votes
0
answers
65
views
Stored procedure running multiple times in Angular application
I have a very odd problem that I can't get to the bottom of. I have an Angular application that uses node-mssql. It runs a lot of different queries and stored procedures where the result is used to ...
0
votes
0
answers
44
views
OPENROWSET and inserting JSON payloads [duplicate]
I'm trying to build a stored proc for a JSON payload file for a table for further work in that stored proc.
I would like to parameterise the exec to something like @MyJsonFile
SQL Server gives me an ...
Advice
0
votes
5
replies
82
views
SQL Server create new column with data from CTE query
I'm using SQL Server 2022 and I used a CTE to create a new column with all the dates formatted correctly. I'd like to turn this into a permanent column in my data set using the CTE to auto fill the ...
-4
votes
0
answers
50
views
BIG cloud migrations ETLs [closed]
I am currently trying to find way, maybe an ETL that is suited for very big amount of data migrations to cloud (specifically Azure). I am aware that Azure has their own services but unfortunately we'...
Best practices
0
votes
0
replies
38
views
How to use SQL Server in an Azure Pipeline on a Windows VM Image
My test project references my main project, which is a Windows application.
So if I want to compile the main solution, I need to use a Windows image for my Azure pipeline:
pool:
vmImage: windows-...
0
votes
1
answer
76
views
Rebus.SqlServer Outbox uses Openjson
I am using Rebus.SqlServer outbox functionality to ensure message are delivered properly. However I get an error message stating OPENJSON is not found.
I am using SQL Server 2012. Is there any ...
0
votes
2
answers
152
views
Inner/Outer SELECT filtering
Is there any difference (maybe in performance) between INNER SELECT filter and OUTER SELECT filtering:
Situation 1 - INNER SELECT filtering:
SELECT
FROM
(
SELECT ColA, ColB
FROM myTable1
...
-2
votes
0
answers
46
views
Login failed for user 'sa' in ZKTeco Attendance Management 32-bit with SQL Server 2014 [closed]
I’m attempting to connect ZKTeco Attendance Management 2011 (32-bit) to SQL Server 2014 using SQL Server Authentication with the 'sa' account. When I test the connection, it works fine, but when I ...