Forum Replies Created

Viewing 15 posts - 76 through 90 (of 152 total)

  • RE: Drop Identity column from temp table

    When I run this code:

    declare

    @New_Value varchar(50),

    @Col varchar(50),

    @TableName varchar(50)

    select @TableName = [TABLE_NAME]

    from [Hosea_tblDef_Cloning_Table]

    select @Col = [COLUMN_NAME]

    from [Hosea_tblDef_Cloning_Table]

    select @New_Value = [NEW_VALUE]

    from [Hosea_tblDef_Cloning_Table]

    SELECT '[' + t.table_schema + '].[' + t.table_name + ']'...

  • RE: Drop Identity column from temp table

    INSERT INTO [Hosea_tblDef_Cloning_Table] ([CLONE_ID]

    ,[TABLE_NAME]

    ,[COLUMN_NAME]

    ,[OLD_VALUE]

    ,[NEW_VALUE])

    VALUES (1, 'Hosea_tblDef_RETURNS',...

  • RE: Drop Identity column from temp table

    There has been few changes to this code..

    Before I used to pass parameters

    declare @Fund_Id varchar(50),

    @Product_Id varchar(50),

    @NewFund_Id varchar(50),

    @NewProduct_Id varchar(50),

    ...

  • RE: Insert INTO Select

    There has been few changes to this code..

    Before I used to pass parameters

    declare @Fund_Id varchar(50),

    @Product_Id varchar(50),

    @NewFund_Id varchar(50),

    @NewProduct_Id varchar(50),

    ...

  • RE: Drop Identity column from temp table

    @ChrisM@Work

    Can you please explain to me your code, and why the concept of CROSS APPLY, why did you choose to go with it, you also used both of...

  • RE: Drop Identity column from temp table

    Thank you for the code, I'm testing it and it's working, as for other malicious events I'll look into them

  • RE: Drop Identity column from temp table

    Now that's an easy one cause I created a table for you, so you are working with the data you know. say now the user input tblDef_RETURNS as table, and...

  • RE: Drop Identity column from temp table

    I'm planning to run everything inside the PROC:

    CREATE PROC (@Product_Id, @Fund_Id, @NewProduct_Id, @NewFund_Id, @TableName)

    AS

    BEGIN

    END

    that's just the shell. I'm still trying to get the inside code correctly.

  • RE: Drop Identity column from temp table

    If you're updating two very specific columns, they should exist in one very specific table, surely?

    Yes, I'm updating two specific columns, which is [PRODUCT_ID] and [FUND_ID], then insert the new...

  • RE: Drop Identity column from temp table

    Here's the case;

    CREATE permTable

    (

    [RETURNS_ID] [int] IDENTITY(1,1) NOT NULL,

    [REPORT_ID] [varchar](50) NOT NULL,

    [COMPANY] [varchar](150) NULL,

    [PRODUCT_TYPE] [varchar](150) NULL,

    [PRODUCT_ID] [varchar](150) NULL,

    [PRODUCT_DESC] [varchar](150) NULL,

    [FUND_ID] [varchar](150) NULL

    )

    INSERT INTO permTable ([REPORT_ID]

    ...

  • RE: Drop Identity column from temp table

    For now I'm using SELECT ... INTO

    SET @InsertSQL = 'SELECT * INTO Hosea_tempTable FROM ' + @TableName +' WHERE (Product_Id = '+ QUOTENAME(@Product_Id, '''''') +' or Product_Id = '''' )...

  • RE: Drop Identity column from temp table

    The scenario is this..

    I have a product AGP with Fund E01, and other attributes

    then later I want to creat another product with the same attributes as AGP product,...

  • RE: Insert INTO Select

    I changed my code now and I'm using SELECT ... INTO to create the table rather than generating a CREATE TABLE statement. I want to cancel the identity column to...

  • RE: Insert INTO Select

    I do have that line of code, I just didn't put it here.

    SET @SQLStatement = REPLACE(@SQLStatement,'(,','('); -- remove first comma

    I don't think I will be able to list columns...

  • RE: Arithmetic overflow error

    I tried 123.456789 and it worked fine,

    Then I tried 1234.56789 I got the same error:

    Msg 8115, Level 16, State 8, Line 32

    Arithmetic overflow error converting numeric to data type...

Viewing 15 posts - 76 through 90 (of 152 total)