BIML - schema change from source to target

  • Hi all,

    We are trying to stage a certain number of tables from source to staging DB but we want to add another schema to the staging DB.

    First of all, the tables of course need to be created and we use this line:

    <DirectInput><#=table.GetDropAndCreateDdl()#></DirectInput>

    But of course this results in creating dbo.tablename, where we want stg.tablename.

    When using this

    <# var schema = "stg"; #>

    <DirectInput><#=schema#><#=table.GetDropAndCreateDdl()#></DirectInput>

    The schema is just pasted in front of the ddl syntax which ofcourse results in an error.

    beheerSET ANSI_NULLS ON

    SET QUOTED_IDENTIFIER ON

    GO

    -------------------------------------------------------------------

    IF EXISTS (SELECT * from sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[ADRES]') AND type IN (N'U'))

    DROP TABLE [dbo].[ADRES]

    GO

    Anyone knows how to handle this?

    Thanks in advance

  • Problem solved http://bimlscript.com/Walkthrough/Details/73

    by using the 1-2-CreateTableMetadata.biml part

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply