Forum Replies Created

Viewing 15 posts - 2,641 through 2,655 (of 10,144 total)

  • RE: Query Causing Blocking, Locks Table for 1000 Seconds, Help Needed!

    Here's that same query with a little extra formatting:

    SELECT

    [t4].[Destination],

    [t4].[Message],

    [t4].[OutboxAN],

    [t4].[OutboxStatusAN],

    [t4].[OutboxTypeAN],

    [t4].[Subject],

    [t4].[Fax],

    [t4].[FileName],

    [t4].[OutBoxData] AS [OutBoxData1],

    [t4].[OutBoxDataAN],

    [t4].[Type],

    [t4].[ClientReferenceID],

    [t4].[value] AS [CompanyClientMemberID],

    [t4].[value2] AS [ContactClientMemberID],

    [t4].[value3] AS [ReportType],

    [t4].[value4] AS [CompanyClientRoleID]

    FROM ( -- t4

    SELECT

    [t0].[Destination],

    [t0].[Message],

    [t0].[OutboxAN],

    [t0].[OutboxStatusAN],

    [t0].[OutboxTypeAN],

    [t0].[Subject],

    [t1].[Fax],

    [t1].[FileName],

    [t1].[OutBoxData],

    [t1].[OutBoxDataAN],

    [t1].[Type],

    [t0].[ClientReferenceID],

    [value] = ISNULL([t0].[CompanyClientMemberID],@p1),

    [value2] = ISNULL([t0].[ContactClientMemberID],@p2),

    [value3] = ISNULL([t0].[ReportType],@p3),

    [value4]...

  • RE: IMprove performance

    ramrajan (2/11/2015)


    The below query taking very long time to up few records also,

    Can anyone please rewrite this query for good performance with INNER joins.

    SELECT

    ...

  • RE: Analysis Services data set used in Reporting Services. Incorrect number sort order 1,154,165,2,3,345 etc

    Debbie Edwards (2/11/2015)


    Hi,

    I have come across a niggle that I cant seem to resolve.

    I have a number field and my report is ordered against it. However, When I looked I...

  • RE: Multiple execution plan for 1 query.

    New Born DBA (2/6/2015)


    I have this SQL statement with 2 different execution plan. I am also attaching both execution plan. No one has complained about the performance yet. Just curios...

  • RE: Are the posted questions getting worse?

    Sioban Krzywicki (2/4/2015)


    Grant Fritchey (2/4/2015)


    Sioban Krzywicki (2/4/2015)


    Some of it is probably the sport you're focusing on. Two of the sports were football and field events (shot put, discus, javelin). It...

  • RE: Are the posted questions getting worse?

    Grant Fritchey (2/5/2015)


    ChrisM@Work (2/5/2015)


    Grant Fritchey (2/4/2015)


    SQLRNNR (2/4/2015)


    Grant Fritchey (2/4/2015)


    Sioban Krzywicki (2/4/2015)


    Some of it is probably the sport you're focusing on. Two of the sports were football and field events (shot...

  • RE: Are the posted questions getting worse?

    Grant Fritchey (2/4/2015)


    SQLRNNR (2/4/2015)


    Grant Fritchey (2/4/2015)


    Sioban Krzywicki (2/4/2015)


    Some of it is probably the sport you're focusing on. Two of the sports were football and field events (shot put, discus, javelin)....

  • RE: Having trouble converting dates

    dwain.c (2/4/2015)


    Quite interesting.

    This illustrates the problem.

    CREATE VIEW dbo.Test

    WITH SCHEMABINDING

    AS

    SELECT

    RecordLastChangedDateKey=20150204,

    x=CAST('20150204' AS DATE) ;

    GO

    CREATE UNIQUE CLUSTERED INDEX IDX_t1 ON dbo.Test (RecordLastChangedDateKey, x);

    GO

    SELECT *

    FROM dbo.Test;

    GO

    DROP VIEW dbo.Test;

    Perhaps this solves it?

    CREATE VIEW dbo.Test

    WITH...

  • RE: Please Help Improve My While Loop

    Byzza (2/3/2015)


    I'm sure this is by far not the best way to do things, buts its been the only way I've worked out so far.

    I have 2 tables - 1...

  • RE: Having trouble converting dates

    theboyholty (2/4/2015)


    ChrisM@Work (2/4/2015)


    SELECT

    RecordLastChangedDateKey,

    CAST(CAST(RecordLastChangedDateKey AS CHAR(8))AS DATE)

    FROM (SELECT RecordLastChangedDateKey = CAST(20150204 AS INT)) im

    Thanks but its still giving me the message "The view contains a convert that is imprecise...

  • RE: Having trouble converting dates

    theboyholty (2/4/2015)


    I'm trying to create an indexed view. In my table there are 5 dates, all integers in their native form e.g. 20150204. I want to out put this in...

  • RE: split full name

    SELECT

    d.Fullname,

    Lastname = LEFT(d.Fullname, pos1-2), -- -2 removes the comma, could use REPLACE

    FirstName = SUBSTRING(d.Fullname, pos1+1, (pos2-pos1)-1),

    MidddleName = SUBSTRING(d.Fullname,pos2+1,8000), -- could use REPLACE to remove period

    x1.*, x2.* -- included...

  • RE: Help with a query

    -- Before attempting to fix the results set of your query,

    -- you might want to do some remedial work on the components of it.

    -- Here's a little sample set...

  • RE: Convert rows to columns using dynamic PIVOT table

    It's easy once you've worked through your first example. Here's another article written by Jeff Moden:

    http://www.sqlservercentral.com/articles/Crosstab/65048/%5B/url%5D

    A couple of minor changes to your query which may make the job easier:

    SELECT --...

  • RE: WHERE 1 = 1,who uses this besides me

    Resender (2/2/2015)


    ok this is something of a best practice of mine in my queries

    I always do

    WHERE 1 = 1

    I can't remember where I picked this habit up and I'm one...

Viewing 15 posts - 2,641 through 2,655 (of 10,144 total)