Forum Replies Created

Viewing 15 posts - 2,221 through 2,235 (of 3,543 total)

  • RE: Strange behaviour or expected behaviour with convert and left?

    quoteSo why does SQL Server 2000 gives 'Aug 2 200' back when I do a left 10 from...
  • RE: problems with order by/case statements and distinct

    use group by instead, eg

    select arrangements.description,arrangements.number_sql as arrno,[col1],col[2],[coln]

    from events inner join arrangements on events.arrangement_number = arrangements.number_sql

    where events.room_number in (61,59, 50)

    and events.performance = -1

    group by arrangements.description,arrangements.number_sql as arrno,[col1],col[2],[coln]

    order by

    case lower(@@Orderby)

    when...

  • RE: OPENQUERY and dynamic SQL

    No it is not a typo (the highlight and underline is the forum's doing)

    Look up syntax in BOL

    sp_executesql [@stmt =] stmt

    [

        {, [@params =] N'@parameter_name  data_type [,...n]' }...

  • RE: OPENQUERY and dynamic SQL

    CREATE PROCEDURE [dbo].[linked_Server_Test]

      @ORDERID bigint, @errorcode char(2) OUTPUT

    DECLARE @Accref varchar(50), @sql nvarchar(4000)

    SET @sql ='SELECT @Accref = CustomerID

    FROM OPENQUERY(LINKEDSERVERNAME,

    ''

    SELECT CustomerID

    FROM dbo.SS_ORDER

    WHERE O.OrderID = ' +...

  • RE: SQL Query Again - Complex

    Don't forget modest as well 

  • RE: SQL Query Again - Complex

    is that another vote for sushila then 

  • RE: sorting a column

    quoteI am surprised that I am falling that much behind

    Not as much as I

  • RE: sorting a column

    quoteI suppose you are thinking of something like

    Yep!

  • RE: SQL Query Again - Complex

    Have you defined the parameters as output?

    When you execute this in QA do you get any results?

  • RE: SQL Query Again - Complex

    No. Just make sure they are the same size as the source columns in the Bets table.

  • RE: SQL Query Again - Complex

    In that case change the code to

    DELETE FROM TABLE MatchingBets

    INSERT INTO INTO MatchingBets

    (BetID,USERID,BETTYPE,Matches,Mystery)

    SELECT BetID,USERID,BETTYPE,0,0

    FROM Bets

    and make sure the table structure contains the following columns in the correct order BetID,USERID,BETTYPE,Matches,Mystery

     

  • RE: SQL Query Again - Complex

    Are you using a permanent or temp table?

    If you are using a temp table you will get this error in QA if you do not drop the temp table when...

  • RE: sorting a column

    Yes a built in function would be nice, I bet it would use the equivalent of CHARINDEX & SUBSTRING as PARSENAME probably does

    Performance...

  • RE: sorting a column

    quote

    And even though it may not be useful to the original problem, I think the following is an...

  • RE: SQL Query Again - Complex

    SELECT BetID,USERID,BETTYPE,0 as Matches,0 as Mystery

    INTO #MatchingBets

    FROM #Bets

    UPDATE #MatchingBets

    SET Matches =

    (CASE WHEN NUM1 IN (@Win1,@Win2,@Win3,@Win4,@Win5) THEN 1 ELSE 0 END)

    + (CASE WHEN NUM2 IN (@Win1,@Win2,@Win3,@Win4,@Win5) THEN 1 ELSE 0 END)

    +...

Viewing 15 posts - 2,221 through 2,235 (of 3,543 total)