Viewing 15 posts - 1,111 through 1,125 (of 7,613 total)
why do other uses need to see who can login on a server? that is on its own a security risk and should not be exposed...
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 10, 2021 at 10:02 pm
Interesting. I was not aware of that quirk of PARSENAME.
SELECT PARSENAME(LTRIM(RTRIM(REPLACE(REPLACE(REPLACE(@statement, CHAR(9), ''), CHAR(10), ''), CHAR(13), ''))), 1)
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 10, 2021 at 9:56 pm
why do other uses need to see who can login on a server? that is on its own a security risk and should not be exposed by default.
If...
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 10, 2021 at 5:45 pm
Use: SELECT PARSENAME(@statement, 1), viz.:
declare @statement varchar(100) = '[dbo].[vw_EmployeeData]'
SELECT PARSENAME(@statement, 1)
set @statement = 'dbo.Employee'
SELECT PARSENAME(@statement, 1)
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 10, 2021 at 5:09 pm
;WITH UDT_CKB_SNAPSHOT AS
(
SELECT [UPC] ,[MASTERCHAINNAME] ,[EVENT_TYPE],[STARTDATE],[ENDDATE] ,[EVENT_NAME]
FROM [BYIntegration].[SCPOMGR].[UDT_CKB_SNAPSHOT]
WHERE [EVENT_TYPE]='Promotion' AND
[STARTDATE] BETWEEN...
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 9, 2021 at 5:57 pm
So, if I created a test table right now, and made an identity column, added 10 rows to it, then rebooted the server, and added another row, you're...
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 9, 2021 at 5:29 pm
This is so wrong. Your company is trying to have you fix the wrong problem. The real problem is the source of the data and...
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 7, 2021 at 9:43 pm
If you rounded the numbers, it seems like you'd end up with 296, 4, 1:
SELECT 300*.986, 300*.012, 300*.002 --295.800, 3.600, 0.600
The first round up seems clearest, so 296. You'd 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".
December 7, 2021 at 4:13 pm
This is so wrong. Your company is trying to have you fix the wrong problem. The real problem is the source of the data and THAT's what...
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 6, 2021 at 4:28 pm
The patient's name is not present anywhere. That is, there's no way to know who patient "A", let alone to know what doctor(s) he/she saw.
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 6, 2021 at 5:22 am
This is so wrong. Your company is trying to have you fix the wrong problem. The real problem is the source of the data and THAT's what actually needs...
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 6, 2021 at 5:16 am
This was an interesting problem because for 'Shift' rows, you need to output only one row. But for non-'Shift' rows, you (mostly) need to output two rows: a row for...
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 4, 2021 at 4:43 am
I wouldn't go thru all those gyrations to pull out the values. Imagine the hassle to just add one more column to the output.
I'd do something similar to this instead.
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 3, 2021 at 7:00 pm
I think this will work. I have NOT yet adjusted it for performance (or tuned it at all yet, really), I was just trying to make it work. Let me...
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 3, 2021 at 6:47 pm
As noted, a LEFT JOIN is what you need. An INNER JOIN requires a matching row in both tables; a LEFT JOIN will keep the row from the left-hand 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".
November 29, 2021 at 4:56 pm
Viewing 15 posts - 1,111 through 1,125 (of 7,613 total)