Forum Replies Created

Viewing 15 posts - 556 through 570 (of 1,347 total)

  • RE: Delete duplicate row

    >>There is as such no criteria in our case to decide which one to delete or which one to keep

    That makes no sense from a business point of view.

    Why...

  • RE: Simple join query question

    >>HR just know

    It is difficult, if not impossible, to code a solution for a business problem where "people just know stuff".

    You need to dig up the business rules/requirements before writing a...

  • RE: Updating Multiple Tables

    >>Can I use a variable for the table name? If so, what is its delcaration type?

    No, you need to build SQL in a string and execute it dynamically. Search the...

  • RE: DTS Embedded SQL Code or Stored Procedure?

    >>MIS supervisor

    I have 1 of those too, who believed the same thing, because the highly paid "suits" who were consulted to build our 1st datamart said they'd had "problems"...

  • RE: DTS Embedded SQL Code or Stored Procedure?

    >>Should'nt the SQL code been written in  procedures, and then DTS tasks to execute each procedure?? Please comment.

    I would also say yes, for the reasons already mentioned, but also for...

  • RE: Trigger to compare incoming record w/ previous record

    You don't need to join to the base tables, just compare inserted & deleted:

    Create Trigger tbl_pts_positions_Update_01_Tr

    On tbl_pts_positions After Update

    As

    Begin

      Insert Into tbl_pts_positions_history

      (

        PoID,fname,lname,city,state,jobcode,

        descr,temp_ends,Eff_Date,Comments,Trans_Time

      )

      Select d.*,...

  • RE: Case Statement

    I don't think it needs to be that complex:

    Select Calldate, Project,

      Sum(

       Case 

        -- Add hours if Project ends in 5 or if at requested @Site

       ...

  • RE: Statement(s) could not be prepared.

    What are you expecting this DISTINCT to do ?

    >>select distinct(users.country), iso.a2 as cc

    You can't DISTINCT just 1 column in the resultset, if that is the intent of the parentheses.

     

     

  • RE: Case Statement

    Right, but this highlights my comment on requirements statement not matching sample data:

    >>group by Calldate,Project

    If you GROUP BY Project, and there is more than 1 Project at a site that...

  • RE: Case Statement

    Your sample output does not match your stated requirements:

    If site parameter of 2 is passed.

    I need to see the following results:

    Calldate Project TotalHours

    20060217 EAUD5 2.5

    20060217 EACQ5 5

    20060217 EACQ6...

  • RE: Case Statement

    SELECT 'I have a CASE in my WHERE'

    WHERE (

      CASE

       WHEN 'Apples' = 'Oranges' Then 0

       ELSE 1

      END ) = 1

  • RE: Case Statement

    Yes

  • RE: what is wrong with my stored procedure keyword End

    Why not start small ? get 1 subset working, then add additional IF conditions ?

    CREATE PROCEDURE [dbo].[get_phy_list] (

     @DateFrom datetime,

     @DateTo datetime,

     @mName varchar(50) =null

    )

    AS

    BEGIN

    declare @moduleName  datetime

    if @mName is null 

  • RE: what is wrong with my stored procedure keyword End

    It also needs to be pointed out that many of your joins are incorrect syntax. You have multiple INNER JOINs that are missing their ON () join column list.

    And of...

  • RE: what is wrong with my stored procedure keyword End

    You are missing a BEGIN keyword:

    CREATE PROCEDURE [dbo].[get_phy_list]

     @DateFrom datetime,

     @DateTo datetime,

     @mName varchar(50) =null

    AS

    BEGIN

     

     

Viewing 15 posts - 556 through 570 (of 1,347 total)