Viewing 15 posts - 6,166 through 6,180 (of 7,597 total)
andrew gothard (3/29/2014)
Simple arithmetic, if you have 8k pages, one row per page (and we know that it's going to be bigger than that), 12500 rows. Table Lock (if...
March 30, 2014 at 3:31 pm
Ignoring any potential performance issues, a CROSS APPLY can do what you want fairly easily. Simply indexing the table properly can often deal with that. Or you can...
March 28, 2014 at 4:16 pm
SELECT
COALESCE(a.ID, b.ID) AS ID,
COALESCE(a.NAME, b.NAME) AS NAME,
CASE WHEN a.UpdateDate > b.UpdateDate THEN a.UpdateDate ELSE b.UpdateDate END...
March 28, 2014 at 2:26 pm
andrew gothard (3/27/2014)
ScottPletcher (3/27/2014)
andrew gothard (3/27/2014)
ScottPletcher (3/27/2014)
yuvipoy (3/27/2014)
Sean Lange (3/27/2014)
March 28, 2014 at 8:14 am
I think you can simplify the query something like below, although some tweaking might need done:
SELECT
s.state_name,
derived.NumOfDupPermits, derived.AmendedDups, derived.DistinctPermits
FROM (
...
March 27, 2014 at 2:15 pm
andrew gothard (3/27/2014)
ScottPletcher (3/27/2014)
yuvipoy (3/27/2014)
Sean Lange (3/27/2014)
March 27, 2014 at 11:57 am
I restore the backup to my UAT server and the initial data size explodes to 53gb and the log is set to 1gb.
Hmm, I think the log file should...
March 27, 2014 at 10:14 am
yuvipoy (3/27/2014)
Sean Lange (3/27/2014)
March 27, 2014 at 10:06 am
I think you're looking for LEFT OUTER JOIN, something like this:
SELECT
c.CaseID, c.Resolution,
COALESCE(CAST(s.CaseID AS varchar(10)), 'DUMMY-' + c.Resolution) AS SubCaseID
...
March 27, 2014 at 9:54 am
I don't see any need for a pre-built proc for:
Get All of Foo
Just SELECT the columns you need from the table instead.
For the rest, if you're willing to use dynamic...
March 27, 2014 at 9:49 am
Based on the query plan, I think two these things 100% need done and should help:
1)
Table: SubOrderTrans
Index: idx_subordertransday
INCLUDE column SubOrderTransDeleted in that index
2)
Table: SUBORDER_ETA_CORRECTIONS
Index: IDX_NC_SubOrderID
Change it to a clustered index,...
March 26, 2014 at 5:31 pm
Current query is not SARGable and is somewhat convoluted as well.
SELECT DISTINCT TOP 7
Convert(DateTime, Datediff(Day, 0, DateCreated)) AS DateCreated,
Datepart(dw,DateCreated) AS WeekNum...
March 26, 2014 at 11:34 am
Grant Fritchey (3/25/2014)
ScottPletcher (3/25/2014)
Grant Fritchey (3/25/2014)
ScottPletcher (3/25/2014)
Grant Fritchey (3/25/2014)
March 26, 2014 at 10:20 am
Roughly like below. You may have to adjust the "SINGLE_NCLOB" to "SINGLE_CLOB", depending on the format of the input file.
DECLARE @file_text varchar(max)
SELECT @file_text = file_text
FROM OPENROWSET(BULK 'd:\full\path\to\file\filename.txt', SINGLE_NCLOB) AS...
March 26, 2014 at 9:10 am
Gotta' admit, I prefer working in SQL/TSQL, so even for (moderately) large text files I'll often just do an:
OPENROWSET(BULK '<path_and_file_name>', SINGLE_CLOB) --or NCLOB, if req'd
to load the whole file at...
March 25, 2014 at 4:05 pm
Viewing 15 posts - 6,166 through 6,180 (of 7,597 total)