Viewing 15 posts - 3,556 through 3,570 (of 8,761 total)
This can be done more efficiently with a simple ROW_NUMBER implementation.
😎
The problem with your solution is that it scans the table 1+(2 x number of rows) times, fear it will...
May 28, 2016 at 2:05 am
Alternative method using Lynn's fine test set (with the addition of a Beginninator 😀 )
😎
;WITH testdata AS (
SELECT
Directory
FROM
(VALUES
('/dev/Mywork/deailsbyWork'),
('/dev/MyTeam/deailsbyTeam'),
('/dev/MySubgroup/deailsbySubgroup'))dt(Directory)
)
,FIRST_CHOP AS
(
SELECT
...
May 26, 2016 at 4:53 pm
Piling on, don't use implicit convertion
😎
DECLARE @startdate DATETIME = CONVERT(DATETIME,'20160101',112);
May 26, 2016 at 4:33 pm
Since you are on a 2012 forum then why not use a window function?
😎
Note that a POC index like this would be very helpful
CREATE NONCLUSTERED INDEX NCLIDX_#EXAMPLE_CUST_SALES_INCL_WIN_PRODUCT ON #example
(customerId ASC,...
May 26, 2016 at 4:18 pm
jasona.work (5/26/2016)
Two servers, same permissions on both. On one, the user can deploy their project no problems (with the deploy project wizard.)
On...
May 26, 2016 at 2:20 pm
Ray K (5/26/2016)
The other day (inspired by a couple of SQL Saturday speakers), I started my own blog.
My most recent entry tackles the very-often-asked-here-on-SSC question, "how...
May 26, 2016 at 8:40 am
cvoss85 (5/26/2016)
When I execute...
May 26, 2016 at 8:39 am
Quick question, can you post the DDL (create script(s)) for the tables, sample data as insert script(s) and the expected results?
😎
May 25, 2016 at 9:54 pm
Same as before with the added columns, note the added calculated column and a covering index which improves the performance quite a bit, roughly 5 times faster than the self...
May 25, 2016 at 1:02 pm
Luis Cazares (5/25/2016)
Gazareth (5/25/2016)
jasona.work (5/25/2016)
Eirikur Eiriksson (5/25/2016)
Brandie Tarvin (5/25/2016)
Brandie Tarvin (5/25/2016)
<singing>
All the lonely servers. Where do they all come from? All the lonely servers... Where doooo they allllllllllllllllll come from?
Sigh....
May 25, 2016 at 11:08 am
Quick suggestion
😎
Relies on the sum of the checksum of the identifiers so be aware that there is a change of getting a collision error
USE tempdb;
GO
SET NOCOUNT ON;
;WITH SAMPLE_DATA(AFFILIATIONID,BACKAFFILID,ENTITYID) AS
(
...
May 25, 2016 at 11:00 am
Brandie Tarvin (5/25/2016)
Brandie Tarvin (5/25/2016)
<singing>
All the lonely servers. Where do they all come from? All the lonely servers... Where doooo they allllllllllllllllll come from?
Sigh. Wish wish wish I could get...
May 25, 2016 at 10:06 am
Jeff Sims-413169 (5/24/2016)
May 24, 2016 at 12:05 pm
TheRedneckDBA (5/24/2016)
I wouldn't do a direct update statement to the table.Using the msdb.dbo.sp_update_jobstep SP would be the way to go.
+100
Lot of logic and checks performed in the job...
May 24, 2016 at 9:15 am
rk1980factor (5/23/2016)
Here are column and field names
A:app_no,app_name,app_add
B:b_no, B_code,B_rates
C:c_no, C_degree,C_humidity
There is common field in all 3 tables but their field names are different. (in above example app_no,b_no...
May 23, 2016 at 10:08 am
Viewing 15 posts - 3,556 through 3,570 (of 8,761 total)