Forum Replies Created

Viewing 15 posts - 6,376 through 6,390 (of 7,619 total)

  • 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.

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • 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...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • 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...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: finding value in a string

    Or this:

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

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: trim column values

    UPDATE dbo.tablename

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

    WHERE col LIKE '%.___%'

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • 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 --...

    ...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • 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...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • 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...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • 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...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • 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...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • 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,...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Problem with Cursor in trigger

    You don't need a cursor at all, just an UPDATE followed by an INSERT (or MERGE, but some people have run into performance issues with MERGE).

    The table names aren't consistent,...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Searching a particular table in DB

    SELECT

    OBJECT_NAME(object_id) AS table_name

    FROM sys.columns

    WHERE

    name IN ( 'col1', 'col2', 'col3' ) AND

    OBJECTPROPERTYEX (object_id, 'BaseType') IN ( 'U', 'V' )

    GROUP...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Finding 2nd and 4th Saturdays of Current Year

    I suggest this method:

    DECLARE @date datetime

    --@date is used just to make it easier to check other dates:

    -- naturally you can hard-code GETDATE() in place of @date if...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Refresh Default Table Value Upon Update

    Sean Lange (9/13/2013)


    If you handled all of your updates via stored proc this would be even easier. 😛 Just add another column to the update statement. If however, as it...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

Viewing 15 posts - 6,376 through 6,390 (of 7,619 total)