Viewing 15 posts - 481 through 495 (of 7,614 total)
(1) You could use dynamic SQL and change the table name literally in the code before executing it.
(2) Or you could instead use a synonym to point to the active...
March 31, 2023 at 1:35 pm
SELECT
CAST(Time_2 AS date) AS Date,
CAST(SUM(CASE WHEN DATEPART(HOUR, Time_2) = 1 THEN Unit ELSE 0 END) AS decimal(9, 3))...
March 31, 2023 at 2:50 am
Since you're only doing INSERT and not UPDATE, you don't need MERGE.
I really can't follow the different tables you have since there's only one source table for all the columns...
March 30, 2023 at 7:16 pm
You'll need to CAST any text column(s) to varchar(max) in the PARTITION BY.
March 30, 2023 at 3:13 pm
;WITH cte_count_dups AS (
SELECT
*, COUNT(*) OVER(PARTITION BY Nationalnumber, Birthdate, Mobilphone, Emailaddress, Firstname) AS dup_count
...
March 30, 2023 at 3:07 pm
Not a lot of details. Maybe something like this:
SELECT
NationalNumber
FROM Contact
GROUP BY NationalNumber
HAVING /*COUNT(*) > 1 AND*/
((COUNT(DISTINCT Birthdate) >...
March 30, 2023 at 12:50 pm
You can't include any columns in a clustered index (by definition it automatically includes all columns in the table anyway).
Just use the key column(s) you need. It's OK, and often...
March 29, 2023 at 2:32 pm
The DBA's right about the concurrency issue. Also, you should really only create a clustered index on a temp table and it should be created before the table...
March 28, 2023 at 2:11 pm
The DBA's right about the concurrency issue. Also, you should really only create a clustered index on a temp table and it should be created before the table is loaded.
You...
March 28, 2023 at 2:03 pm
You can reference a temp table in dynamic SQL. Could you create a temp table and load it instead?
March 28, 2023 at 1:57 pm
SELECT j.name AS running_job_name,
DATEDIFF(MINUTE, ja.start_execution_date, GETDATE()) AS duration_mins,
ja.*
FROM msdb.dbo.sysjobactivity ja
INNER JOIN msdb.dbo.sysjobs j ON j.job_id = ja.job_id
WHERE...
March 27, 2023 at 2:28 pm
> Two synchronous replica in one region <<
The prod server must wait for the replicas to be in sync. That could also be adding to delay in prod.
March 20, 2023 at 6:39 pm
Typically you create only the clustered index prior to load, and any non-clustered indexes after the load. That's generally the best-performing approach, although theoretically it could be different for a...
March 17, 2023 at 2:39 pm
It's 16 Gb. My laptop from 10-11 years ago had double that amount of ram. My phone from 2010ish with its 480x800 resolution screen had that amount...
March 17, 2023 at 4:43 am
It's 16 Gb. My laptop from 10-11 years ago had double that amount of ram. My phone from 2010ish with its 480x800 resolution screen had that amount...
March 17, 2023 at 4:41 am
Viewing 15 posts - 481 through 495 (of 7,614 total)