Viewing 15 posts - 4,501 through 4,515 (of 7,613 total)
azawan (1/6/2016)
Thanks for your reply
After running your query i got below results
start_dateFuture1_Datefuture2_datefuture3_datefuture4_date
2016-01-012016-02-05 2016-02-05 2016-02-05 2016-02-05
2016-01-102016-02-14...
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".
January 6, 2016 at 12:25 pm
azawan (1/5/2016)
First thanks for your reply, i am getting following error message
Msg 8116, Level 16, State 1, Line 8
Argument data type date is invalid for argument 2 of dateadd...
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".
January 5, 2016 at 3:19 pm
azawan (1/5/2016)
First thanks for your reply, i am getting following error message
Msg 8116, Level 16, State 1, Line 8
Argument data type date is invalid for argument 2 of dateadd...
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".
January 5, 2016 at 3:12 pm
I can't use an inline tally table because a filter at work blocks it, so I'm using a physical tally table. The table is named "tally" and its column...
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".
January 5, 2016 at 1:32 pm
I just noticed the OR condition on only status. That will force a table scan regardless. But I'd still like to see the actual query plan.
Btw, are you...
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".
January 4, 2016 at 1:06 pm
You should cluster this table on ( ProcessDate ) or ( ProcessDate, SOID ) if you want to insure the index is unique. You can create a separate nonclustered...
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 1:48 pm
I guess I wasn't clear enough. The idea is shrinking other databases on the same drive set(s) to free disk space, not on the db that needs the index...
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 11:25 am
You can create a non-temp table in tempdb.
CREATE TABLE tempdb.dbo.table_name ( ... )
That table will go away only when you explicitly drop it.
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:13 am
SELECT DISTINCT females_only.*
From dbo.vw_csys_NurserySchool
Cross Apply (
SELECT Parent1_id, Parent1_FullName, Parent1_Email, Parent1_STATUS, Parent1_Gender, YEAR, FULL_ADDRESS
WHERE Parent1_Gender = 'F' AND CATEGORY <> 'STF'
UNION
SELECT Parent2_id, Parent2_FullName, Parent2_Email, Parent2_STATUS, Parent2_Gender,YEAR, FULL_ADDRESS
WHERE Parent2_Gender = 'F' AND...
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:11 am
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
Viewing 15 posts - 4,501 through 4,515 (of 7,613 total)