nested table insert error

Discussion in 'microsoft.public.sqlserver.datamining' started by ehsan, Apr 1, 2012.

  1. ehsan

    ehsan Guest

    I have a data base (testmining) with 2 tables in my engine service
    customer and purchase with this structure


    CREATE TABLE [dbo].[Customer]
    [Customer_id] [int] NOT NULL
    [Last_name] [nvarchar](50) NULL
    [First_name] [nvarchar](50) NULL
    [Gender] [text] NULL
    [Age] [int] NULL
    [Income] [int] NULL
    [Profession] [nvarchar](50) NULL
    [HasChildren] [bit] NULL
    [houseOwner] [nvarchar](50) NULL
    [address] [nvarchar](50) NULL
    [member_cart] [text] NULL
    CONSTRAINT [PK_Customer] PRIMARY KEY CLUSTERE

    [Customer_id] AS
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF
    ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY
    ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY




    purchase:CREATE TABLE [dbo].[Purchase]
    [Customer_id] [int] NULL
    [Product_Name] [text] NULL
    [Quantity] [int] NULL
    [Unit_Price] [int] NULL
    [Time] [nvarchar](50) NUL
    ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY

    G

    ALTER TABLE [dbo].[Purchase] WITH CHECK ADD CONSTRAINT [FK_Purchase_Customer
    FOREIGN KEY([Customer_id]
    REFERENCES [dbo].[Customer] ([Customer_id]
    G

    ALTER TABLE [dbo].[Purchase] CHECK CONSTRAINT [FK_Purchase_Customer
    G


    these 2 table are connected with customer_id column as a primary key i
    custome
    and foreign key in purchas
    and i have a database (mining) in my analyses service on my sql server 2008
    so i create a mining model in my mining database on analyses services


    Create mining model MarketBasketMode

    CustomerId long key
    Gender text discrete
    Income long continuous
    MemberCard text discrete
    Purchases table Predict_Only
    ProductName text key
    Quantity long continuou


    Using Microsoft_Decision_Tree


    so when i want to execute this command


    Insert into MarketBasketModel_Structure( CustomerId, Gender, Income
    MemberCard
    Purchases( ProductName, Quantity)
    OpenRowset('SQLOLEDB', 'Server=EHSAN-PC;Integrated Security=SSPI'
    'Shap
    { Select Customer_id, Gender, Income, member_cart From testmining.dbo.Custome

    Append
    { Select Product_Name, Quantity From testmining.dbo.Purchase
    Relate testmining.dbo.Customer.Customer_Id t
    testmining.dbo.Purchase.Customer_id ) as Purchase'


    i got this error

    OLE DB error: OLE DB or ODBC error: Syntax error or access violation; 42000

    thanks a lot
     
    ehsan, Apr 1, 2012
    #1
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.