Viewing 15 posts - 1,756 through 1,770 (of 7,613 total)
My preferred approach is to use a CROSS APPLY to assign an alias name to the computation. That name can then be used in any other clause in the 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 29, 2021 at 3:15 pm
Should use the new file just fine. Make sure the new file is present, or you will have no space to write to.
What's happening is this. Your file has not...
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 29, 2021 at 1:59 pm
Try SELECT too rather than PRINT, since SELECT can show more chars than PRINT. Also, be sure to adjust the options in SSMS to show the max chars possible.
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 29, 2021 at 1:49 pm
I
Don't worry about ms, just use seconds. A few ms diff could be caused by almost anything is and not significant for an SSIS package.
I have 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".
March 29, 2021 at 1:47 pm
Don't worry about ms, just use seconds. A few ms diff could be caused by almost anything is and not significant for an SSIS package.
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 29, 2021 at 4:47 am
An ORDER BY either has an OFFSET clause or it doesn't. There is no "sometimes it does, sometimes it doesn't".
In this structure, rather than use 0 for the count, 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".
March 25, 2021 at 8:07 pm
Sorry, thought I changed it to jma.... (which I'll now do in my orig post as well). But I'm assuming that such a column exists just because or your comments...
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 25, 2021 at 5:44 pm
Seems like the table must be empty.
Make sure you are in the correct db.
A long shot, but you should always put the schema name on the table anyway, for performance...
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 25, 2021 at 4:49 pm
Here's my best guess at what you're trying to do.
SELECT
JO.jmoJobID, JA.jmaPartID, JO.jmoWorkCenterID,
JO.jmoProcessID, JO.jmoOperationQuantity,
...
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 25, 2021 at 4:16 pm
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
Viewing 15 posts - 1,756 through 1,770 (of 7,613 total)