Forum Replies Created

Viewing 15 posts - 3,361 through 3,375 (of 10,144 total)

  • RE: Drop Identity column from temp table

    hoseam (5/12/2014)


    Product_ID and FundID are from Hosea_tblDef_Cloning_Table, from the column COLUMN_NAME, so any value in that column will always be there in the WHERE CLAUSE. on this case is (Product_ID...

  • RE: Drop Identity column from temp table

    And you will only ever change FundID, ProductID or both?

  • RE: Drop Identity column from temp table

    hoseam (5/12/2014)


    Can I also mention my Code has changed to this:

    declare

    @New_Value varchar(50),

    @Col varchar(50),

    @TableName varchar(50)

    select @TableName = [TABLE_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

    CREATE TABLE [dbo].[Hosea_tblDef_RETURNS](

    [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,

    [FUND_INCEPTION_DATE] [varchar](6) NULL,

    [RETURNS_TYPE_KEY] [varchar](150) NULL,

    [RETURNS_TYPE_FILTER] [varchar](150) NULL,

    [RETURNS_MONTH_FILTER] [varchar](150) NULL,

    CONSTRAINT [PK_tblDef_RETURNS] PRIMARY...

  • RE: Drop Identity column from temp table

    hoseam (5/12/2014)


    Any luck Chris??

    No. Running your script generates the following error.

    Msg 110, Level 15, State 1, Line 22

    There are fewer columns in the INSERT statement than values specified in the...

  • RE: Drop Identity column from temp table

    Same for table Hosea_tblDef_RETURNS please - ddl and dml. Cheers.

  • RE: Drop Identity column from temp table

    Can you provide a few sample rows for table [dbo].[Hosea_tblDef_Cloning_Table] please?

    As INSERT's to the table ddl you've already posted. Cheers

  • RE: Cumulative sum of previous rows

    simonc 39536 (5/9/2014)


    ...

    In this instance you should use ROWS because it is the more correct solution for what you are doing,

    it just so happens that the ORDER BY...

  • RE: How to make sure that all the rows are inserted into datamodel and then truncate staging table

    What are you using to perform this ETL job? Is it just TSQL or are you using SSIS or some other tool?

    "In my ETL job I would like to truncate...

  • RE: T-SQL Calculation

    J Livingston SQL (5/8/2014)


    ChrisM@Work (5/8/2014)


    Otherwise you will get answers like this:

    SELECT *, Trend = ([Week]/5.0) * MAX(Forecast) OVER(PARTITION BY [TYPE])

    FROM #REport

    Which exactly meets your requirements (apart from the trivial matter...

  • RE: T-SQL Calculation

    Otherwise you will get answers like this:

    SELECT *, Trend = ([Week]/5.0) * MAX(Forecast) OVER(PARTITION BY [TYPE])

    FROM #REport

    Which exactly meets your requirements (apart from the trivial matter of rounding) but is...

  • RE: Cumulative sum of previous rows

    Nice article, Ben - does exactly what it says on the tin, although many folks lurking around here would be more familiar with the name Running Total.

    The old version of...

  • RE: Are the posted questions getting worse?

    Ed Wagner (5/7/2014)


    ChrisM@Work (5/7/2014)


    The OP's posting history suggests a haphazard way of working which can be difficult for responders to correctly interpret.

    I think this is a very nice way to...

  • RE: DEMO_CODE = 'DE1'

    SELECT [stuff]

    FROM [thing]

    WHERE

    (demo_code = 'DE1' AND demo_vchar_data = 'U')

    OR

    (demo_code = 'RAP' AND demo_vchar_data = 'YES')

  • RE: Transactions problem

    Remove the batch separator.

Viewing 15 posts - 3,361 through 3,375 (of 10,144 total)