Viewing 15 posts - 4,981 through 4,995 (of 7,619 total)
One of the tasks will acquire the lock first, and then the other one will have to wait. SQL's locking mechanism is what it allows it to "sequence" these...
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 14, 2015 at 2:34 pm
Worst case, create the table in tempdb. Btw, yes, you can create a permanent (non-temporary) table in tempdb.
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 14, 2015 at 2:28 pm
You need a separate table, clustered on the matching value, if you want best performance, or even good performance in the main table that is being compared has lots of...
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 14, 2015 at 1:03 pm
Lol, kind of as an exercise I did do a recursive function for this task. As you said, I'm not sure about how it will perform, and I have...
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 14, 2015 at 11:03 am
Try sp_helptext, as in:
EXEC master.sys.sp_helptext 'sys.server_principals'
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 13, 2015 at 4:11 pm
The best-practice recommendation is to grant only the specific permissions needed, in this case, I think that would be:
GRANT SELECT ON SCHEMA::dbo TO [<user_name>];
GRANT CONTROL ON SCHEMA::rpt TO [<user_name>];
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 13, 2015 at 12:03 pm
Yep. Just add the schema to the table and add the other column to the WHERE:
...
FROM dbo.Orders
WHERE STATUS IN (1, 2, 3) AND Type IN (3, 4)
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 10, 2015 at 11:08 am
Also, the initial tuning must focus first on getting the best clustered index for every table. Only after that should you create or modify nonclustered indexes.
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 10, 2015 at 11:07 am
Would have to see the actual queries and query plans to really be able to analyze this.
Also, clock time can be affected by many things. Be sure to review...
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 10, 2015 at 11:05 am
You can use CONTEXT_INFO to pass the name of the proc to the trigger. The calling proc sets specific bytes in CONTEXT_INFO, and the trigger substrings out those bytes...
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 10, 2015 at 11:01 am
Sure, I'll try to explain as best I can.
Each subquery (they're not technically CTEs but subqueries) reads one of the separate tables to be joined, and assigns a sequential row#...
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 8, 2015 at 4:23 pm
Maybe something along these lines?:
SELECT
COALESCE(ern.EmployeeID, tax.EmployeeID, ded.EmployeeID, ben.EmployeeID) AS EmployeeID,
MAX(ern.PayCode) AS EarningPayCode,
MAX(ern.Units) AS EarningUnits,
MAX(ern.Rate)...
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 8, 2015 at 1:49 pm
Not directly, at least not easily.
But you could put each in a separate job and start the three jobs -- the sp_start_job command runs and returns immediately, without waiting 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".
July 7, 2015 at 4:30 pm
Create a Policy lookup table to assign the common policy id and the sort order:
CREATE TABLE Reporting_PolicyGrouping (
Policy_Name varchar(50) NOT NULL,
Policy varchar(50)...
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 7, 2015 at 1:28 pm
WHERE (INSERT_DETECT_TS between '20150602' and '20150603')
You cannot safely use between. You need to use the >= and < (not <=, as in between) that I used earlier:
WHERE (INSERT_DETECT_TS >=...
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 7, 2015 at 12:33 pm
Viewing 15 posts - 4,981 through 4,995 (of 7,619 total)