Forum Replies Created

Viewing 15 posts - 4,531 through 4,545 (of 6,036 total)

  • RE: Ranking in tsql

    I would store this kind of ranking in separate column and update this column using trigger when data in the table is changed.

    This update not suppose to happen to often,...

  • RE: Distinct performance???

    sol,

    how many records WITHOUT distinct (see Jeff's query) and how "heavy" is each of those records?

    I mean what is aggregate size of all columns in your recordset?

  • RE: INSERT using EXEC problem

    Locks really depend on data statistics, indexing, etc.

    Someone dropped or changed an index on this table, statistics forced Server to choose another execution plan...

    It's not so easy to guess,...

  • RE: INSERT using EXEC problem

    Because when you have INSERT outside the whole SP appears locked in transaction (INSERT is implicit transaction, right?)

    It does not happen if you perform INSERT inside of SP.

  • RE: INSERT using EXEC problem

    Try this workaround:

    SELECT * INTO #agingData

    FROM dbo.agingData

    WHERE 1=0 -- copies table structure, no data copied

    INSERT #agingData

    EXEC dbo.populateAging

    INSERT INTO dbo.agingData

    SELECT * from #agingData

    If it works it's definitely...

  • RE: INSERT using EXEC problem

    Jason,

    do you read table dbo.agingData inside SP?

    It appears locking problem.

    If you perform INSERT ... EXEC you lock targeted table. If you are trying to read something from this table...

  • RE: Update Trigger questions / multiple rows in "inserted" table

    CREATE TRIGGER Trig_vendor_code ON [vendor] FOR UPDATE

    AS

    UPDATE V

    SET vendorcode = i.vendorcode

    FROM dbo.Vendor V

    INNER JOIN inserted i ON V.origvenid = i.vendorID

    WHERE V.vendorcode i.vendorcode -- add NULL checks if...

  • RE: URGENT !! Need Help with Apostrophe or single quote

    CREATE PROC dbo.Blah-blah ..., @NAME varchar(255), ....

    AS

    ...

    SET @NAME = replace ( @NAME,char(39),char(39)+char(39))

    ...

    GO

  • RE: Distinct performance???

    DISTINCT is simplest option of GROUP BY.

    It makes SQL Server rescan returning resultset and group the data.

    It involves creating hash table in tempbd for holding temporary data.

    Your query must return...

  • RE: Using a field name in calculation

    Breaking relational data model and normakization rules is not smart.

    It does not simplify your life.

    Homogenious data must be in a single column. Period.

    And column names [1]...[18] must become numbers in...

  • RE: weekday function

    Look for DATEPART in BOL.

    Check cross links there to be aware of other datetime functions.

  • RE: displaying the rows

    I don't see any problems with EAV for those who does not use to use SELECT *

    In poperly designed application you need to return FirstName, LastName, etc. once per person....

  • RE: Breaking a date into multiple parts

    Join to CALENDAR table.

  • RE: Query Efficiency

    I know the way.

    Normalize your data and get rid of fat tables.

  • RE: displaying the rows

    One view could solve all your problems with joins.

Viewing 15 posts - 4,531 through 4,545 (of 6,036 total)