Viewing 15 posts - 6,961 through 6,975 (of 7,619 total)
Do you have only a few clients with huge numbers of orders each?
Or for a large number of clients, some with large numbers of orders, some with small numbers 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".
January 4, 2013 at 10:16 am
Those embedded REPLACEs are looking more tempting now, huh? 🙂
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".
January 4, 2013 at 8:53 am
dwain.c (1/3/2013)
ScottPletcher (1/3/2013)
CELKO (1/2/2013)
Since SQL is a database language, we prefer to do look ups and not calculations.
That "we" is undefined and thus meaningless. But people who 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".
January 4, 2013 at 8:43 am
Lynn Pettis (1/3/2013)
DECLARE @TestStr VARCHAR(20) = 'QWERY56920TYEU';
SELECT @TestStr;
WITH eTally(n) AS (SELECT ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) FROM sys.all_columns a CROSS JOIN sys.all_columns b)
SELECT
...
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".
January 3, 2013 at 4:33 pm
Embedded REPLACEs is your best option really, from a performance standpoint.
You could generate the REPLACE statements so you didn't have to write them by hand.
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".
January 3, 2013 at 4:05 pm
.
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".
January 3, 2013 at 12:37 pm
GilaMonster (1/3/2013)
kwoznica (1/2/2013)
You have a singular “phone_contact” table name!! ONLY One?!
I take that this is a suggestion to make the phone_contact table a wider table to...
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".
January 3, 2013 at 12:35 pm
CELKO (1/2/2013)
Since SQL is a database language, we prefer to do look ups and not calculations.
That "we" is undefined and thus meaningless. But people who have to write...
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".
January 3, 2013 at 10:45 am
If you're providing data for report or any type of BI application, remove NULLs entirely. NULLs cause serious and severe logic considerations that most people don't fully understand (including...
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".
January 3, 2013 at 10:30 am
dan-572483 (1/2/2013)
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".
January 2, 2013 at 12:39 pm
SELECT
OccurrenceReport.OccurrenceDate,OccurrenceReport.TimeOfOccurrence,OccurrenceReport.Floor,OccurrenceReport.Description,
OccurrenceReport.Injured,OccurrenceReport.FDNY,OccurrenceReport.FalseActual,OccurrenceReport.FPManager,
OccurrenceReport.DateSigned,OccurrenceCauses.Cause,
Emp.LastName + ', ' + Emp.FirstName as "EmployeeName",
FireM.LastName + ',...
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".
January 2, 2013 at 12:14 pm
Please try this:
SELECT *
INTO dbo.newtable
FROM dbo.oldtable_with_identity
UNION ALL
SELECT TOP (1) *
FROM dbo.oldtable_with_identity
WHERE 1 = 0
The identity property should be left off the column in the new table :-).
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".
December 31, 2012 at 2:40 pm
CELKO (12/27/2012)
All queries combined using a UNION, INTERSECT or EXCEPT operator must have an equal number of expressions in their target lists."!
The term for this is "union compatible" and 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".
December 31, 2012 at 2:31 pm
You could also add an "in-use" column to each row which is set when someone accesses it, and unset when they close it and/or after a certain period of time...
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".
December 31, 2012 at 12:36 pm
CELKO (12/31/2012)
That seems to imply that someone can change his/her SSN at will. I don't believe that's true.
Yep, you can. And thanks to identity theft this is becoming more...
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".
December 31, 2012 at 10:02 am
Viewing 15 posts - 6,961 through 6,975 (of 7,619 total)