Viewing 15 posts - 4,246 through 4,260 (of 7,613 total)
You really do need a stored proc, given how complex the restore process could be, with a full backup, maybe differential, maybe log file(s).
I have a special user/utility db that...
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".
July 5, 2016 at 3:26 pm
Assuming you want to split first by a space, but if there's no space then by dash:
SELECT value, LEFT(value, ISNULL(NULLIF(CHARINDEX(' ', value), 0), CHARINDEX('-', value) - 1)) AS split_value
FROM (
...
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".
July 5, 2016 at 2:06 pm
If you:
1) always, or
2) almost always, or
3) most critically
search these tables using RECORD_TYPE_CD, as in this query, then you should cluster those tables first on RECORD_TYPE_CD. That...
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".
July 1, 2016 at 11:42 am
If you:
1) always, or
2) almost always, or
3) most critically
search these tables using RECORD_TYPE_CD, as in this query, then you should cluster those tables first on RECORD_TYPE_CD. That...
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".
July 1, 2016 at 11:41 am
Jeff Moden (7/1/2016)
ScottPletcher (7/1/2016)
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".
July 1, 2016 at 11:08 am
Jeff Moden (7/1/2016)
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".
July 1, 2016 at 9:56 am
Sergiy (6/30/2016)
ScottPletcher (6/30/2016)
Jeff Moden (6/24/2016)
Shifting gears a bit and depending on how that's used, it could become a performance problem due to the implicit conversions of the string literals. ...
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".
July 1, 2016 at 8:31 am
Jeff Moden (6/24/2016)
Shifting gears a bit and depending on how that's used, it could become a performance problem due to the implicit conversions of the string literals. Since @database2...
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".
June 30, 2016 at 4:24 pm
Jeff Moden (6/28/2016)
David92595 (6/28/2016)
Because I inherited this database and the person that made it thought in spreadsheets not relational tables.
Thank you! Are their any other good ways to stop a...
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".
June 28, 2016 at 3:34 pm
David92595 (6/28/2016)
Because I inherited this database and the person that made it thought in spreadsheets not relational tables.
Thank you! Are their any other good ways to stop a sql injection?...
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".
June 28, 2016 at 10:39 am
As a quickie "solution", for now, something like this:
SET ANSI_NULLS ON;
SET QUOTED_IDENTIFIER ON;
GO
ALTER PROCEDURE <proc_name>
@ID int,
@State varchar(30),
@ColumnName varchar(100),
@NewValue datetime
AS
SET NOCOUNT ON;
IF @State LIKE '%[;]%' OR @ColumnName LIKE '%[;]%' OR @NewValue...
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".
June 28, 2016 at 9:28 am
Or the object(s) could be in a schema that is not the default schema, since the q is written as:
DROP TABLE table1
rather than
DROP TABLE schema_name.table1
Almost certainly not the answer the...
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".
June 27, 2016 at 2:15 pm
Sorry if this overlaps already-posted code, was busy for a long while before I was able to get back to working on this:
SELECT string, CASE WHEN next_to_last_space = 0 THEN...
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".
June 27, 2016 at 1:49 pm
SELECT
T.CallQueue, T.ReportQueue, T.ServiceLevel,
CASE WHEN T.ServiceLevel = T.Threshold1 THEN C.Segment1
WHEN T.ServiceLevel = T.Threshold2...
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".
June 27, 2016 at 10:34 am
What's really critical here is how the 680MrowsTable is clustered. Best for what you are doing here would be ( CustomerId, ACTdatetime ). If this is typical 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".
June 20, 2016 at 2:12 pm
Viewing 15 posts - 4,246 through 4,260 (of 7,613 total)