Viewing 15 posts - 5,836 through 5,850 (of 7,613 total)
Eirikur Eiriksson (8/29/2014)
ScottPletcher (8/29/2014)
patrickmcginnis59 10839 (8/29/2014)
CELKO (8/22/2014)
What do you use for the PK on lookup tables?
I use the encoding that is being used. The IDENTITY property (not a column!)...
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".
August 29, 2014 at 10:45 am
patrickmcginnis59 10839 (8/29/2014)
CELKO (8/22/2014)
What do you use for the PK on lookup tables?
I use the encoding that is being used. The IDENTITY property (not a column!) is the count...
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".
August 29, 2014 at 10:22 am
amns (8/29/2014)
Instead of a datetime, if I cast a string with format 'yyyy-MM-dd',
will this cast always result in the correct date regardless the collation or other server parameters? (considering this...
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".
August 29, 2014 at 10:16 am
j_depp_99 (8/29/2014)
Msg 207, Level 16, State 1, Line 8
Invalid column 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".
August 29, 2014 at 8:50 am
Something like below. I don't have test data, so haven't tested it yet.
Edit: The WHERE conditions on your original query caused the LEFT JOIN to become a de factor...
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".
August 28, 2014 at 4:57 pm
Sorry, I have no idea; that's not my area of expertise.
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".
August 28, 2014 at 3:33 pm
I'm guessing what is happening is that Latin1 has only ascii 0 to 255, not extended characters. So, the double-bytes are being interpreted as single bytes, one of which...
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".
August 28, 2014 at 2:44 pm
I use "__Archive" (double underscore) for those tables.
I also maintain its structure to match the original table. That is, if the main table changes, I make the same changes...
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".
August 28, 2014 at 1:49 pm
I guess "UnitNumber" is the "Patient".
SELECT UnitNumber,
MAX(CASE WHEN DiagnosisSeqID = 1 THEN Diagnosis ELSE '' END) AS Primary_Diagnosis,
'427.31' AS Seconday_Diagnosis_Match
FROM test t
GROUP...
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".
August 27, 2014 at 12:40 pm
Not sure if you want to get the exact proc name being executed or see it and its parameters. Something like this should help you get started, although 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".
August 26, 2014 at 2:22 pm
er.mayankshukla (8/26/2014)
I have defined a Nvarchar column of 30 bytes
Lets say
create table demo (name nvarchar(30))
But when I see the length of this column by selecting table and pressing...
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".
August 26, 2014 at 1:35 pm
See if it's possible to summarize data and get rid of some of the details. Yes, they always say then need "everything", but then frequently they roll things up...
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".
August 21, 2014 at 4:36 pm
Tracing scalar UDFs adds enormous time to its execution. That is, just trying to compute the time vastly increases the time. Thus, scalar UDFs generally are performing much...
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".
August 21, 2014 at 4:00 pm
This is an easy one:
ALWAYS use sys.; NEVER use INFORMATION_SCHEMA.
Not only might I_S be inaccurate, I've found it's also much slower and much more prone to locking/deadlocking. The I_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".
August 21, 2014 at 3:55 pm
MickyD (8/19/2014)
Thanks for this . Could you confirm if I need to add the select statement part ?
Ideal situation would be to read this from a table that exists 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".
August 19, 2014 at 4:30 pm
Viewing 15 posts - 5,836 through 5,850 (of 7,613 total)