Forum Replies Created

Viewing 15 posts - 2,341 through 2,355 (of 4,085 total)

  • RE: Any way to clean up mutually exclusive OR conditions?

    xr280xr (9/26/2016)


    I don't specifically care about short circuiting. I just need to only evaluate b if a is false and only evaluate c if a and b are false. It's...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Any way to clean up mutually exclusive OR conditions?

    I was also wondering if instead of mutually exclusive you meant disjoint. Mutually exclusive means that you want to exclude the intersection of two sets, whereas disjoint means that...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Any way to clean up mutually exclusive OR conditions?

    xr280xr (9/26/2016)


    I have a where clause with some mutually exclusive OR expressions. With a procedural language that allows short circuiting it would look like this:

    a || b || c

    The important...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: T-SQL Stored procedure with multiple if-else conditions

    dimpythewimpy (9/23/2016)


    delete from FY_ST_ANSWER_DETAIL ad

    where ad.fy_st_question_dtl_table_id = @nFY_ST_QUESTION_DTL_TABLE_ID

    The DELETE statement has two FROM clauses: one mandatory and one optional. The FROM keyword is optional in the mandatory FROM clause...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Function call within Insert failing

    You haven't given us the definition of your function, you haven't given us sample data, you haven't given us expected results, and the code you've given us won't even parse,...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: delete millions of rows

    The Dixie Flatline (9/22/2016)


    Withdrawn. I'm being critical. Is it Friday yet?

    YES!! It is Friday!! Unfortunately, it's not Friday here, yet. :Whistling:

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Simple insertion for mutiple single code values

    Do you want to store that expression or the results of evaluating that expression? If the first, then you're missing some single quotes. If the latter, then you...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Basic insert for large tables

    The best option here may be the EXCEPT operator.

    INSERT INTO [dbo].[ErrorLog_last48]

    ([EventDate]

    ,[ApplicationID]

    ,[SessionID]

    ,[ServerName]

    ,[Level]

    ,[Message]

    ,[StackTrace]

    ,[MetaData]

    ,[DateIn])

    SELECT TOP 10000

    [EventDate]

    ,[ApplicationID]

    ,[SessionID]

    ,[ServerName]

    ,[Level]

    ,[Message]

    ,[StackTrace]

    ,[MetaData]

    ,[DateIn]

    FROM [dbo].[ErrorLogExport]

    EXCEPT

    SELECT

    [EventDate]

    ,[ApplicationID]

    ,[SessionID]

    ,[ServerName]

    ,[Level]

    ,[Message]

    ,[StackTrace]

    ,[MetaData]

    ,[DateIn]

    FROM [dbo].[ErrorLog_last48]

    It's not clear which of your columns can be NULL, but EXCEPT will treat NULLs as...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Msg 245, Level 16, State 1, Line 2 Conversion failed when converting the varchar value 'F' to data type int.

    This looks like generated code.

    1. Extreme overuse of parens. NOBODY writes SUBSTRING([ID_NUM], (3), (20)) when SUBSTRING([ID_NUM], 3, 20) means the same thing, is easier to read, and takes...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: How do I initialise a sql variable to 0 in stored-procedure ?

    Sue_H (9/22/2016)


    Luis Cazares (9/22/2016)


    Interview question?

    My thoughts as well. The follow up to that specific question could be interesting if someone doesn't know what would be different between the two.

    The answer...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Concatenation of 2 strings sql server

    SQL Server add XML functionality to SQL 2005. This allows you to read/create XML fragments. The FOR XML tells SQL Server that you want to create an XML...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Concatenation of 2 strings sql server

    Part of the problem is that you are reading the same table twice when you only need to read it once. I've rewritten this to use a CROSS APPLY...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Concatenation of 2 strings sql server

    Also, the ELSE clause within your CASE statement is missing an expression, and your CASE statement is missing an END.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Concatenation of 2 strings sql server

    There are several issues here.

    1) By default, SQL Server is case insensitive. Unless you've overridden these defaults, the two subqueries are going to return the same results.

    2) You say that...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Pair Programming

    J Livingston SQL (9/21/2016)


    is this what they are thinking of:

    https://en.wikipedia.org/wiki/Pair_programming

    Yes, that is what they are talking about.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

Viewing 15 posts - 2,341 through 2,355 (of 4,085 total)