Viewing 15 posts - 4,261 through 4,275 (of 7,619 total)
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
If UAN is how you do lookups and, especially, joins, then you'd probably get better overall performance by clustering the table on UAN rather than on an identity column. ...
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 17, 2016 at 10:46 am
Or:
id bigint IDENTITY(12345000000000, 1) NOT NULL,
...
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 17, 2016 at 10:44 am
I'd be more concerned with log waits and/or dynamic log growth than with log flushes per second. If you're writing a lot of data, you will have a lot...
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 17, 2016 at 10:42 am
This code may give you some ideas. It looks at the most recent <nn> identical activities and averages them to get an estimate:
declare @num_of_most_recent_activities_to_use_to_estimate int
set @num_of_most_recent_activities_to_use_to_estimate = 5
create 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".
June 17, 2016 at 10:35 am
Typically I've found that DISTINCT is faster than GROUP BY when SELECTing a single column, i.e. as below, but obviously that could vary:
SELECT DISTINCT
...
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 16, 2016 at 1:40 pm
There's extremely little detail here, but it seems as if you are not distinguishing between a course and a single offering of the course, which I'll call a "class" 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".
June 16, 2016 at 1:36 pm
gary1 (1/13/2012)
In Oracle, from toad for Oralce, if we select a table and see the Script, it shows complte table script along with the grants
But in SSMS, I can...
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 16, 2016 at 1:22 pm
Jeff Moden (6/16/2016)
ScottPletcher (6/16/2016)
Jeff Moden (6/15/2016)
Sergiy (6/15/2016)
The only correct answer would be a question in response.
Probably, more that one question in...
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 16, 2016 at 8:51 am
Because sys.dm_db_index_physical_stats is so much overhead, you'll want to filter out non-heaps before you do the CROSS APPLY to that function.
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 16, 2016 at 7:50 am
Viewing 15 posts - 4,261 through 4,275 (of 7,619 total)