Forum Replies Created

Viewing 15 posts - 2,896 through 2,910 (of 4,087 total)

  • RE: TSQL Query - Field has format and is saved as an Alias field name - Trying to reuse the alias later in the query

    Since the FROM clause is processed before the SELECT clause, you can use a CROSS APPLY to create a reusable alias.

    SELECT [ID_APD_Stips1], [Stip_Abv], STIP_WasaMatter +'You' as Stip_WasaMatter_you

    FROM [RegulatoryDB].[dbo].[APD_Stips1]

    CROSS...

  • RE: NULL and empty string question...

    Matt Miller (#4) (10/30/2015)


    drew.allen (10/29/2015)


    Sean Lange (10/29/2015)


    g.britton (10/29/2015)


    For that matter I wish we had true Boolean variables. But I dream.

    We do.

    create table MyTrueBoolean

    (

    TrueBool bit not null

    )

    If you have a...

  • RE: NULL and empty string question...

    Sean Lange (10/29/2015)


    drew.allen (10/29/2015)


    Sean Lange (10/29/2015)


    g.britton (10/29/2015)


    For that matter I wish we had true Boolean variables. But I dream.

    We do.

    create table MyTrueBoolean

    (

    TrueBool bit not null

    )

    If you have a bit...

  • RE: NULL and empty string question...

    Sean Lange (10/29/2015)


    g.britton (10/29/2015)


    For that matter I wish we had true Boolean variables. But I dream.

    We do.

    create table MyTrueBoolean

    (

    TrueBool bit not null

    )

    If you have a bit column and no...

  • RE: where clause help

    kat35601 (10/28/2015)


    Yes lastupdate is date time. Wow thanks for all the comments I used * in the select here because I did not want to copy and past the 28...

  • RE: HELP - Excel to SSIS

    SolveSQL (10/27/2015)


    Phil,

    Thank you for the link. i had read on it before. That is not an option for me. Basically i have to insert a dummy row in the excel...

  • RE: Transaction isolation level and implicit transactions

    In my understanding, which could very well be wrong, the answer is no. Implicit transaction has a very specific meaning which does not necessarily apply here. Since transaction...

  • RE: Syntax on a join

    Luis Cazares (10/23/2015)


    drew.allen (10/23/2015)


    You're trying to call a UDF DATEPART defined under the tblCall schema. Unless you've defined your own DATEPART function under this schema, I suspect what you...

  • RE: help with running total script

    In SQL 2008, your best bet is to use the Quirky Update Method[/url]. In SQL 2012 and above, you can use SUM with windowing functions.

    Drew

  • RE: Syntax on a join

    You're trying to call a UDF DATEPART defined under the tblCall schema. Unless you've defined your own DATEPART function under this schema, I suspect what you want is DATEPART(yyyy,tblCall.Call_Date)...

  • RE: EXISTS queries that can't be written any other way

    peter 82125 (10/21/2015)


    Thanks, Gail and Drew. Gail, the links don't directly discuss EXISTS vs join, but it looks like one can conclude what Drew is saying that there is really...

  • RE: TSQL Error: Invalid object name 'LastSevenDays'.

    I would actually rewrite Luis' query even further. You're obscuring the fact that you're calculating the number of days since started. I like to make that as explicit...

  • RE: EXISTS queries that can't be written any other way

    I think that it's always possible to rewrite an EXISTS query with an INNER JOIN or a CROSS APPLY.

    Drew

  • RE: help with query result to string and present in new row

    This forum is for T-SQL, but what you've posted is clearly not T-SQL. It looks like some variant of C. You'd be better off posting in a forum...

  • RE: How to add a primary key for existing column in the table

    jonas.gunnarsson 52434 (10/21/2015)


    Also verify the current collation, if column is nvarchar.

    But first verify duplicates

    -- List duplicates for column

    select A.<column_name>

    from <table_name> as A

    left outer join <table_name> as...

Viewing 15 posts - 2,896 through 2,910 (of 4,087 total)