Viewing 15 posts - 1,771 through 1,785 (of 7,619 total)
For a little disk space, you can create staging tables in DB2. Load to the staging tables. You then don't need a separate back up of the original tables because...
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, 2021 at 6:49 pm
I believe it's because you're doing "MAX" but the value is a string not a number. Therefore '9' is greater than '10', or '1', so '9' becomes the MAX value. ...
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, 2021 at 5:31 pm
If they log into SQL initially as themselves, ORIGINAL_LOGIN() might give you their own name rather than the generic name. It may not, but it's worth a try first.
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, 2021 at 3:42 pm
DECLARE @cod_pattern varchar(50)
SET @cod_pattern = 'NCREC-CL'+'.'+'CMP'+'-'+'%'
;WITH cte_next_numbers AS (
SELECT LEFT(cod, cod_base_length) AS cod_base,
MAX(CAST(SUBSTRING(cod, cod_base_length +...
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, 2021 at 3:40 pm
Ok, Category appears to not be a reserved word and appears in white. Period and Value are both blue. So it's brackets, no brackets, and brackets instead of brackets,...
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 22, 2021 at 11:07 pm
Ooh, right. I tired to change the sort because you formatted BatchDatte to mm/dd/yyyy which will not sort correctly.
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 22, 2021 at 7:48 pm
SELECT DISTINCT
BatchID, EDIProviderSort,
CONVERT(varchar(10), BatchDateConv, 101) AS BatchDatte,
DName
FROM UPSBatchInvNo
CROSS APPLY (
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".
March 22, 2021 at 6:01 pm
SQL Server doesn't store, and thus doesn't know, the "last accessed date" for each db.
After SQL starts, when any index is accessed, an entry for that db and index is...
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 22, 2021 at 4:42 pm
The first two are not full but don't have room to expand by the specified amount.
Alter the first two files to have a maxsize of their current size. That will...
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 22, 2021 at 2:51 pm
with testCostTable([Period], [Category], [Value]) as (
Also, the column names used are all SQL Server reserved words. That's something many SQL developers find annoying :). In my...
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 22, 2021 at 2:46 pm
What's the best way to know which index statistics need to be updated on a daily basis? I currently update stats on Friday, but I've noticed SQL is...
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 22, 2021 at 2:39 pm
That seems about right. I'd say also consider doing tables every day that get a manual update in 2 days' time; they're close enough to once-a-day anyway to me. "Better...
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 22, 2021 at 2:36 pm
SELECT ca.name, ca.nentry
FROM (
SELECT
SUM(CASE WHEN '.' + contents + '.' LIKE '%[^A-Za-z]bull[^A-Za-z]%' THEN 1 ELSE...
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 22, 2021 at 2:24 pm
The Windowing functions tend to be extraordinarily efficient, so I'd do the request this way:
SELECT DISTINCT f.[Id] AS [FormId], ver.[FormVersion]
FROM @forms f
LEFT OUTER JOIN (
...
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 22, 2021 at 2:17 pm
In a CASE <condition> THEN <result>, the <result> must be a single value (technically called a "scalar" value). Not allowed are SQL keywords or operators (>=, <) as part 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".
March 19, 2021 at 2:08 pm
Viewing 15 posts - 1,771 through 1,785 (of 7,619 total)