Viewing 15 posts - 511 through 525 (of 7,597 total)
You're doing (the equivalent of) a CROSS JOIN on the WORKC and PLNT_WORKC tables (JOIN ON 1 = 1). That could generate a huge number of rows. You then filter...
February 16, 2023 at 6:56 pm
You don't need a temp table, you can just create a view of the existing table. The really good this is the view can be created using dynamic SQL, so...
February 16, 2023 at 3:58 pm
You can defer the ON clause for a JOIN until after other JOINs. Normally you wouldn't do that unless it's absolutely necessary.
LEFT OUTER JOIN TABLEC CC ON (CC.hFKey4 = CHG.hPKey...
February 14, 2023 at 6:36 pm
Thank you all!
Sorry but I made a mistake on my original posting. Revised DATA representation is below
IF OBJECT_ID('tempdb..#TestTable') IS NOT NULL
...
February 13, 2023 at 9:55 pm
WHERE t_stamp >= (CAST(DATEDIFF(SECOND, '19691231 20:00:00', GETDATE()) AS bigint) * 1000) - (1000 * 60 * 30)
February 13, 2023 at 9:24 pm
ARPRINCE,
Have you looked at the query plans for the two queries? The LEFT JOIN method is doing a full table scan per join. That could be a (big) performance issue,...
February 13, 2023 at 8:32 pm
SELECT
ID,
MAX(CASE WHEN Referrence = 'OrderNo' THEN Value END) AS OrderNo,
MAX(CASE WHEN Referrence = 'OrderDate'...
February 13, 2023 at 8:29 pm
Here's the "standard" cross-tab method:
SELECT
ID,
MAX(CASE WHEN Referrence LIKE 'ON%' THEN Referrence END) AS OrderNo,
MAX(CASE...
February 13, 2023 at 6:59 pm
The use of the prefixed "TBL_" is a design error so bad it has a name; it's called the tibble.
This is not a design error. It does not violate...
February 8, 2023 at 8:18 pm
I use
;WITH
just to help prevent possible errors. Sure, I could be technically correct and blame someone else when there was a problem with the code, but I prefer to avoid...
February 8, 2023 at 3:20 pm
I would not prefix a view with tbl. In any case I rarely use views in an OLTP environment. I do make extensive use of them in...
February 8, 2023 at 3:17 pm
I would not prefix a view with tbl. In any case I rarely use views in an OLTP environment. I do make extensive use of them in my OLAP...
February 8, 2023 at 2:57 pm
I believe that SQL renames temp tables rather than dropping them, esp. for stored procs. That way, when the proc runs again, it doesn't have to fully recreate...
February 7, 2023 at 2:54 pm
I believe that SQL renames temp tables rather than dropping them, esp. for stored procs. That way, when the proc runs again, it doesn't have to fully recreate the table...
February 7, 2023 at 2:35 pm
>> The professorID is likely both the natural ID for the professor and the identity of the row. <<
The professor_id is probably a tax identification number of some kind....
February 6, 2023 at 8:10 pm
Viewing 15 posts - 511 through 525 (of 7,597 total)