Forum Replies Created

Viewing 15 posts - 3,916 through 3,930 (of 10,144 total)

  • RE: Are the posted questions getting worse?

    GilaMonster (12/4/2013)


    In unrelated news, slightly belated drum rolls please..

    <---------

    Drum rolls with chocolate. Very few redundant words in all those posts.

  • RE: Help with SQL Query

    Probably the best tool for this is a dynamic cross-tab. Jeff Moden has an excellent article here[/url]. If after reading the article you are still having difficulty, post back.

  • RE: Are the posted questions getting worse?

    dwain.c (12/3/2013)


    Steve,

    I thought you might want to see this:

    http://www.sqlservercentral.com/Forums/FindPost1519227.aspx

    By alerting you, I am not vouching for its veracity.

    Dwain, I thought some of that code looked familiar - didn't we mess...

  • RE: Core T-SQL

    Steve Jones - SSC Editor (12/2/2013)


    L' Eomot Inversé (11/24/2013)


    I think the idea of "Core TSQL" isn't unreasonable, but no set of knowlege which is just about T-SQL and not about...

  • RE: Identify Duplicate Records according to Multiple Criteria

    Here's the simplest way. Without further information it's unlikely to be the best.

    -- I have an Employee table with Columns:

    DROP TABLE #Employee

    CREATE TABLE #Employee (EmpID INT IDENTITY(1,1), FirstName VARCHAR(100), MiddleName...

  • RE: Find out if the whole column of data in a table is empty - dynamic sql creation

    This is likely to be an expensive process whatever you do. What's the purpose?

  • RE: Working of the function

    Jeff Moden (11/29/2013)


    Not that many people would notice but you can get the code to be almost a third faster by eliminating the (-1) subtraction. Last but not least,...

  • RE: Core T-SQL

    Jeff Moden (12/1/2013)


    ChrisM@Work (11/26/2013)


    Jeff Moden (11/25/2013)


    rlortega (11/25/2013)


    So what minimum T-SQL skills are necessary if you're a DBA, not a developer?

    To be honest... learning to read minds and to anticipate "what's...

  • RE: Working of the function

    Note that you don't need CTE N6:

    DECLARE @startdate DATE, @enddate DATE

    SET @startdate = '00010101'

    SET @enddate = '99990101';

    with

    N0 as (SELECT 1 as n UNION ALL SELECT 1) -- 2...

  • RE: Working of the function

    Run the following code, query by query. If you're still unsure, post back.

    WITH

    N0 as (SELECT 1 as n UNION ALL SELECT 1) -- 2 rows

    ,N1 as (SELECT 1...

  • RE: Core T-SQL

    Jeff Moden (11/26/2013)

    As a bit of a sidebar, I especially like the one about "make it work, make it fast, make it pretty" except you left off the 4th item...

  • RE: Core T-SQL

    Jeff Moden (11/25/2013)


    rlortega (11/25/2013)


    So what minimum T-SQL skills are necessary if you're a DBA, not a developer?

    To be honest... learning to read minds and to anticipate "what's coming" by keeping...

  • RE: Recursive CTE

    If your hierarchy is likely to remain consistent then this may be more efficient than a rCTE:

    DROP TABLE #Entity

    CREATE TABLE #Entity (EntityId INT, EntityTypeId INT, Description VARCHAR(100), ParentEntityId INT)

    INSERT INTO...

  • RE: Rearrange Result of Data with TSQL Script

    Lynn Pettis (11/20/2013)


    sunil.mvs (11/20/2013)


    Thanks Chris ...

    The solution is as expected.. but need to check performance .

    Thanks

    Surya Sunil

    You should also make sure you understand how...

  • RE: Rearrange Result of Data with TSQL Script

    Here's a simple islands'n'gaps solution as suggested by Koen:

    DROP table #temp

    CREATE table #temp (SysKey int ,BusName varchar(9) ,BusType varchar(6) ,StartDateKey int ,EndDatekey int )

    Insert into #temp (SysKey ,BusName,BusType,StartDateKey,EndDatekey)

    Select...

Viewing 15 posts - 3,916 through 3,930 (of 10,144 total)