<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Dynamic schema : no primary key ? in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Dynamic-schema-no-primary-key/m-p/2291340#M64529</link>
    <description>&lt;P&gt;Hello !&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to transfer the content of a table into another database, while keeping the exact same structure.&lt;/P&gt;
&lt;P&gt;I used the MSSQL Input &amp;amp; output components, with a dynamic schema, to allow easy modifications of the source table.&lt;/P&gt;
&lt;P&gt;However, if I do that, I can't have a primary key, the new table is created without one, which seems quite weird. Is there any way to change that ? Or should I use a more rigid schema with a primary key ? Thanks if you have any comment !&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 26 Feb 2018 14:22:11 GMT</pubDate>
    <dc:creator>François_T</dc:creator>
    <dc:date>2018-02-26T14:22:11Z</dc:date>
    <item>
      <title>Dynamic schema : no primary key ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Dynamic-schema-no-primary-key/m-p/2291340#M64529</link>
      <description>&lt;P&gt;Hello !&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to transfer the content of a table into another database, while keeping the exact same structure.&lt;/P&gt;
&lt;P&gt;I used the MSSQL Input &amp;amp; output components, with a dynamic schema, to allow easy modifications of the source table.&lt;/P&gt;
&lt;P&gt;However, if I do that, I can't have a primary key, the new table is created without one, which seems quite weird. Is there any way to change that ? Or should I use a more rigid schema with a primary key ? Thanks if you have any comment !&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Feb 2018 14:22:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Dynamic-schema-no-primary-key/m-p/2291340#M64529</guid>
      <dc:creator>François_T</dc:creator>
      <dc:date>2018-02-26T14:22:11Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic schema : no primary key ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Dynamic-schema-no-primary-key/m-p/2291341#M64530</link>
      <description>&lt;P&gt;Instead of outputting your data to a single Dynamic column, output your primary key column AND a Dynamic schema column. I am assuming that your PK will be called something consistently across your tables ("id" for example), but this might help. The Dynamic schema is able to work like this.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Feb 2018 14:44:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Dynamic-schema-no-primary-key/m-p/2291341#M64530</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-26T14:44:34Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic schema : no primary key ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Dynamic-schema-no-primary-key/m-p/2291342#M64531</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Oh ok, I didn't know that. So I can mix some fixed columns (the one(s) used for the primary key), and the dynamic column type for everything else, if I understand this right. Very interesting, thanks for this feedback ! I will try this solution.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Feb 2018 16:25:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Dynamic-schema-no-primary-key/m-p/2291342#M64531</guid>
      <dc:creator>François_T</dc:creator>
      <dc:date>2018-02-26T16:25:13Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic schema : no primary key ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Dynamic-schema-no-primary-key/m-p/2291343#M64532</link>
      <description>&lt;P&gt;I've not tested this exhaustively, but I do know you can separate known columns out.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Feb 2018 16:37:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Dynamic-schema-no-primary-key/m-p/2291343#M64532</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-26T16:37:51Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic schema : no primary key ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Dynamic-schema-no-primary-key/m-p/2291344#M64533</link>
      <description>&lt;P&gt;I tried, but I'm getting errors :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have change my schema to&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Field1&lt;/P&gt;
&lt;P&gt;Field 2&lt;/P&gt;
&lt;P&gt;Dynamic field&lt;/P&gt;
&lt;P&gt;(Field 1 &amp;amp; 2 being the primary key)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then my SQL query is "SELECT Field1, Field2, * FROM table"&lt;/P&gt;
&lt;P&gt;But then it gives me field format errors, saying that it can convert a value to an integer.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I guess I should spent a bit more time to list the useful columns and add the new ones later manually. Too bad I can't easily import the full table with the primary key using Talend !&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2018 08:31:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Dynamic-schema-no-primary-key/m-p/2291344#M64533</guid>
      <dc:creator>François_T</dc:creator>
      <dc:date>2018-02-27T08:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic schema : no primary key ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Dynamic-schema-no-primary-key/m-p/2291345#M64534</link>
      <description>&lt;P&gt;Lets say your table looks like this.....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;CREATE TABLE [dbo].[Batch](
	[id] [bigint] IDENTITY(1,1) NOT NULL,
	[catalogue_id] [bigint] NULL,
	[datasource] [varchar](max) NULL,
	[start_time] [datetime] NOT NULL,
	[end_time] [datetime] NULL,
	[status_id] [bigint] NULL,

 CONSTRAINT [PK_Batch] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)
)&lt;/PRE&gt;&lt;P&gt;In this case your schema would need to be ...&lt;/P&gt;&lt;P&gt;id = Long&lt;/P&gt;&lt;P&gt;row = Dynamic&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your query could be...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Select *
From Batch&lt;/PRE&gt;&lt;P&gt;This has worked for me.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2018 09:20:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Dynamic-schema-no-primary-key/m-p/2291345#M64534</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-27T09:20:16Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic schema : no primary key ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Dynamic-schema-no-primary-key/m-p/2291346#M64535</link>
      <description>&lt;P&gt;I think it works because your primary key is the first one in the table.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried what you proposed, to simply use a select *, with the schema you gave. But it's not working, as it's expecting the primary key fields to be the first in the query. Unfortunately, in&amp;nbsp; my case, they are not, and it's often like that. So I think it's unfortunately more complicated for me. Unless I'm missing an option ?&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2018 09:39:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Dynamic-schema-no-primary-key/m-p/2291346#M64535</guid>
      <dc:creator>François_T</dc:creator>
      <dc:date>2018-02-27T09:39:49Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic schema : no primary key ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Dynamic-schema-no-primary-key/m-p/2291347#M64536</link>
      <description>Have you used your primary field names or just used random names? But you are correct, my pks are always at the start of the table.</description>
      <pubDate>Tue, 27 Feb 2018 09:41:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Dynamic-schema-no-primary-key/m-p/2291347#M64536</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-27T09:41:37Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic schema : no primary key ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Dynamic-schema-no-primary-key/m-p/2291348#M64537</link>
      <description>&lt;P&gt;In my tests, I used the primary key field names yes, and I immediately got error. I thought that maybe Talend would not mind receiving all the columns in a different order. But apparently it does, so unless I have my primary key field(s) at the beginning of my tables, the dynamic solution seems to be impossible unfortunately. Not a huge deal, and at least I know better how it works now ! Thanks for the time spent thinking about it.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2018 09:50:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Dynamic-schema-no-primary-key/m-p/2291348#M64537</guid>
      <dc:creator>François_T</dc:creator>
      <dc:date>2018-02-27T09:50:57Z</dc:date>
    </item>
  </channel>
</rss>

