Forum Replies Created

Viewing 15 posts - 2,161 through 2,175 (of 4,085 total)

  • RE: delete all tables using sqlcmd

    I agree with most of what Jeff said, but I would TRUNCATE the tables rather than scripting, dropping, and recreating them.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: An aggregate may not appear in the WHERE clause

    krypto69 (11/17/2016)


    I need the max

    This seems to work :

    SELECT * FROM [SQLNODEBSTAGE].[PEC_PROD].[DBO].[Staging_Eligibility]

    WHERE (select max(staging_eligibility_id) FROM [SQLNODEBSTAGE].[PEC_PROD].[DBO].[Staging_Eligibility]) <> (SELECT MAX(staging_eligibility_id) FROM [SQLNODEBSTAGE].[STAGING_Archive].[DBO].[Staging_Eligibility_archive])

    I agree with the others that...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Duplicate results from stored procedure calling functions

    These types of functions are best left to the presentation layer.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Query

    sqlfriends (11/15/2016)


    I would like to find out in every past 30 days(a month) the students has 2 days absent, or 3 days absent.

    These are any sliding 30 days not...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Query

    sqlfriends (11/14/2016)


    Also my question is a little different from previous post, donot want to make confusion, so start a new one.

    I will create some sample data

    I realize that this question...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Query

    sqlfriends (11/14/2016)


    Yes , that was posted by me.

    But I donot like to use recursive CTE, it is slow.

    And I wonder if there are any other suggestions.

    None of the...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Query

    Isn't this essentially the same question that you had in Recursive CTE performance improvement. You received an answer to this question there.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Null in my Union - but not by itself?

    The most obvious explanation is that the NULL value is coming from some other part of the UNION. Does the first column value match the value in this part...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: K-i-t-c-h-e-n Cabinets For Sale In North East Lincolnshire Area UK

    Reported as s-p-a-m.

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Relational Database Creation - How does a key from one table get into another table as a foreign key?

    There are three main ways.

    1) The key is included in the source data.

    2) Use the OUTPUT clause when you INSERT/MERGE the data into the user record to get the ID...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Need help with a SQL "least significant digit" algorithm

    BowlOfCereal (11/8/2016)


    drew.allen (11/7/2016)


    Since you want the final result as a numeric value, it doesn't make sense to manipulate the string. Try the following:

    SELECT m.origval, n.comp_val

    FROM #mytab m

    CROSS APPLY (

    SELECT...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: how to pick the first file first from specific folder using for each in SSIS

    The files are processed in alphabetical order. If you follow the naming convention of having a fixed filename prefix with a timestamp suffix in YYYYMMDDHHMMSS order they will be...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: The Forever Technology War

    Gary Varga (11/7/2016)


    I would recommend avoid using RTFM. If someone gets offended it can become an HR nightmare.

    Just tell them it means Read the FABULOUS Manual. 😀

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Need help with a SQL "least significant digit" algorithm

    Since you want the final result as a numeric value, it doesn't make sense to manipulate the string. Try the following:

    SELECT m.origval, n.comp_val

    FROM #mytab m

    CROSS APPLY (

    SELECT TOP (1)...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Split Record by Field into Multiple Records

    TheSQLGuru (11/4/2016)


    Well done Drew. Especially nice given the added flexibility. 2 very minor improvements:

    Thanks. I did consider including the first improvement, but decided to go with the less efficient...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

Viewing 15 posts - 2,161 through 2,175 (of 4,085 total)