Forum Replies Created

Viewing 15 posts - 211 through 225 (of 533 total)

  • RE: Eqivalent in SQL Server to oracle's "break on" and "skip 1"

    I could write the code to do this, but why? Isn't it much easier to use whatever you're using for your user interface? (Honest question ... I don't...

    └> bt



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: Aliasing servername

    sushantkumar1984 (7/21/2010)


    is there a method to avoid writing the server name in a query..

    like xyz.dbname.dbo.tablename1 A

    xyz.dbname.dbo.tablename2 B

    ...

    └> bt



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: Format report data in the app or in SQL?

    Generally, the idea is to split responsibility between different part of the whole for efficiency and consistency. The user interface is where the data is actually being presented so...

    └> bt



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: Terrible code, trying to tweak

    You're right about it being terrible. I really think it would take being on the system to fix it.

    └> bt



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: Excluding value in Column/sum total

    Not sure what you're wanting to display for the Fee ... whether that line's portion or the full thing, but hopefully you can modify this to get what you want:

    SELECT...

    └> bt



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: Profiler Guidance

    In many cases, the actual cached plan will be different for the same query depending on the source of the execution because of settings such as ARITHABORT. So, if...

    └> bt



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: Query using right function in where clause is failing

    Adam Haines (7/21/2010)


    No need for a computer column here. You should use the like operator.

    DECLARE @t TABLE(

    col VARCHAR(10)

    );

    INSERT INTO @t VALUES ('13abc');

    INSERT INTO @t VALUES ('1abcde');

    SELECT *

    FROM @t

    where col...

    └> bt



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: I need to pull one recod per load_id I need the min(A.TMS_EXT_REF_ID ) city,state but

    If your data is such that you could possibly get ties for your minimum value, you can also do this:

    ;WITH cteTemp AS

    (

    SELECT LOAD_ID,

    NAME1,

    HM_TRAILER,

    CITY,

    STATE,

    TMS_EXT_REF_ID,

    ROW_NUMBER() OVER(PARTITION BY LOAD_ID ORDER BY TMS_EXT_REF_ID ASC)...

    └> bt



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: Supplied Value(Number) to be added next to previous values

    I am guessing that what you're trying to do would be much more easily accomplished with an IDENTITY value. But, as the others have noted, without more specific information...

    └> bt



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: Return Top n with a tie

    Joe Celko (7/21/2010)


    A more portable, ANSI/ISO Standard version, with ordinal functions:

    CREATE TABLE Tests

    (Item_nbr INTEGER NOT NULL PRIMARY KEY,

    something_val INTEGER NOT NULL);

    INSERT INTO Tests VALUES

    (1, 90), (2, 80),...

    └> bt



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: Query using right function in where clause is failing

    I can't say why it's different before and after the cumulative update, but I can tell you that this is generally a problematic way to query data.

    Doing any kind of...

    └> bt



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: Recursive CTE to replace a cursor problem

    Jeff's article on the 'Quirky Update' can be found here[/url].

    └> bt



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: counting records in multiple tables

    As Joe was getting at, there are some significant design issues. Ideally, a redesign would be in order. However, I realize there are many times that such things...

    └> bt



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: Rename Table Without Stored Procedure

    Please stop with the random bolds ... really annoying.

    However you rename the table you are going to need to take care of the references to the table. Personally, I...

    └> bt



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: query on indexes

    Keep in mind that these system procs do not return information about included columns, which you may or may not need to know about.

    └> bt



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

Viewing 15 posts - 211 through 225 (of 533 total)