Forum Replies Created

Viewing 15 posts - 2,716 through 2,730 (of 3,008 total)

  • RE: The Cult of Mediocrity

    Risk vs. reward is always a difficult subject, and not always about having the best information or making the best decision.  Sometimes you just get lucky or unlucky.

    Take the example...

  • RE: How to Find Beginning and End of Month depending on YEAR

    I use a slightly different method for the last day of the month:

    select
            dateadd(mm,datediff(mm,0,a.Date),0)     as FirstDayOfMonth,
            dateadd(mm,datediff(mm,-1,a.Date),-1)   as LastDayOfMonth,
            dateadd(mm,datediff(mm,0,a.Date)+1,0)   as FirstDayOfNextMonth
    from
           ( select Date = getdate() ) a
    
     
  • RE: Script to list all PK & FK keys?

    -- Get Primary keys
    select
     *
    from
     INFORMATION_SCHEMA.TABLE_CONSTRAINTS a
    where
     CONSTRAINT_TYPE = 'PRIMARY KEY'
    -- Get Foreign Keys
    select *
    from
     INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS a
    -- PK/FK matches
    select distinct
     PK_TABLE = 
     b.TABLE_SCHEMA+'.'+b.TABLE_NAME,
     FK_TABLE = 
     c.TABLE_SCHEMA+'.'+c.TABLE_NAME
    from
     INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS a
     join
     INFORMATION_SCHEMA.TABLE_CONSTRAINTS b
     on
     a.CONSTRAINT_SCHEMA = b.CONSTRAINT_SCHEMA and
     a.UNIQUE_CONSTRAINT_NAME = b.CONSTRAINT_NAME
     join
     INFORMATION_SCHEMA.TABLE_CONSTRAINTS c
     on
     a.CONSTRAINT_SCHEMA = c.CONSTRAINT_SCHEMA and
     a.CONSTRAINT_NAME =...
  • RE: birthdate as a non date field

    I think you have to start with the business requirement and ask:

    “Is partial information of any value?  Does year alone have any value?  Does year and month have any value? ...

  • RE: Hardware & RAID Configuration - What''''s the best

    As I stated in my post:

    "I think it is equally valid to say that you should compare on an equal cost basis to see which gives the best IO performance...

  • RE: Hardware & RAID Configuration - What''''s the best

    Can you offer any proof for this statement:

    "A single disk suffers a 75% degredation on io performance on raid 5 compared to raid 10 ( or raid 1 ) for...

  • RE: The Joy of Numbers

    Jeff, I think your tests may have taken advantage of having master.dbo.syscolumns in cache, something that may or may not be the case.  Also, one was loading a temp table...

  • RE: When is the logical file name referenced?

    There is also DBCC

    DBCC SHRINKFILE (DataFil1, 7)

  • RE: When is the logical file name referenced?

    Don't forget BACKUP.

    BACKUP DATABASE MyNwind

       FILE = 'MyNwind_data_1',

       FILEGROUP = 'new_customers',

       FILE = 'MyNwind_data_2',

       FILEGROUP = 'first_qtr_sales'

       TO MyNwind_1

  • RE: How to find out the maximum among the four columns

    If the tables were properly designed, there would be no need for this thread.

     

  • RE: How to find out the maximum among the four columns

    If anyone is interested, I ran performance tests of the 2 methods from my prior post, and posted the results on the link below.

    MIN/MAX Across Multiple Columns

    http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=86906

  • RE: Identifying gaps in numbering sequence of a table

    I wrote the function on the code below to quickly generate number tables.

    It executed this code to load a table with 1,000,000 numbers in 6.780 seconds.  When I ran it...

  • RE: The Joy of Numbers

    I wrote the function in the code below to quickly generate number tables.

    It executed this code to load a table with 1,000,000 numbers in 6.780 seconds.  When I ran it to...

  • RE: Confused by article in sqlservercentra.com ?

    I think the wording in the article may be wrong.

    It should say that the fill factor should be LOWERED, for example from 95% to 70%.

     

  • RE: Cross Joins

    You said "I still think there are better ways to do this than your above example".  You didn't provide the example of something that would duplicate the function of F_TABLE_NUMBER_RANGE from my...

Viewing 15 posts - 2,716 through 2,730 (of 3,008 total)