Viewing 15 posts - 4,516 through 4,530 (of 7,619 total)
14GB is almost certainly too much. Keep in mind that the 'max memory' limit for SQL Server is for buffer space only. SQL will take additional RAM for...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
December 30, 2015 at 10:00 am
Change the UNION ALL to just UNION. But the only way you'd have dups is if parent1 and parent2 both contained the same data.
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
December 29, 2015 at 4:37 pm
Select females_only.*
From dbo.vw_csys_NurserySchool
Cross Apply (
SELECT Parent1_id, Parent1_FullName, Parent1_Email, Parent1_STATUS, Parent1_Gender, FULL_ADDRESS
WHERE Parent1_Gender = 'F'
UNION ALL
...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
December 29, 2015 at 4:05 pm
SQLPain (12/29/2015)
I inherited a bad code, I am getting a deadlock when I am using your where clause
Very odd. Any conversion of the column should be vastly more likely...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
December 29, 2015 at 10:37 am
You can use tempdb database instead of the db containing the index to hold most of the data for the rebuild if you prefer. But you will need enough...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
December 29, 2015 at 9:59 am
If you mean all times for today's date, and not all times for the immediately preceding 24 hours, then you should do this:
WHERE (a.DateAppReceived >= DATEADD(DAY, DATEDIFF(DAY, 0, GETDATE()), 0)...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
December 29, 2015 at 9:54 am
You need a WHERE condition on the SELECT from the CTE:
...
SELECT log1.ID,
log1.STime StartTime,
log2.STime EndTime,
DATEDIFF(second, log1.STime,...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
December 28, 2015 at 1:56 pm
For performance reasons, you should never use ISNULL in a WHERE (or JOIN) clause, because you'll prevent possible index seeks on the underlying column. While the code below is...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
December 28, 2015 at 1:18 pm
I'd at least compare the performance of the straightforward brute-force method:
SELECT
word AS original_string,
CASE WHEN SUBSTRING(word, 01, 1) LIKE '[0-9]' THEN SUBSTRING(word, 01,...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
December 28, 2015 at 1:08 pm
Something like this might (or might not) perform better, if you need to calc time diff for just those two steps:
SELECT lst.SNum, lst.SOpDesc, lst.STime,
CASE WHEN...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
December 28, 2015 at 11:32 am
Jeff Moden (12/25/2015)
ScottPletcher (12/25/2015)
Jeff Moden (12/24/2015)
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
December 25, 2015 at 1:49 pm
SELECT c.Cust#, c.Name, c.Address, --c....
STUFF(
CASE WHEN cd.Monday = 1 THEN ',Mo' ELSE '' END +
CASE WHEN cd.Tuesday =...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
December 25, 2015 at 12:55 pm
baiju krishnan (12/25/2015)
when i tried to execute your code following error shownMsg 8117, Level 16, State 1, Procedure Sp_Login, Line 19
Operand data type bit is invalid for max operator.
Then we'll...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
December 25, 2015 at 12:35 pm
Jeff Moden (12/24/2015)
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
December 25, 2015 at 12:29 pm
Since Transaction_Date contains the time, a query coded like this:
Activity.Transaction_Date BETWEEN '20151130' and '20151201'
Would return rows from 12/01/2015 at exactly midnight (if there were any). But that wouldn't really...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
December 25, 2015 at 11:56 am
Viewing 15 posts - 4,516 through 4,530 (of 7,619 total)