Forum Replies Created

Viewing 15 posts - 6,466 through 6,480 (of 7,616 total)

  • RE: left join question

    In the context of a LEFT JOIN, yes, the queries would return the same rows from TableA (although, as noted, they might appear multiple times because of the join).

    That is,...

  • RE: Indexes

    You shouldn't have any direct issues from doing that.

    First, drop the existing nonclus index, then create the clus index.

    Build the index ONLINE if at all possible, to minimize disruption to...

  • RE: Sanity Check - Disable and re-Enable a Trigger in a Sproc

    Instead of constantly disabling/enabling the trigger, you can set RECURSIVE_TRIGGERS off for the db, unless you really need recursion for other triggers. In that case, you can use CONTEXT_INFO...

  • RE: Triggers on Tables

    I think DISABLE is far more dangerous, since it applies to every task modifying the table.

    Instead you can use CONTEXT_INFO to selectively exit the trigger / skip all/part of the...

  • RE: Trying to iteratively use PATINDEX commands to comb through a large amount of text

    The code uses LIKE to compare the string, so just construct your string accordingly.

    For example, you could use 'ls-' as the search string. Or, if you want a closer...

  • RE: Identify string or integer

    EXEC Stored_procedure1 ('abc')

    EXEC Stored_procedure1 ('123')

    EXEC Stored_procedure1 ('abc112')

    Yes. The core of the logic is this:

    CASE WHEN <string_value> LIKE '%[^0-9]%' THEN <string> ELSE <int> END

    For example:

    SELECT

    data,

    ...

  • RE: Triggers on Tables

    cdl_9009 (8/14/2013)


    Is there a way to turn a table trigger off in a stored procedure, then turn it back on after it skips that table.

    We have the trigger in place...

  • RE: Trigger JOBS

    Assuming the account running "JobA" has the authority to start jobB, the command in JobA would be:

    EXEC msdb.dbo.sp_start_job 'JobB'

  • RE: Trying to iteratively use PATINDEX commands to comb through a large amount of text

    That code's written for SQL 2000; I suggest completely ignoring it.

    Instead, the code below should give you a list of object names and their full text reasonably quickly.

    If you want...

  • RE: Date incrementing

    Extremely vague, but perhaps:

    DATEDIFF function

    DATEADD function

    might help you.

  • RE: Differential backup

    Typically:

    .dif = differential backup

    .fil = filegroup backup

    .trn = tranlog backup

    as most people follow MS's lead, as they did with .bak, .mdf, .ndf (silly, imo, why not .mdf also???), etc..

  • RE: How to Group by the Past Seven Days

    garyh2k3 (8/13/2013)


    My spreadsheet has sample data of grouped by month, grouped by Day. I would like the same date displayed for the group by the past 7 days. ...

  • RE: Can a table have two primary keys?

    seshu67 (8/7/2012)


    Can a table have two primary keys

    Absolutely no, period. The fact that separate unique constraints can be defined does not make them primary keys as well.

    Similarly, a table...

  • RE: Query help - summing between dates ranges and calculations...

    Stefan_G (8/9/2013)


    Easy enough to change the WHERE on the date to an OR with the two specific date ranges.

    If the @StartDate is the start of the current period -- which...

  • RE: Restore the mdf from a BAK to multiple drives possible?

    You can't do it as part of the restore. You could do it after it was restored, but it would involve some serious effort though.

    Maybe you could instead restore...

Viewing 15 posts - 6,466 through 6,480 (of 7,616 total)