Viewing 15 posts - 7,381 through 7,395 (of 7,619 total)
Since there's only three dimensions being tested, I wonder if it's easier to just add computed columns to the base table and do all the calcs inline in one query,...
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 21, 2012 at 2:13 pm
A sysadmin can't be denied anything in SQL Server, so something else is going on here.
Is this a SQL login or a Windows login?
If W, is it a group or...
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 21, 2012 at 1:39 pm
If you only want to compare based on the leading numeric characters (0-9 only), you can do this (I prefer PATINDEX to CHARINDEX in this case, as it handles 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".
June 21, 2012 at 1:29 pm
Is there a sql statement that could turn it into this?
Yes, look at PIVOT as well.
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 21, 2012 at 1:19 pm
When the table is truncated the table is reseeded with values back to 1 again.
Technically, the table is set back so that the next row inserted gets the initial...
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 21, 2012 at 1:15 pm
The "traditional way" was to do an UPDATE then an INSERT, each time doing a join from the new data to the existing table data to verify that they key...
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 21, 2012 at 1:08 pm
You really should use the sys.* views to generate the code, rather than using the INFORMATION_SCHEMA views, because, according to Books Online:
"
Do not use INFORMATION_SCHEMA views to determine the schema...
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 19, 2012 at 2:56 pm
written an SP that uses a table that doesn't exist
I think your best chance is to try the following DMVs:
sys.dm_sql_referenced_entities
sys.dm_sql_referencing_entities
Other than that, I don't of anything else within SQL...
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 18, 2012 at 10:39 am
wonder why this isn't tracked in the catalog.
I suspect it was to keep down overhead.
MS could theoretically have logged tons of things like that in SQL, which would be...
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 18, 2012 at 10:33 am
UPDATE #Worked
SET
Tag = 1,
@UseIt = A.Student
FROM #Worked A (UPDLOCK)
INNER JOIN
(
SELECT TOP...
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 14, 2012 at 12:44 pm
Typically non-clustered indexes are not needed here, since you specify columnA in (virtually) all queries, in a reasonably narrow range.
Of course sometimes they do help specific queries, so you could...
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 14, 2012 at 9:10 am
Why not just add a column in the table for the "old" id column?
It's only 4 more bytes, and you'd then be able to reference that column 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 13, 2012 at 4:48 pm
Cluster by columnA (date/datetime) only.
That will keep the clustering key short but still restrict the number of rows a query must read and evaluate.
Sometimes additional column(s) are appropriate for 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".
June 13, 2012 at 4:40 pm
I wouldn't expect it to change the space available at all, so I'm guessing other activity reduced the space available in the table.
Just to be sure, you did use an...
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 11, 2012 at 12:22 pm
I'm not horribly against the idea of dropping the FK, but maybe I'm not fully understanding the advantage of doing so. How does deleting the parent records first improve performance?
It's...
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 8, 2012 at 2:26 pm
Viewing 15 posts - 7,381 through 7,395 (of 7,619 total)