Viewing 15 posts - 3,811 through 3,825 (of 7,610 total)
You can use your initial DELETE, perhaps looping it as well:
DELETE TOP (50000) FROM WHERE DATE BETWEEN X AND Y;
You'd be better off clustering...
May 15, 2017 at 12:28 pm
Try this:
SELECT T.InvoiceNumber, T.EntryCode AS InvoiceEntryCode, T.StoreNumber AS InvoiceStoreNumber, T.RptLevel AS InvoiceRptType,
OA1.*
FROM #tmpTransactions T
OUTER APPLY (
SELECT TOP...
May 11, 2017 at 3:17 pm
You should look into using sql_variant data type, it could help you do this. You'd have to use the desired data type, or cast to an explicit type, when loading...
May 10, 2017 at 4:06 pm
For now, off the top of my head, I don't see any way to avoid a cursor. so that you can dynamically evaluate each expression using sp_executesql. But other than...
May 9, 2017 at 9:00 am
And don't forget about extended properties. Those would all be lost too if you DROP/CREATE. As would of course any original "create_date".
May 5, 2017 at 8:30 am
Change your table to never store the space in the post code column (you can use a trigger to do this, at least until you change the app; you can...
May 3, 2017 at 4:05 pm
If the format is always xxx###, then:
SELECT MAX(RIGHT(column, 3))
May 3, 2017 at 4:00 pm
Here's another alternative. Btw, I corrected two holiday descriptions, for Jan and Feb. It's not "President's Day", it's "[George] Washington's Birthday"; I wish the media would stop repeating the wrong...
May 2, 2017 at 1:18 pm
I think something along these lines:
SELECT user,
CASE WHEN confirmed_count = user_count THEN 'Confirmed'
WHEN not_confirmed_count > 0 THEN 'Not Confirmed'
WHEN confirmed_with_caveat_count >...
May 2, 2017 at 8:31 am
Do a data design first -- that is, a logical design -- before you do a database design (a physical design). Otherwise you almost always end up with a poor...
April 28, 2017 at 1:50 pm
Interesting q. I don't believe that info is stored in any system table, I think SQL generates it (only) when the function executes.
To get the column names, you...
April 26, 2017 at 7:54 am
It looks like the FULL backup is from after the DIFF was taken. You'd need to use the full from before the diff.
April 25, 2017 at 12:19 pm
CREATE TRIGGER tr_DWH_HRxsins
ON dbo.DWH_HRxsDEL
AFTER INSERT
AS
SET NOCOUNT ON;
DECLARE @record varchar(1000)
SELECT @record = STUFF((
SELECT '. Record RXNO ' + CAST(i.id...
April 24, 2017 at 3:20 pm
Viewing 15 posts - 3,811 through 3,825 (of 7,610 total)