Forum Replies Created

Viewing 15 posts - 3,001 through 3,015 (of 6,036 total)

  • RE: Improve my where loop!

    Peso (6/11/2008)


    I believe you are wrong Sergiy, again.

    Happy to brighten you day!

    What else could bring some joy into your life?

    😀

    Yes, aggregation does "SET" in your query and I missed it....

  • RE: Improve my where loop!

    Peso (6/11/2008)


    DECLARE @PNo NUMERIC(10,0)

    SELECT@PNo = MIN(PNo)

    FROMPT

    WHEREPDone = 0

    WHILE @PNo IS NOT NULL

    BEGIN

    ...

    UPDATEPT

    SETPDone = 1

    WHEREPNo = @PNo

    SELECT@PNo = MIN(PT)

    FROMPT

    WHEREPDone = 0

    END

    You forgot

    SET @PNo = NULL

    before assigning new MIN(PT) inside of...

  • RE: Text Data Type & Stored procedure

    Once again, last version of the script you posted works fine without errors.

    This is my test script:

    CREATE TABLE LOG_TABLE

    (

    START_TIME datetime,

    END_TIME varchar(100),

    ERROR_MSG text

    )

    GO

    create procedure Message_Insert

    (

    @START_TIME datetime,

    @END_TIME varchar(100),

    @ERROR_MSG text

    )

    as

    Begin

    Insert into LOG_TABLE (START_TIME,END_TIME,ERROR_MSG)

    Values(@START_TIME,@END_TIME,@ERROR_MSG)

    End

    GO

    EXEC...

  • RE: Which is better

    Ahmad Osama (6/11/2008)


    may i have the reason......bcoz i wud hv to us a cursor...if i do it at sql

    Why would you need a cursor?

  • RE: SQL Help, find avg of top 3 most recent months fast slow days

    I believe the biggest problem here is the wrong logic.

    As per the requirement, "avg number of the top 3 most recent months of avg slow fast days" for the customer...

  • RE: Text Data Type & Stored procedure

    karthikeyan (6/10/2008)


    Ok.

    Can you tell me what could be the reason for the error message ?

    Which error message?

    I don't get any one.

  • RE: how to display datedate format like dd-MMM-YYYY

    rclgoriparthi (6/10/2008)

    it gives out put like this :- 27 Apr 08

    but i want out format like this 27-Apr - 2008

    Use function REPLACE on the result you've got.

  • RE: Text Data Type & Stored procedure

    I hope your SQL Server can now understand your code as well.

    At least mine can.

  • RE: Text Data Type & Stored procedure

    Are you sure it's T-SQL script?

    You need to learn the syntax of CREATE PROCEDURE and INSERT INTO statements.

    I would suggest using BOL or any other book about essential T-SQL.

  • RE: How can we see long running queries with Tsql

    What's wrong with Profiler?

  • RE: Looping Through Table and Adding new records

    And another question:

    where ID2 5 and 6 come from?

  • RE: Monthly Yearly quarterly report

    Read topic "Cross-Tab Reports" in Books Online.

    Tell us if it helped.

  • RE: T-SQL and Null parameters

    WHERE

    FirstPartOfKey = ISNULL(@PartialKey,FirstPartOfKey)

    From my experience this approach could cause performance disaster.

    In most cases this one is more effective:

    ...

  • RE: Index on a Temp table conundrum

    You may define constraints without naming it.

    Create Table #t1 (

    id int NOT NULL ,

    column1 char(10) NULL,

    UNIQUE clustered (column1)

    )

  • RE: sp_cursoropen

    So something to communicate to my devs would be that they should execute their inserts/updates/deletes by throwing a sql command execute type of adodc call instead of opening a recordset...

Viewing 15 posts - 3,001 through 3,015 (of 6,036 total)