Forum Replies Created

Viewing 15 posts - 31 through 45 (of 90 total)

  • RE: Header to Many rows

    I have made a header table called [VehicleAnalysis_Header] which holds the VCR\CCR records with unique primary key.

    SET ANSI_NULLS ON

    GO

    SET QUOTED_IDENTIFIER ON

    GO

    CREATE TABLE [dbo].[VehicleAnalysis_Header](

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

    [VCRRecType] [varchar](3) NULL,

    [VCRCustNo]...

  • RE: Header to Many rows

    DDL is below and some sample data is attached, the required format is pipe delimited | | | | etc...

    CREATE TABLE [dbo].[VehicleAnalysisVCR](

    [VCRRecType] [varchar](3) NULL,

    [VCRCustNo] [int] NULL,

    [VCRCostCentre] [varchar](max) NULL,

    [VCRCollationFlag] [varchar](2) NULL,

    [VCRPrintFlag]...

  • RE: Nested loop no join predicate

    I found and fixed the problem in the CTE's I added more joins and this removed the No Join Predicate, thanks for the replies.

  • RE: Minus Column for current month from previous month

    something like this;

    Select

    SUM (CASE WHEN DATEPART(m, [FuelTranDate]) = DATEPART(m,GETDATE()) THEN LastOdo ELSE '' END)

    - SUM(CASE WHEN DATEPART(m, [FuelTranDate]) = DATEPART(m, DATEADD(m, -1, GETDATE())) THEN Lastodo ELSE ''...

  • RE: Stored Proc, Output new id if null

    Thanks a lot for the replies. Not sure why it didn't work the first time when I had @SaleID as the output.

  • RE: Aggregating Correlated Sub-Queries

    Thanks for the replies.

    None of these work and the @@rowcount is also only returning '1'

    ,SUM([>7 Days]) OVER(PARTITION BY f.Country ,f.CompanyName ,f.InvoiceID ,f.SupplierCode ,f.InvoiceNumber

    ,f.[Scan Date] ,f.[Approval Date]...

  • RE: Convert and Combine Currencies

    I added a primary key to the AUD currency table and tried this. it returns the same as the cursor, multiple emtpy sets, can anyone detail what is wrong.

    DECLARE...

  • RE: Convert and Combine Currencies

    Yeah I just created a rate table, dbo.aus for the first set. trying to make it more dynamic so the rates can be updated and automatically and if there's match...

  • RE: FOR XML Path

    Thanks Orlando and Alan for the replies.

    Is dbo.splitcsv a reserved table or function somewhere as i am unable to find it within the DB?

  • RE: Expression Convert Date mm to Mon

    I resolved it using the code below, you cant use the derived column replace function and datepart, so i had to make it as a new column and in a...

  • RE: SSIS Import Column Set XML

    Orlando Colamatteo (1/27/2016)


    It is still not clear to me what you are trying to do.

    Or are you looking to copy data from an XML column in one server...

  • RE: SSIS Import Column Set XML

    The end result i am trying to achieve is to export the XML into another table or tables depending on the data structure, then write some reports via SSRS.

    select Col1...

  • RE: Error Handling - Pass Error as variable

    Thanks it worked, the group by replace is a good one didn't think of that I ended up with this.

    IF OBJECT_ID(N'tempdb..#tmp_Supplier') IS NOT NULL

    DROP TABLE #tmp_Supplier;

    ...

  • RE: Error Handling - Pass Error as variable

    Thanks Orlando, I will try your's now my idea was something like this but it not finished yet.

    DECLARE @II INT, @iiMax INT, @Code VARCHAR(100),@corporate_id VARCHAR(100)

    DECLARE @TemporaryStagingTable TABLE(id INT IDENTITY(1,1) PRIMARY...

  • RE: Error Handling - Pass Error as variable

    There not duplicate until I run the update and remove the double quotes in the column.

Viewing 15 posts - 31 through 45 (of 90 total)