Viewing 15 posts - 5,281 through 5,295 (of 7,613 total)
Detach can get messy, esp. with the file security changes that occur.
I'd just restore the backup 20 times. You could bundle the entire process into a master job 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".
March 23, 2015 at 10:21 am
Alexander Suprun (3/20/2015)
ScottPletcher (3/20/2015)
CREATE UNIQUE NONCLUSTERED INDEX <index name>
ON...
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".
March 20, 2015 at 2:11 pm
I think you can do it by running from master and explicitly specifying the actual db name in the query:
use master
select *
FROM your_db_name.dbo.Registos r
CROSS APPLY your_db_name.dbo.fnObtemCategoriaAviacao(r.PaisOrigem, r.PaisDestino)
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".
March 20, 2015 at 2:05 pm
Note that the original query and the new query will produce different results if the column can contain NULLs. You need to construct your final query to handle NULLs...
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".
March 20, 2015 at 2:03 pm
You'll want to explicitly state the FILLFACTOR and the filegroup, at least, rather than accept whatever the defaults happen to be:
CREATE UNIQUE NONCLUSTERED INDEX <index name>
ON <Table 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".
March 20, 2015 at 10:03 am
Shrink does not always fragment indexes; it certainly does not always fragment every index. You can shrink as much as you really need and then rebuild/reorg any index that...
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".
March 20, 2015 at 9:58 am
siggemannen (3/19/2015)LEFT JOIN can at least in theory lead to duplicates of data potentially returned if you mess up the WHERE condition
Not in the specific case where you're only looking...
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".
March 19, 2015 at 1:31 pm
Readers don't block writers, and writers don't block readers. Without RCS on, they do. This is a wonderful option, but it comes with a fairly high overhead cost,...
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".
March 19, 2015 at 11:19 am
ichayan2003 (3/19/2015)
As GilaMonster suggests, i...
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".
March 19, 2015 at 11:16 am
SELECT A.*
FROM Table1 A
LEFT OUTER JOIN (
SELECT B.USERID
FROM Table1 B
INNER JOIN Table2 C ON B.USERID=C.UserID
)...
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".
March 19, 2015 at 10:40 am
I don't see any downside, only upside. SQL relies on those settings now anyway, and they will soon be required.
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".
March 19, 2015 at 10:32 am
Interesting. If the db is "READ_COMMITTED_SNAPSHOT ON", that will typically reduce locking/blocking considerably. When tasks are in READ_COMMITTED isolation level -- which is the default -- the only...
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".
March 19, 2015 at 10:09 am
shezi (3/16/2015)
...
Where (e.status='A' or pr.Hours > 0) and e.pay_type=1
...
I came across another snag. 🙁 There is also another column "Validated hour" which is just a sum of hours...
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".
March 16, 2015 at 3:57 pm
SELECT
time_char,
STUFF(CONVERT(varchar(5), DATEADD(MINUTE, 15, STUFF(time_char, 3, 0, ':')), 8), 3, 1, '')
FROM (
SELECT '0545' AS time_char 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".
March 16, 2015 at 3:29 pm
CELKO (3/12/2015)
Since BIGINT is larger than the number of atoms in the universe, we do not use it very often.
No, not even close. There are at least 10^78...
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".
March 16, 2015 at 3:00 pm
Viewing 15 posts - 5,281 through 5,295 (of 7,613 total)