Forum Replies Created

Viewing 15 posts - 271 through 285 (of 1,082 total)

  • RE: Problem with Dynamic SQL

    also remember that each @sql in an EXEC(@SQL) will only allow for 4000 charaters to be run.

    So if it's long you need to do something like this

    EXEC (@SQL + @SQL1)...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: TOP vs SET ROWCOUNT -- Are they Twins?

    I guess the other thing to remember , I have picked up from some more research is that they do have slightly different characteristics...

    TOP can be used in subqueries etc.

    SET...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: TOP vs SET ROWCOUNT -- Are they Twins?

    mmm I don't get a hash

    I get loops in both. but there is an extra operator for the top...

    but like you I'm unsure which is better

    I'll do some more...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: CONVERT :( --> :) - Strange query same result

    ah I see,

    I'm sorry but my knowledge of memory consumption is limited but my guess is going to be that the first statement is the best.

    2 is out cause SQL...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: CONVERT :( --> :) - Strange query same result

    1 and 2 are almost the same.

    your string can be converted to a decimal directly from

    '12344.83937898' to .12344.83937898

    Now when converting a numeric/decimal to a numeric/decimal, rounding occurs, you can...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Return first match in second table of a left join statment

    ok cool,

    but how do you determine priority of minuterate?

    There is no idea or order by in that table?

    or will the 1800% always take preference over 1_______?

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: New Monthly Contest Back!

    I'm assuming there is not competition anymore?

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Return first match in second table of a left join statment

    Is this the kind of thing you trying to do?

    SELECT *

    FROM Table1 a

    INNER JOIN Table2 b

    ONPATINDEX(b.Pattern,finalCalledPartyNumber) != 0

    Not the best solution yet, cause you will get no index usage...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Return first match in second table of a left join statment

    I under stand that the 1800% would match to row 1 of your table1 in the example.

    I'm unsure what the 1__________ will match to in table1 and Why?

    Thanks

    Chris

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Books OnLine?

    I'm with Grant on this one.

    I don't think a day goes past without me using BOL, however I wouldn't recommended to someone learning SQL for the first time.

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Need help with a sql query (Stock Movement Report)

    I think the OP does have joins in his Code however they are using the old SQL syntax.

    OP If you are new to SQL it is highly recommended that you...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Pivotting

    Here is a pretty good article by Jeff, about dynamic pivoting using cross-tabs which seem to be faster than actually using the PIVOT function in 2005.

    check it out:

    http://www.sqlservercentral.com/articles/cross+tab/65048/

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Case statment:while runing the below sql stmt i get execption :Case statment: Msg 102, Level 15, State 1, Line 7:

    try this

    WHERE

    (@pAnnualReviewFlag = 1

    AND

    (Coalesce(annual_review_type_id,0) IN (1,5))

    OR

    (@pAnnualReviewFlag != 1

    AND

    (Coalesce(annual_review_type_id,0) IN (2,6))

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Server settings (Auto RTRIM Happening?)

    Sorry to bring this up, but has anyone else got some advice on this ?

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: cross-tab alternative in sql

    also if you give us an example of some data then we could help you.

    I don't understand the syntax you have pasted so I'm not 100% sure what you pivoting.

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life

Viewing 15 posts - 271 through 285 (of 1,082 total)