Forum Replies Created

Viewing 15 posts - 211 through 225 (of 247 total)

  • RE: DateDiff function

    -- This is not elegant.

    declare @HireDate as datetime

    set @HireDate = '1/1/1990'

    -- Pre-calculation

    declare @Now as datetime

    declare @NowPlus30Days as datetime

    declare @dy1 as int, @dy2 as int -- for the day...

  • RE: DateDiff function

    quote:


    
    
    SELECT FName, LName, Hire_Date
    FROM Employee
    WHERE DATEDIFF(dd,GETDATE(),DATEADD(yy,DATEDIFF(yy,Hire_Date,GETDATE()),Hire_Date)) BETWEEN 0 AND 30

    --Jonathan


    I do...

  • RE: Intelligent vs. Surrogate keys

    quote:


    The two MAIN reasons I like identity columns is that you can put a clustered index on them and your inserts will...

  • RE: VB.NetCentral.com

    Thanks for the links. DevHood seems the most similar; however, it's odd that this site rates me as a level 1 peasant. I resent that - as a...

  • RE: How to move sp from 1 SS2k to another SS2k

    You can also use EM Import/Export or the DTS copy sql server objects task. There is a point at which you can select the objects to copy - rather...

  • RE: single sql statement needed

    More fun...

    create table #TableData (

    Manufacturer varchar(12) NOT NULL,

    Color varchar (15) NOT NULL

    ) ON [PRIMARY]

    insert into #TableData (Manufacturer, Color)

    select 'Toyota','Blue'

    union all

    select 'Toyota','Blue'

    union all

    select 'Honda','Red'

    union all

    select 'Honda','Red'

    union all

    select 'Honda','Green'

    union all

    select 'Ford','White'

    union...

  • RE: single sql statement needed

    It would be nice to have an aggregate "SUM" that worked on strings. I've needed it before. Perhaps a pivot table like approach? I use the trim...

  • RE: grouping data

    In general, if you need more data from the one record in the group, use a derived table to get the key and join. For example,

    SELECT A.Id, A.Name,...

  • RE: sp3/sp3a

    The MDACs are different.

    sp3 - MDAC 2.7 sp1

    sp3a - MDAC 2.7 sp1 refresh

    Its not MDAC sp1, sp2, or sp1a - it's "refresh". Perhaps MDAC 2.7 sp1...

  • RE: To delete temp tables or not to?

    I like to put the drop in myself. Sometimes to debug a procedure, I copy it into QA and comment out the stored procedure specific stuff (changing the params...

  • RE: Transferring stored procedures (SQL Server 2k)

    One more thing. If your developers give you scripts to move procedures, make sure any permission grants are outside the procedure, not part of the procedure. Also, do...

  • RE: Transferring stored procedures (SQL Server 2k)

    We have about 20 dev, stage, and prod SQL Servers and many developers - about a dozen dbs per server. We found the best way to handle permissions on...

  • RE: BCP

    I think the view will work if the destination table has extra columns, not fewer.

  • RE: BCP

    Format files can be a pain. I would first create a table to match the file structure exactly and use a DTS bulk insert task. It has a...

  • RE: Slow running query (Sometimes)

    I noticed that the reads are 4x on the "slower" machine. How do the cluster sizes compare?

Viewing 15 posts - 211 through 225 (of 247 total)