Viewing 15 posts - 21,106 through 21,120 (of 26,484 total)
This is closer to what you need:
DECLARE
@sql nvarchar(MAX),
@OP nvarchar(2),
@Name nvarchar(20),
@Value nvarchar(20);
SET @OP = N'=';
SET...
May 7, 2009 at 10:39 am
Your problem is with how you are trying to build your dynamic query. You can't use variables passed in like you are trying, as you are trying to put...
May 7, 2009 at 10:33 am
rayash16 (5/7/2009)
actually the function might work,i used some myself .
the problem is the result set has to use a group by because i need...
May 7, 2009 at 10:16 am
Gianluca Sartori (5/7/2009)
I use this one, but I'm sure there's a better one out there.
CREATE FUNCTION [dbo].[fSplit]
(
@List VARCHAR(6000),
@SplitOn VARCHAR(5)
)
RETURNS...
May 7, 2009 at 10:08 am
Glen Cooley (5/7/2009)
Intermediate. If it was SQL 2005 I would of used a CTE but I cant do that with SQL 2000.
You can use a derived table. You put...
May 7, 2009 at 10:06 am
It may need some twiking, but does this help?
USE [SandBox]
GO
/****** Object: UserDefinedFunction [dbo].[DelimitedSplit2] Script Date: 05/07/2009 10:03:14 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE function [dbo].[DelimitedSplit2] (
...
May 7, 2009 at 10:04 am
Why are you so concerned about getting rid of the table spool?
The following (I prebuilt and loaded the temp table with your sample data) ran in 11 ms:
Set NoCount...
May 7, 2009 at 9:52 am
Would not be surprised if the poor performance is due to returning the actual execution plan.
May 7, 2009 at 9:44 am
Has anyone else noticed that EVERY TIME a new version of SQL Server is released there are many questions asking if you can restore a database from the newer version...
May 7, 2009 at 9:35 am
Yep, ran 3 seconds for me too, when I was asking for the Actual Execution Plan. If I turned that off, the query returned in less than a second.
May 7, 2009 at 9:16 am
Using Jack's query, try adding the following index and let us know what happens.
create index IX_tbllogs on #tbl_logs (
[fk_tbl_visits_id] asc,
[date] asc
)
include (
...
May 7, 2009 at 8:53 am
Rereading the posts, you were asking the wrong question, well actually you weren't asking the complete question. Please look at the following code as it more closely matches what...
May 7, 2009 at 8:41 am
jamiejulius (5/7/2009)
May 7, 2009 at 6:53 am
jamiejulius (5/7/2009)
May 7, 2009 at 6:33 am
Viewing 15 posts - 21,106 through 21,120 (of 26,484 total)