Viewing 15 posts - 1,381 through 1,395 (of 2,648 total)
The DDL and some sample data of the type of duplicates you want to move would be helpful.
October 2, 2019 at 2:04 pm
I've found performance to be the biggest problem with a MERGE. If you can replace a merge with an update followed by an insert it will give about 60% better...
October 1, 2019 at 4:16 pm
I hadn't read the information about the source table being on another database. A good way to go is to first copy the data onto a Staging table...
September 30, 2019 at 9:41 am
;WITH Data AS
(
SELECT * FROM (VALUES
(1, 1, 'Begin', CONVERT(datetime2,'9/29/2019 9:00:05.656 AM')),
...
September 29, 2019 at 1:59 pm
Can you wrap the entire job in a TRY CATCH blocks?
In the try block begin and commit the transaction
In the catch block rollback and re-throw the error.
This would...
September 28, 2019 at 5:55 pm
Can you wrap the entire job in a TRY CATCH blocks?
In the try block begin and commit the transaction
In the catch block rollback and re-throw the error.
I don't...
September 28, 2019 at 12:46 am
Can you wrap the entire job in a TRY CATCH blocks?
In the try block begin and commit the transaction
In the catch block rollback and re-throw the error.
September 27, 2019 at 8:08 pm
SQL Server caches the execution plan of queries, it may recompile a query a different way if it is executed at different times.
If there is any difference in the text...
September 27, 2019 at 7:54 pm
CREATE VIEW [dbo].[vwstudent]
AS
SELECT STD.ID,
STD.StudentId,
CASE WHEN STD.EfDate <= c.value THEN DATEADD(MONTH, -2, STD.EfDate)
...
September 27, 2019 at 7:50 pm
That seems a very odd requirement. Are you sure your users really know what they want?
September 27, 2019 at 4:19 pm
If you are using SQL 2008 you can't use LEAD and LAG. I think you might be able to use the windowed SUM function though.
;WITH Data AS
(
...
September 27, 2019 at 1:42 pm
CREATE PROCEDURE #TestDW
(
@CheckDayOfWeek bit = 0
) AS
IF @CheckDayOfWeek = 0 OR DATEPART(dw,GETDATE()) IN (3,6) BEGIN
PRINT 'Hello'
...
September 27, 2019 at 12:25 pm
UPDATE a
SET a.invalid = 1
FROM aaaMyTable a
WHERE EXISTS(SELECT *
...
September 26, 2019 at 10:53 am
1. Does Rebuilding a clustered index, will rebuild all non-clustered indexes as well on that table?
After rebuilding a clustered index you might also need to rebuild all the non-clustered...
September 26, 2019 at 10:29 am
This is equivalent SQL to yours, but instead of checking the left join column in the WHERE to be NULL or equal to something else, you might as well check...
September 24, 2019 at 4:52 pm
Viewing 15 posts - 1,381 through 1,395 (of 2,648 total)