Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Nguyen Dung Tri 106 posts 606 karma points
    Jul 28, 2016 @ 02:12
    Nguyen Dung Tri
    0

    ExecuteSql doesn't work during installation of a new package

    Hello,

    I have created a package for Umbraco CMS. In package.xml file, I have included an xml tag to execute sql script during installation:

    <Action runat="install" undo="false" alias="ExecuteSql"> <![CDATA[
        CREATE TABLE [dbo].[Products](
        [Id] [int] IDENTITY(1,1) NOT NULL,
        [Name] [nvarchar](250) NULL,
        [Category] [nvarchar](150) NULL,
        [Price] [float] NULL);
    
        INSERT INTO [dbo].[Products]
        VALUES ('Tomato Soup','Groceries',1);
    
        INSERT INTO [dbo].[Products]
        VALUES ('Yo-yo','Toys',3.75);
    
        INSERT INTO [dbo].[Products]
        VALUES ('Hammer','Hardware',16.99);
        ]]> </Action>
    

    But the sql script doesn't run and no data table has been created.

    Here is my package.xml. Please help me to run the sql script during the installation of package.

Please Sign in or register to post replies

Write your reply to:

Draft