Viewing 15 posts - 1 through 15 (of 19 total)
IF OBJECT_ID(N'tvf_PRODUCTandPCM') IS NOT NULL
DROP FUNCTION tvf_PRODUCTandPCM;
GO
CREATE FUNCTION [dbo].[tvf_PRODUCTandPCM]
(
@REF varchar(18)
,@EndDate date
)
RETURNS table
AS
RETURN
WITH SL_Reduced
...
March 21, 2016 at 1:50 pm
Slowness is relative to your busyness, it this just you getting more and more impatient? Show us the code and your stats.
March 21, 2016 at 1:36 pm
Try running the package in 32/64 bit in VS.
March 21, 2016 at 1:28 pm
The person has a calendar where it can add calculated values, if you think CPU then date range is slower than comparing to a small int.
Is there a function f(@StartOfWeek,@EndOfWeek)...
March 17, 2016 at 2:28 pm
This looks a bit heavy
AND Calendar.Datetime >= @StartOfWeek
AND...
March 17, 2016 at 12:51 pm
The database is not smart, you will have to come up with something like predictive search, where the user will get a, hopefully short, list of spelling options based on...
March 17, 2016 at 10:37 am
No, there is no type that supports IN with a delimited string
One solution is to convert the dates to rows in a datetable
DECLARE @datetable TABLE(d date NOT NULL)
TODO: invent date...
March 17, 2016 at 10:27 am
What is the data type of the keys?
March 17, 2016 at 9:56 am
It depends on what version you are using
MSSQL 2014+ has that feature:
March 14, 2016 at 4:29 pm
Same thing, just shorter
SELECT RIGHT(CONVERT(varchar(30), DATEADD(second, DATEDIFF(second, ISNULL(QueueDate,StartDate), EndDate), 0), 120), 8)
March 14, 2016 at 3:57 pm
Same thing, just shorter
SELECT RIGHT(CONVERT(varchar(30), DATEADD(second, DATEDIFF(second, ISNULL(QueueDate,StartDate), EndDate), 0), 120), 8)
March 14, 2016 at 3:55 pm
Here's a solution without all the if's and butt's
-- 1) Get the code from sp_linkedservers
sp_helptext sp_linkedservers
-- 2) Copy the code into inline table valued udf
CREATE FUNCTION dbinv.ufn_Get_Linked_Servers ( )
RETURNS table
AS
RETURN
...
March 14, 2016 at 2:42 pm
Here is a version of your nice script that uses CTE to avoid temp table. It's also re-formatted with SQL Prompt.
DECLARE @year int = 2015
DECLARE @month tinyint = 8
;WITH ...
August 14, 2015 at 8:01 am
Viewing 15 posts - 1 through 15 (of 19 total)