Viewing 15 posts - 2,956 through 2,970 (of 8,753 total)
Jeff Moden (10/31/2016)
Eirikur Eiriksson (10/31/2016)
October 31, 2016 at 1:53 pm
Quick suggestion, reading the data to be deleted into a "bucket" variables can drastically speed up the delete, here is an example based on the DDL previously posted.
😎
DECLARE @id ...
October 31, 2016 at 9:32 am
Quick question, does the "user" have access to the share on the file server?
😎
October 31, 2016 at 7:10 am
DesNorton (10/31/2016)
In order to group by Year/Month, you will need to use something like this, which groups by the 1st of every month.
-- ...
MonthYear = DATEADD(mm,...
October 31, 2016 at 3:22 am
Here is a quick example that should get you passed this hurdle
😎
USE TEEST;
GO
SET NOCOUNT ON;
/* Sample data set */
;WITH SAMPLE_DATA(Amount,PaymentComfirmDate,PaymentType) AS
(
SELECT
...
October 31, 2016 at 1:46 am
Have a look at this article "AlwaysOn Availability Groups, Listener, Named Instances, Port Numbers, etc.[/url]" from the SQL Server Customer Advisory Team.
😎
October 31, 2016 at 12:11 am
Not a complete solution but should help you get over this hurdle
😎
USE TEEST;
GO
SET NOCOUNT ON;
IF OBJECT_ID(N'tempdb..#Payment') IS NOT NULL DROP TABLE #Payment;
CREATE TABLE #Payment (
PaymentId int,
PersonId int,
PaymentYear int,...
October 30, 2016 at 8:56 am
Quick suggestion, do the union in a CTE and apply the row_number outside the CTE
😎
October 30, 2016 at 6:53 am
Looks FUBAR, questions, how big is the database? what is the latest good backup? what other recovery options are there (manual data entry etc.)? do you have the failed hard...
October 29, 2016 at 1:40 pm
Jeff Moden (10/24/2016)
Eirikur Eiriksson (10/24/2016)
you will need this index on the dbo.Transaction
CREATE UNIQUE NONCLUSTERED INDEX [INDEX_NAME] ON [dbo].[Transaction](
[InvoiceUID] ASC,
[IsSuccess] ASC,
[TransKind] ASC,
[TransactionDate] ASC
)
INCLUDE ( [CardNumber],[ReferenceNumber],[SeqCounter],[UnqReferenceNumber]);
I came up with similar but...
October 29, 2016 at 1:33 pm
SqlStarter (10/29/2016)
Thanks a lot Eirikur Eiriksson
You are very welcome.
😎
October 29, 2016 at 6:24 am
This is quite easy when using FOR XML PATH, here is a quick example
😎
USE TEEST;
GO
SET NOCOUNT ON;
IF OBJECT_ID(N'tempdb..#EmpMaster') IS NOT NULL DROP TABLE #EmpMaster;
CREATE TABLE #EmpMaster (EMP_ID INT,Ename VARCHAR(50))
IF OBJECT_ID(N'tempdb..#EmpDetail')...
October 29, 2016 at 2:33 am
mah_j (10/29/2016)
you will need this index on the dbo.Transaction
CREATE UNIQUE NONCLUSTERED INDEX [INDEX_NAME] ON [dbo].[Transaction]
(
[InvoiceUID] ASC,
[IsSuccess] ASC,
[TransKind] ASC,
[TransactionDate] ASC
)
INCLUDE ( [CardNumber],[ReferenceNumber],[SeqCounter],[UnqReferenceNumber]);
and this index for the dbo.Invoice
CREATE UNIQUE NONCLUSTERED INDEX...
October 29, 2016 at 2:01 am
Are there no indices on the table?
😎
October 28, 2016 at 9:01 am
Suth (10/28/2016)
I'm currently trying delete data from a large database with the below code... But its taking quite a long time to delete 1000...
October 28, 2016 at 8:27 am
Viewing 15 posts - 2,956 through 2,970 (of 8,753 total)