Forum Replies Created

Viewing 15 posts - 181 through 195 (of 2,893 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

  • 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 ...

    ...

  • 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...

  • 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...

  • RE: how to reduce sorting cost?

    The cost figure is a relative number.

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

  • 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...

  • 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...

  • RE: Replace a reserved keyword

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

  • 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...

  • 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...

  • 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...

  • 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...

  • 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...

  • 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 *...

  • 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....

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