Forum Replies Created

Viewing 15 posts - 31 through 45 (of 283 total)

  • RE: Insert and Update

    CrazyMan (10/10/2008)


    I need to make the 2 SQL statements into one, is'nt there a MERGE statement on SQL 2005 🙂

    Yeah, but in 2005 it's call UPSERT.

    ...tick...

    ...tock...

    (Wait for it....)

    ...tick...

    ...tock...

    Ok, before you...

  • RE: Exclude Word List to filter SELECT results

    I know this is a 2005 thread, but here is a simple solution that will work anywhere. I'm a big fan of the KISS principle. 🙂 (I'll just shamelessly borrow...

  • RE: converting datetims variable string to datetime sql server

    mazal0404 (9/29/2008)


    "INSERT INTO tblDate (myDate , WorkerNum) VALUES ( ' + d + ',

    '" + workerNum + "')";

    According to this, you're trying to convert the string ' + d +...

  • RE: Stored Procedures - Performance -Pros & Cons

    Steve Jones - Editor (9/16/2008)


    Be curious to know why stored procs are a nightmare for insert/updates.

    create proc dbo.UpdateTable( @Col1 int, @Col2 varchar(10))

    as begin

    update dbo.UnderlyingTable

    set Col1 =...

  • RE: Executing S.P. so default parameter values are used

    I generally (ok -- always) put parameters with default values at the end of the list:

    create proc my_sp

    @p1 varchar (20),

    ...

  • RE: Stored Procedures - Performance -Pros & Cons

    Coming from the developer's perspective, I have not found a significant performance difference between views and SPs. And when the performance is close enough, I start emphasizing other characteristics such...

  • RE: Calculating Work Days

    Use it any way you would use any function:

    if DateDiff( dd, @Startdate, @EndDate ) > dbo.fn_Workdays( @Startdate, @EndDate ) begin

    -- There is at least one weekend...

  • RE: Intellisense in SSMS 2008

    One of the first problems I noticed with IntelliSense in 2008 is after altering a table. It doesn't display new columns in the drop-down and keeps underlining the newer columns...

  • RE: Calculating Work Days

    dulanjan (9/8/2008)


    exec fn_WorkDays @startdate,@enddate

    help!

    Use exec to call a stored procedure. When calling a function, you have to capture the returned value for further processing and/or display.

    declare @WorkDayCount int;

    set @WorkDayCount =...

  • RE: populate a weeks worth of data from daily data

    Michael Valentine Jones (9/4/2008)


    My solution was specifically meant to be NOT responsive to the setting of DATEFIRST.

    Why? The purpose of DATEFIRST is to allow your functions and procedures to react...

  • RE: populate a weeks worth of data from daily data

    ggraber (9/4/2008)


    Later the OP seemed to say that the last day of the week could be Saturday.

    Paul Manning (9/2/2008)


    I've no problem with creating a view for this but there must...

  • RE: populate a weeks worth of data from daily data

    Sergiy (9/3/2008)


    Tomm,

    THe beauty of the solution posted by Michael is it does not depend on DATEFIRST settings.

    Moreover, it allows to set required "datefirst" as a parameter.

    So, what's the point...

  • RE: populate a weeks worth of data from daily data

    With a little less inline code, the query would look like this:set DateFirst 1; -- Set first day of week to Monday

    select dbo.WeekBegins( SalesDate ) as WeekOf, Line, Count(*)...

  • RE: A constaint Question about a Multiple part key

    meichner (8/25/2008)


    I am fairly new at this DB stuff...

    Yes, that you are new was obvious from the fact that all your fields are strings, even though some contain dates and...

  • RE: How can I calculate how many mussels have been shucked?

    rbarryyoung (8/27/2008)


    But it does not make sense, nor is it what was spec'ed.

    Sigh! You can be so stubborn! You should be more like me and just have the courage of...

Viewing 15 posts - 31 through 45 (of 283 total)