Viewing 15 posts - 5,656 through 5,670 (of 7,613 total)
I think this is the general structure you need:
SELECT p.*, d_outer.date
FROM Project p
INNER JOIN Date d ON
p.ProjectID = d.ProjectID
CROSS APPLY (
VALUES(d.Date1),(d.Date2),(D.Date3) /*,...,D.Date20*/
)...
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".
November 3, 2014 at 12:27 pm
Here's my take on this. I listed the break and lunch time as separate columns but would change the final code to instead subtract from the working minutes 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".
October 31, 2014 at 5:19 pm
As a first try, look at that instance, "Reports", "Standard Reports", "Total CPU Time" and "Average CPU Time".
On rebooting, it depends. If you have a lot of non-SQL stuff...
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".
October 31, 2014 at 2:46 pm
Not really any easy way to get on-going accurate data at the partition level.
View sys.dm_db_index_operational_stats might help, particularly if the index/partition is very busy and thus (almost) never leaves the...
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".
October 31, 2014 at 12:04 pm
Robert Mark (10/30/2014)
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".
October 30, 2014 at 11:59 am
Starwatcher (10/30/2014)
kenambrose (10/30/2014)
MAKE ALL COLUMNS NOT NULLABLE.
If you can't figure out how to design a schema where that works for your business requirements,...
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".
October 30, 2014 at 11:55 am
ZZartin (10/30/2014)
Robert Mark (10/30/2014)
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".
October 30, 2014 at 11:51 am
It sounds like you need something along these lines:
ALTER TRIGGER [dbo].[trU]
ON [dbo].[tblEvent]
AFTER INSERT
AS
SET NOCOUNT ON;
UPDATE c
SET avbl= CASE
WHEN i.[Desc]...
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".
October 28, 2014 at 3:16 pm
stevemr68 (10/28/2014)
ScottPletcher - This is great but it's showing the 3rd Saturday of the weekend not the second.
D'OH, quite right, sorry. "13" days should be added, not 19. ...
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".
October 28, 2014 at 10:50 am
Yes, "Valued Member", that is basically correct, you do not use parameters like that in a trigger in SQL Server.
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".
October 28, 2014 at 10:41 am
Do you really need/want two separate scripts? You can do this in one (complex) date computation:
SELECT
*,
DATEADD(DAY, DATEDIFF(DAY, 5, DATEADD(DAY, 19, DATEADD(MONTH,...
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".
October 28, 2014 at 10:19 am
The trigger is firing. You must keep in mind that SQL Server only fires a trigger once per statement, no matter how many rows are INSERTed (UPDATEd or DELETEd).
Therefore,...
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".
October 28, 2014 at 10:03 am
To check for anything other than only digits (0 thru 9), use:
NOT LIKE '%[^0-9]%'
for example:
SELECT
TextID,
CASE WHEN TextID NOT LIKE '%[^0-9]%' THEN 'OK'...
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".
October 27, 2014 at 10:25 am
Everyone be aware that this is a school assignment; reposted perhaps to avoid disclosing that fact and get a "complete solution" instead of just helpful tips.
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".
October 24, 2014 at 3:37 pm
dariuslearn (10/23/2014)
ScottPletcher (10/23/2014)
In the SELECT list, after the original column name or expression, you can add "AS new_column_name", 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".
October 23, 2014 at 3:37 pm
Viewing 15 posts - 5,656 through 5,670 (of 7,613 total)