Forum Replies Created

Viewing 15 posts - 181 through 195 (of 2,894 total)

  • RE: extract a string from a stored proc definition

    don't you think that you are missing wild-card at the begining of the pattern:

    PATINDEX('%BOCTEST.%', @source_code) as Pos, @proc_Name

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: SQL for adding flags depending on criteria

    ...

    The columns above do not relate to the actual columns I use, just an example.

    just as an example...

    you can do in T-SQL:

    SELECT ...

    ...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Invalid Cursor Position

    There is no single setting in SQL Server which is responsible for this sort of behaviour.

    There are mulitple reasons for this error to happen. Are you using TEXT datatypes anywere...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Sum float datatype column

    What do you mean by "I'm unable to sum the cost."? SUM can be applied to float.

    As float are not exact datatype it is a bad choice for such calculations...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: how to reduce sorting cost?

    The cost figure is a relative number.

    If you want your sorting to be faster - create an index.

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: updating a column with a new sequence numbering

    It is usually considered as a bad design to have resequencing records in a table for such case as your.

    Any way, you can do this:

    ;with cte

    as

    (

    select...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Replace a reserved keyword

    1. sql injection:

    In your case it may not be as simple as just using sp_executesql, as even passing some nice value for @pivot may create an issue. For example the...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Replace a reserved keyword

    You can enclose your "Pivot" into square brackets: [Pivot]

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: SQL Joins

    you always will have trouble with this join as your US code of '1' can match any fialed number starting with 1.

    BTW: don't use NOLOCK - it's a pass to...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Index question

    please note, the the following is a bit different setup...

    CREATE INDEX IX_myindex1 ON mytable (ColumnA, ColumnB);

    CREATE INDEX IX_myindex2 ON mytable (ColumnB);

    As, Grant mentioned, the Index(A,B) and Index(A) will have identical...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Index question

    It depends.

    What do you plan these indexes will be used for? Are you going to use these columns in JOINS, sometimes one sometimes two? SELECTS?

    There is nothing wrong in...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: result in text file?

    Jeff Moden (2/10/2014)


    Eugene Elutin (2/10/2014)


    Jeff Moden (2/10/2014)


    MyDoggieJessie (2/10/2014)


    Of course, you make valid points - 😉 I originally suggested SSIS, but provided a TSQL alternative - not pretty, but there it...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: result in text file?

    Jeff Moden (2/10/2014)


    MyDoggieJessie (2/10/2014)


    Of course, you make valid points - 😉 I originally suggested SSIS, but provided a TSQL alternative - not pretty, but there it is...

    The use of xp_CmdShell...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: how to get max column name that meets certain criteria

    Completeley agree with Luis: very weird design decision...

    However there is another puzzle solution:

    UPDATE #TableA

    SET FLAGB2 = COALESCE(4.4 * [4.4]/[4.4],4 * [4]/[4],3.3 * [3.3]/[3.3],3 * [3]/[3],2.2 * [2.2]/[2.2],2 * [2]/[2],1.1 *...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: result in text file?

    There are few things in this design which would make me to reject this solution completely:

    1. Use of xp_cmdshell

    2. Writing file out on SQL Server (or mapped dirve)

    3....

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

Viewing 15 posts - 181 through 195 (of 2,894 total)