Viewing 15 posts - 5,686 through 5,700 (of 7,608 total)
SELECTc.cust_fullname AS Name,
c.cust_membership_id AS Account,
t.c_amount AS Amount,
'CH' + CAST(t.i_ticket_id AS varchar(12))...
October 17, 2014 at 4:30 pm
In general, it is a good idea to create reference/lookup tables instead of using case statements for gains in performance?
In general, for a limited number of values (say 10 or...
October 17, 2014 at 4:09 pm
My code to calculate max row length for a table -- and an index isn't that different -- shows 30 bytes, assuming 4 bytes for the clustering key.
October 17, 2014 at 4:05 pm
The index you need for that DELETE would be keyed on:
( pk_Source, pk_cession )
If you only ever do this for pk_source = 2 (and not any other source numbers), you...
October 17, 2014 at 10:48 am
Try fso. It's reasonably fast if you don't go too crazy on the number of files. I left out the error checking, you can fill that in if...
October 17, 2014 at 10:32 am
Since the table has 1.5B rows, the ~860K rows accessed is only ~0.06%, so I can see why SQL chose to do (a lot of) SEEKs rather than a scan....
October 16, 2014 at 3:25 pm
Probably the easiest way to do that is to create views which limit the data by date or whatever, then give them access to only the views. But that...
October 16, 2014 at 2:35 pm
inevercheckthis2002 (10/16/2014)
So I take the same code and try to create a stored procedure by adding this:
IF OBJECT_ID('usp_DataLoadTime', 'P') IS NOT NULL
DROP PROC usp_DataLoadTime
GO
CREATE PROC usp_DataLoadTime
AS
BEGIN
... <code from...
October 16, 2014 at 2:32 pm
The single biggest factor for performance is to get the best clustered index on every table.
Then adjust the non-clustered indexes as required.
October 16, 2014 at 2:14 pm
Alexander Suprun (10/16/2014)
ScottPletcher (10/16/2014)
Alexander Suprun (10/16/2014)
October 16, 2014 at 2:12 pm
Alexander Suprun (10/16/2014)
October 16, 2014 at 1:51 pm
From a purely performance stand-point, we'd almost certainly want to process Countries prior to it being JOINed:
SELECT A.City_Name, B.Country_Code, B.Country_Area
FROM Cities A
INNER JOIN (
SELECT Country_Code,...
October 16, 2014 at 1:36 pm
The GO separates the code into "batches". SQL parses and prepares an execution plan separately for each batch.
Thus, without the GO, when SQL parses the query below...
October 16, 2014 at 1:28 pm
kd11 (10/16/2014)
October 16, 2014 at 1:17 pm
I'd think you'd definitely want to use LTRIM() and RTRIM() to make sure you get rid of extraneous spaces. I added ISNULL(NULLIF(...)...) just in case there isn't a dash...
October 16, 2014 at 12:55 pm
Viewing 15 posts - 5,686 through 5,700 (of 7,608 total)