Forum Replies Created

Viewing 15 posts - 136 through 150 (of 275 total)

  • RE: Rebuild Index - Strange Problem

    If you've got a lot of old data, you could partition the db so that new data was separate from old data. That could reduce the new partition size...

    Scott Pletcher, SQL Server MVP 2008-2010

  • RE: Query - Start Date, End Date count for each year

    OFF-TOPIC:

    2. The task given looks like just an one-off query, for which I don't thing you need to over engineer solution.

    Wow, that's a STUNNINGLY HUGE!!!! change from your responses here:

    http://www.sqlservercentral.com/Forums/Topic936326-338-1.aspx?Highlight=studid

    And...

    Scott Pletcher, SQL Server MVP 2008-2010

  • RE: Column Mapping Using Bulk Insert command In tsql.

    Be prepared for some effort: format files are a BEAR to get working, esp. the first time you try to use them.

    The good thing is, once you get the format...

    Scott Pletcher, SQL Server MVP 2008-2010

  • RE: Query help..

    172 2010-02-02 00:00:00.000 2010-03-03 00:00:00.000

    172 2010-02-09 00:00:00.000 2010-03-28 00:00:00.000

    only one row will be returned i.e

    172 2010-02-09 00:00:00.000 2010-03-28 00:00:00.000

    How does the code "know" which row(s) is(are) the "exception" rows...

    Scott Pletcher, SQL Server MVP 2008-2010

  • RE: Rebuild Index - Strange Problem

    Note that you can still defragment the index "live", you just can't fully rebuild it.

    Scott Pletcher, SQL Server MVP 2008-2010

  • RE: Rebuild Index - Strange Problem

    I don't see any restrictions like that in MS docs on online index rebuilds. So that is an odd error.

    Scott Pletcher, SQL Server MVP 2008-2010

  • RE: Rebuild Index - Strange Problem

    It sounds like it means that if a text column is in the table at all, you can't rebuild online. Will reseach more to confirm.

    Which version of SQL?

    Scott Pletcher, SQL Server MVP 2008-2010

  • RE: INSERT EXEC can't be nested!

    I would use a temp table for this.

    You also need to get away from the dynamic SQL

    INSERT INTO #table --or @table may work

    EXEC sp_replmonitorhelpsubscription NULL,NULL,NULL,0,0,0,NULL,0

    Scott Pletcher, SQL Server MVP 2008-2010

  • RE: Change Connection with T-SQL

    It's safest to always add EXEC before stored proc names.

    Because only the first statement in a batch has the EXEC "implied".

    Scott Pletcher, SQL Server MVP 2008-2010

  • RE: "Case When Then" Issue When Concatenate After Calculation

    CAST the result to decimal(nn, 2).

    For example, something like this:

    SELECT

    'DataSize' =

    CASE WHEN DataSize >= 1024

    ...

    Scott Pletcher, SQL Server MVP 2008-2010

  • RE: Combine Two Tables

    select a.*, b.*

    from TableA a

    inner join (

    select clientid, MAX(tbid) AS tbid

    from tableB

    group by clientid

    ) AS bMax...

    Scott Pletcher, SQL Server MVP 2008-2010

  • RE: Trigger on delete of ANY table of Database?

    I have tested DENY, even up to db_owner, and it works (interesting that it worked even for db_owner).

    But my extensive testing was under SQL 2000. Naturally you'll want to...

    Scott Pletcher, SQL Server MVP 2008-2010

  • RE: Trigger on delete of ANY table of Database?

    There is a separate DENY command:

    DENY DELETE ON <tablename> TO <user/role>

    I think you can even specify multiple tablenames and/or users and roles in the same command.

    [EDIT: You cannot specify multiple...

    Scott Pletcher, SQL Server MVP 2008-2010

  • RE: Trigger on delete of ANY table of Database?

    Yes, you need a trigger on every table.

    You could try DENYing them DELETE (which is stronger than just not GRANTing them permission) as a good first step. But that's...

    Scott Pletcher, SQL Server MVP 2008-2010

  • RE: Trigger on delete of ANY table of Database?

    Are you talking about row deletion or table deletion (DROP)?

    Scott Pletcher, SQL Server MVP 2008-2010

Viewing 15 posts - 136 through 150 (of 275 total)