Viewing 15 posts - 4,996 through 5,010 (of 7,613 total)
Yeah, you could do that, but it's rather bizarre. What would the day before's activities have to do with today?
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".
July 2, 2015 at 11:15 am
Again, check this DMV:
sys.sql_expression_dependencies
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".
July 1, 2015 at 3:49 pm
A table that doesn't exist is a different issue, because SQL's deferred name resolution allows that, but not invalid/missing column names.
The other thing to try would be dmv:
sys.sql_expression_dependencies
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".
July 1, 2015 at 3:31 pm
Here's a quick cross-tab example specific to your situation:
SELECT D.PersonID,
MAX(CASE WHEN D.Activity = 'Woke Up' THEN D.ActivityTime END) AS WakeUpTime,
MAX(CASE WHEN D.Activity...
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".
July 1, 2015 at 2:52 pm
You didn't get an error because a bit column will treat any value greater than 1 as 1, so SQL converted the "2" to a 1.
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".
July 1, 2015 at 2:48 pm
Try running:
sp_refreshsqlmodule or
sp_refreshview
on potentially affected objects.
You should get errors on the object(s) that now reference unknown columns.
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".
July 1, 2015 at 2:46 pm
Jeff Moden (6/30/2015)
GilaMonster (6/30/2015)
Jeff Moden (6/30/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".
June 30, 2015 at 7:44 pm
You can add a file to tempdb if you need to. Or explicitly expand an existing file(s) yourself.
Be extremely careful if/when trying to modify, or drop, existing objects in...
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".
June 30, 2015 at 7:38 pm
Sean Lange (6/30/2015)
Jacob Wilkins (6/30/2015)
Based on what I've tested, Scott is technically correct. Under the right conditions, even where 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".
June 30, 2015 at 7:11 pm
You'll probably need to use ROW_NUMBER() for now:
;WITH CTE_sales AS (
SELECT
date_created, sales,
...
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".
June 29, 2015 at 11:07 am
Jeff Moden (6/26/2015)
ScottPletcher (6/26/2015)
Sean Lange (6/26/2015)
ScottPletcher (6/25/2015)
GilaMonster (6/25/2015)
Nolock hints, do you know what they do? (hint, they don't make queries faster)
Why does everyone keep repeating that?
Scott you have been...
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".
June 27, 2015 at 10:32 pm
Sean Lange (6/26/2015)
ScottPletcher (6/25/2015)
GilaMonster (6/25/2015)
Nolock hints, do you know what they do? (hint, they don't make queries faster)
Why does everyone keep repeating that?
Scott you have been around sql long...
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".
June 26, 2015 at 4:22 pm
Jeff Moden (6/25/2015)
ScottPletcher (6/25/2015)
sgmunson (6/25/2015)
ScottPletcher (6/25/2015)
GilaMonster (6/25/2015)
Nolock hints, do you know what they do? (hint, they don't make queries faster)
Why does everyone keep repeating that? Of course NOLOCK hints...
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".
June 26, 2015 at 2:10 pm
sgmunson (6/25/2015)
ScottPletcher (6/25/2015)
GilaMonster (6/25/2015)
Nolock hints, do you know what they do? (hint, they don't make queries faster)
Why does everyone keep repeating that? Of course NOLOCK hints make queries run...
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".
June 25, 2015 at 2:20 pm
sgmunson (6/25/2015)
ScottPletcher (6/25/2015)
WHERE
...
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".
June 25, 2015 at 2:18 pm
Viewing 15 posts - 4,996 through 5,010 (of 7,613 total)