Forum Replies Created

Viewing 15 posts - 6,361 through 6,375 (of 7,608 total)

  • RE: Question about select count(*)

    ... will select count(*) get the keep changed record numbers even if (nolock) hint is on?

    Actually, it will count uncommitted records if and only if (nolock) or the equivalent is...

  • RE: Using Alias in Where

    I prefer CROSS APPLY(s) to CTE(s) for aliasing. For example:

    Select TOP 5 ID ,MID, RName,Pic1,FoodType.Descr AS FoodType,Average_P_PP,lat,lng,

    ca1.Distance

    From Member WITH(NOLOCK)

    INNER JOIN FoodType WITH(NOLOCK) ON...

  • RE: Shift week to Wed - Tues

    Why mess with the DATEFIRST setting when it's not necessary? There are methods which can do the calculation simply without needing a specific datefirst setting, so why hassle with...

  • RE: Nesting Error for CASE Statement that Isn't Nested

    As another kludge, you could probably do this:

    COALESCE(

    CASE WHEN @MonthUnits = 1 THEN GBAN01 ELSE NULL END,

    CASE WHEN @MonthUnits = 2 THEN GBAN02 ELSE...

  • RE: Any *easy* way to compare database schemas, without a 3rd party tool?

    You can use a FULL OUTER JOIN to find columns that are in only one object and not the other.

    I can post sample code for that if you'd like.

  • RE: Any *easy* way to compare database schemas, without a 3rd party tool?

    You're on the right track; definitely use the sys. views rather than the INFORMATION_SCHEMA views, which are not reliable in SQL Server (from 2005 on).

    These are the basic tables you'll...

  • RE: DBA Roles and Responsibilties

    I've been a manager. I'm not sure immediately running to a higher-level authority reflects well on you.

    Avoid the drama if at all possible. Speak privately and directly with...

  • RE: finding value in a string

    Or this:

    SELECT SUBSTRING(@MyValue, CHARINDEX('<EntryID>', @MyValue) + 9, CHARINDEX('</EntryID>', @MyValue) - CHARINDEX('<EntryID>', @MyValue) - 9)

  • RE: trim column values

    UPDATE dbo.tablename

    SET col = LEFT(col, CHARINDEX('.', col) + 2)

    WHERE col LIKE '%.___%'

  • RE: Query with One Column Changing by Month

    INSERT INTO #tmpJDEnbrunits

    SELECT

    '000' + ltrim(MCMCU),

    CASE @MonthUnits WHEN 1 THEN GBAN01 WHEN 2 THEN GBAN02 WHEN 3 THEN GBAN03 --...

    ...

  • RE: Problem with Cursor in trigger

    I think this rewrites the UPDATE; don't have time now to do the INSERT. The code is somewhat confusing in that sometimes ITEMID is matched on and other times...

  • RE: Problem with Cursor in trigger

    UPDATE TEMPINVENTSUM

    SET ESHOPINVENTSUM.ITEMID =@ITEMID

    ,ESHOPINVENTSUM.INVENTLOCATIONID= @INVENTLOCATIONID

    ,ESHOPINVENTSUM.AVAILPHYSICAL = @AVAILPHYSICAL

    WHERE ESHOPINVENTSUM.ITEMID =@ITEMID AND ESHOPINVENTSUM.INVENTLOCATIONID= @INVENTLOCATIONID

    I don't see table "ESHOPINVENTSUM" in the query. Is it supposed to be TEMPINVENTSUM? Or...

  • RE: Any point in EVER shrinking trans log?

    If you need a (very) large log, rather than a single very large allocation, you might be better off growing in somewhat smaller chunks. For example, if you need...

  • RE: Any point in EVER shrinking trans log?

    An overgrown log file can have too many VLFs, which can adversely affect performance.

    On some disks, the autogrowth can result in a less contiguous log file, which can also affect...

  • RE: Lookup tables - when too ude them

    Just as a possibility: Check constraints instead will reduce overhead slightly, since another table doesn't have to accessed. For a very limited number of known and easily recognized values,...

Viewing 15 posts - 6,361 through 6,375 (of 7,608 total)