Viewing 15 posts - 466 through 480 (of 1,082 total)
here are two solutions
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[select_NewRequest] @UID int AS
if @UID IS NOT NULL
Begin
SELECT [UID]
,[StaffNumber]
...
December 17, 2008 at 5:34 am
try this:
DECLARE @string VARCHAR(100)
SET @string = 'hello/what/ru/doing?/happy/new year'
DECLARE @Result VARCHAR(100)
;WITH MyCTE
AS
(SELECT TOP 4 SUBSTRING(@String+'/', n,
...
December 17, 2008 at 5:23 am
Why don't you want to create the table?
Having a tally table is very useful...
December 17, 2008 at 5:22 am
cool all you need to do is change the concatenation in the last select
DECLARE @string VARCHAR(100)
SET @string = 'hello/what/ru/doing?/happy/new year'
DECLARE @Result VARCHAR(100)
;WITH MyCTE
AS
...
December 17, 2008 at 5:06 am
you need to create the tally table
SELECT TOP 11000
IDENTITY(INT,1,1) AS N
INTO dbo.Tally
FROM Master.dbo.SysColumns sc1,
...
December 17, 2008 at 4:55 am
try this:
DECLARE @string VARCHAR(100)
SET @string = 'hello/what/ru/doing?/happy/new year'
DECLARE @Result VARCHAR(100)
;WITH MyCTE
AS
(SELECT TOP 4 SUBSTRING(@String+'/', n,
CHARINDEX('/', @String+'/', n) - n) as Val
FROM tally
WHERE n <= LEN(@String)
AND SUBSTRING('/' + @String,
n, 1)...
December 17, 2008 at 4:38 am
you should have this.
IF @P IS NULL
rather than
IF @P = NULL
December 17, 2008 at 4:27 am
Hi Sorry about the confusion.
In my experience I tend to notice that people who have parameter sniffing problems, tend to have it with dates. Having said this you are correct...
December 17, 2008 at 2:28 am
Also read this thread
http://www.sqlservercentral.com/Forums/Topic548393-8-1.aspx?Highlight=sniffing
December 16, 2008 at 4:49 am
one way around it is to declare a local variable and assign the value of the parameter to that variable and use that in your proc rather than the actual...
December 16, 2008 at 4:47 am
are your parameters dates?
If so sounds like parameter sniffing
December 16, 2008 at 4:40 am
Look in Books online for the INSERTED AND DELETED tables.
These are tables that hold the information of the data that is being changed.
So you could join your table to the...
December 15, 2008 at 10:26 am
am I missing something here!
Why do you need a derived table or a CTE when it seems to be a simply Group By Having Statement?
December 15, 2008 at 10:18 am
Have you tried this?
SELECT
myId,
SUM(myMoney) as Total,
MIN(myName) as myName
FROM [GroupingTest]
GROUP BY myId
HAVING SUM(myMoney) > 13
December 15, 2008 at 10:11 am
Viewing 15 posts - 466 through 480 (of 1,082 total)