Forum Replies Created

Viewing 15 posts - 91 through 105 (of 111 total)

  • RE: Error Checking & Output Params

    1.For error checking I create a local variables @ErrNum and @ErrDesc and setting like:

    set @ErrNum = @@ERROR

    set @@ErrDesc = "Invalid...

  • RE: Two-Digit Month?

    How about

    select @varMonth =left(convert(varchar(10),@varSysDate,101),2)

    see CONVERT (data_type[(length)], expression [, style])

    where 101 is -"mm/dd/yy"

    Edited by - EPol29 on 04/16/2002 12:30:44 PM

  • RE: Stored Procedure & User Table

    You have to name your temp.table with prefix '# '

    like #aarobtmp:

    CREATE PROCEDURE rob_tmp_1

    AS

    SELECT glt_urn,

    glt_code,

    glt_description

    INTO #aarobtmp

    FROM ncm_general_list_type

    SELECT * FROM #aarobtmp

    GO

  • RE: how to create text variable

    "I am concating multiple strings into a very very long string then insert in into a column of text type. "

    Why can't you just add your multiple strings to the...

  • RE: setting multiple variables in one line

    Select @var1 =Col1, @var2 =Col2, @var3 = Col3

    From mytable

    Where ....

    For the Cursor:

    declare MyCURSOR cursor

    for Select Col1, Col2, Col3

    from mytable

    open MyCursor

    set nocount on

    fetch next from MyCursor into

    @var1,...

  • RE: Using variables slows down query

    Have you tried to use 'sp_executesql' or execute(sql) instead of direct select statement

  • RE: Select rows randomly from a table

    There is an article on another forum that will give you what you are looking for:

    http://www.sqlteam.com/item.asp?ItemID=217

  • RE: Calling SQL Server DateTime from VB

    When inserting data into the table put GetDate() for the field you need, create a triger on the insert/update for this field.

  • RE: IN Parameter

    I posted recently the Script that might help you with your problem:

    Pass several sets of parameters to run stored proc

    http://www.sqlservercentral.com/scripts/scriptdetails.asp?scriptid=232

    Edited by - EPol29 on 04/10/2002 09:07:55 AM

  • RE: Simple...

    Is your column in the Table 2 always will have the structure abs123, or you will have different size of strings?

    Edited by - EPol29 on 04/10/2002 08:08:25 AM

  • RE: group by

    Another possibility:

    DECLARE @ID INT,

    @Name varchar(8000)

    set @ID =0

    set nocount on

    WHILE@ID IS NOT NULL

    BEGIN

    SELECT @ID =min(ID)

    FROMmyTable

    WHEREID > @ID

    IF@ID IS NOT NULL

    BEGIN

    select @Name = @Name + ' & ' + rtrim(name)

    FROMmyTable...

  • RE: UPDATE sp doesn't update???

    If LogID is an Integer then you don't have to convert the original value of @LogID_1 to varchar, just use 'WHERE LogID = @LogID_1'

    And update directly!

    [/quote]

    LogID is an Integer.

    [/quote]

  • RE: UPDATE sp doesn't update???

    Why you are using 'EXEC (@SQLs)', why can't you update directly with your Update statement?

    Your statement will look like:

    UPDATE PELDMS.dbo.tProjectLog

    SET Note = @Note_10

    WHERE LogID = CAST(@LogID_1 AS...

  • RE: Add to text

    just this part:

    update tablename

    set model = rtrim(model) + '-R'

  • RE: Using the Default Object or any other way

    How about creating a trigger?

Viewing 15 posts - 91 through 105 (of 111 total)