Forum Replies Created

Viewing 15 posts - 6,226 through 6,240 (of 7,608 total)

  • RE: column with data type of csv list?

    bkmooney (2/13/2014)


    By using a table (and adding a csv list id, and a sequence number) won't I be tripling the size of the data that is required to be stored?

    Perhaps....

  • RE: column with data type of csv list?

    I'd still use a table. You just need to add some type of csv list id and a sequence #.

  • RE: Query help

    If the function just removes an optional trailing '-' followed by other chars, you can avoid a function completely using CROSS APPLY:

    UPDATE ts

    SET

    Col1 = CASE WHEN...

  • RE: Transaction - No transaction or savepoint of that name was found.

    amy26 (2/11/2014)


    Removing the transaction name does not rectify the situation.

    The only thing that I could think of was we do have an if statement that calls another stored procedure...

  • RE: Indexes ( one without include, one with include)

    The single index with the included columns can handle queries for both ProductKey alone and for ProductKey and one/both of the included columns. That means you only need one...

  • RE: Multiple inserts in a single trigger

    CREATE TRIGGER [dbo].[tr_a] on [dbo].[A]

    AFTER UPDATE

    AS

    SET NOCOUNT ON

    BEGIN TRY

    IF UPDATE(STATUS)

    BEGIN

    INSERT INTO dbo.B

    (

    col0,

    col1,

    ...

  • RE: Daily Comparison of Tables Tips & Tricks (Merge, Union, uniqueidentifiers)

    Look at Change Tracking; it can identity changes vastly more efficiently than what you're doing now.

    If you're on Enterprise Edition, also look at Change Data Capture, which gives you "point-in-time"...

  • RE: Transaction - No transaction or savepoint of that name was found.

    You most likely do have nested transactions, either implicitly or explicitly.

    Just remove the transaction name from the ROLLBACK, which is not meaningful for SQL Server anyway:

    ROLLBACK TRANSACTION /*UPDT_DATA*/

  • RE: Indexes ( one without include, one with include)

    You need to run these commands (or the equivalent). Run them online if possible, and using tempdb for sort if possible:

    DROP INDEX [IX_PurchaseOrderDetail_ProductKey] ON [dbo].[PurchaseOrderDetail]

    CREATE NONCLUSTERED INDEX [IX_PurchaseOrderDetail_ProductKey]...

  • RE: Maintenance Plan

    george sibbald (2/7/2014)


    ScottPletcher (2/7/2014)


    No real DBA would ever use a maintenance plan;

    thats a bit over the top surely?

    Nowhere does it say using maintenance plans per se is not...

  • RE: Performance and tuning of two queries

    And, if the query uses more than one table, use an alias and prefix all columns with the correct alias name. Remember, we have absolutely no idea what columns...

  • RE: Display only month and year as MM/YYYY

    A CONVERT to format 101 will give us format "mm/dd/yyyy". Then, using STUFF, we can remove the "dd/", leaving you with what you want:

    SELECT STUFF(CONVERT(varchar(10), GETDATE(), 101), 4, 3,...

  • RE: Maintenance Plan

    A basic maintenance plan is just terrible for large databases, because it rebuilds every table and every index regardless. You just can't waste that much I/O in a critical...

  • RE: Count NULL columns

    Many of us prefer to generate such code from the table itself, something like below. Uncomment the EXEC(@sql) when ready to actually run the code:

    USE css

    DECLARE @nonrepeated_cols nvarchar(max)

    DECLARE @repeated_cols...

  • RE: AVOID JOINING ON TO THE SAME TABLE MULTIPLE TIMES?

    You could use subqueries instead of joins, like this:

    SELECT

    FI.*,

    (SELECT TOP (1) C.ClassName_FD

    FROM DBA.Class_TB AS C...

Viewing 15 posts - 6,226 through 6,240 (of 7,608 total)