Forum Replies Created

Viewing 15 posts - 856 through 870 (of 897 total)

  • RE: Conditional WHERE clause in TSQL

    4EverandEver (3/9/2010)


    Thanks for the replies. you both mentioned that these solutions will not perform well. IS that terms terms of speed or will it cause any harm to the the...

  • RE: always use incorrect index to run the query by sql server

    arun.sas (3/5/2010)


    Hi Jeff,

    In this,

    It’s better to use the Joins instead of the sub queries/Exists.

    The results might differ in both the cases.

    Check the example given below..

    declare @a table...

  • RE: SQL statement to find what's missing...

    Henrico Bekker (3/4/2010)


    Please explain why you would recommend a nested select on the same table, looking for NOT IN on the same column, instead of selecting it and excluding the...

  • RE: SQL statement to find what's missing...

    SELECTDISTINCT [Name]

    FROMTableName

    WHERE[Name] NOT IN ( SELECT DISTINCT [Name] FROM TableName WHERE Fruit = 'Apple' )

    I hope the Column Name doesnot contain NULL values

  • RE: Complex T-SQL query

    Hope this helps...

    DECLARE@tiCounter TINYINT

    DECLARE@iGroupID INT

    SET@tiCounter = 0

    SET@iGroupID = 1

    --===== Create the test table

    CREATE TABLE #mytable

    (

    ID INT not null,

    Stats varchar(15) not null,

    EntryDate DATETIME not null

    )

    --===== Insert data into test table

    INSERT INTO...

  • RE: Help coming up with a query

    Oh, sorry i didn't test it. This will work..

    DECLARE @strapplication_name VARCHAR(100)

    DECLARE @strapplication_version VARCHAR(50)

    SET @strapplication_name = 'AlphaApp'

    SET @strapplication_version =...

  • RE: Help with CASE statement in my query

    it's usually not a good idea to hard code values that are stored in a table, too. Even more in this special case where a temp table is used (that's...

  • RE: Help coming up with a query

    See if this helps..

    DECLARE@strapplication_name VARCHAR(100)

    DECLARE@strapplication_version VARCHAR(50)

    SET@strapplication_name = 'AlphaApp'

    SET@strapplication_version = '3.0.20'

    ; WITH cteTable AS

    (

    SELECT ROW_NUMBER() OBER ( PARTITION BY application_name, application_version ORDER BY last_used DESC ) Row, *

    ...

  • RE: How to use"Union ALL" to join sql queries each containing order by clause

    Remove the Order By Clause from the first statement and put it only in the last statement

  • RE: Help with CASE statement in my query

    Check if this works..

    SELECT*

    FROM cElements A

    LEFT JOIN sectionList D ON D.sectionID = A.sectionID

    LEFT JOIN fList E ON E.fID = D.fID

    WHERE

    1 = CASE

    WHEN '2006' IN(SELECT acYears =...

  • RE: Avoid dynamic SQL

    People that wear hats are all hat & no cow & they have no hair; they are bold!!

    Before commenting on other's profile have a look at your's buddy. And...

  • RE: Avoid dynamic SQL

    Thank you, I appreciate you constructive feedback.

    Please let me know when that that I'm scheduled for the war crimes tribunal.

    I ask for the mercy of the Forum and for...

  • RE: Problem in SQL query

    Please post the complete problem in the forum Harsh. I doubt if anybody will even copy your link to paste it in the browser, forget a solution.

  • RE: Avoid dynamic SQL

    Paul White (2/26/2010)

    --------------------------------------------------------------------------------

    If you have a pain in your finger, chopping your hand off is not the solution.

    In fairness, it is *a* solution, just probably not optimal ...

  • RE: Avoid dynamic SQL

    So there are no DBA's that recognize that there are risk to Dynamic SQL?

    If I'm wrong then I respectfully respect that you forgive me for identifying the negatives of Dynamic...

Viewing 15 posts - 856 through 870 (of 897 total)