powerdesigner : Edit column length - powerdesigner

I imported all entities and attributes from excel and generated Logical Diagram in PowerDesigner.
From Logical , I created Physical Diagram. But to generate sql scripts I need to update the column length for each tables.
I tried to update the column length from Properties Grid.
But I am unable to edit/add column length. Tool is allowing me to enter the value, but it is not saving the value.
Please suggest me the solution.
Thanks,
Vasu

Related

AzureSynapse pipeline how to add guid to raw data

I am new to AzureSynapse and am technically a Data Scientist whos doing a Data Engineering task. Please help!
I have some xlsx files containing raw data that I need to import into an SQL database table. The issue is that the raw data does not have a uniqueidentifer column and I need to add one before inserting the data into my SQL database.
I have been able to successfully add all the rows to the table by adding a new column on the Copy Data command and setting it to be #guid(). However, this sets the guid of every row to the same value (not unique for each row).
GUID mapping:
DB Result:
If I do not add this mapping, the pipeline throws an error stating that it cannot import a NULL Id into the column Id. Which makes sense as this column does not accept NULL values.
Is there a way to have AzureSynapse analystics read in a raw xlsx file and then import it into my DB with a unique identifier for each row? If so, how can I accomplish this?
Many many thanks for any support.
Giving dynamic content to a column in this way would generate the same value for entire column.
Instead, you can generate a new guid for each row using a for each activity.
You can retrieve the data from your source excel file using a lookup activity (my source only has name column). Give the output array of lookup activity to for each activity.
#activity('Lookup1').output.value
Inside for each, since you already have a linked service, create a script activity. In this script activity, you can create a query with dynamic content to insert values into the destination table. The following is the query I built using dynamic content.
insert into demo values ('#{guid()}','#{item().name}')
This allows you to iterate through source rows, insert each row individually while generating new guid every time
You can follow the above procedure to build a query to insert each row with unique identifier value. The following is an image where I used copy data to insert first 2 rows (same as yours) and inserted the next 2 rows using the above procedure.
NOTE: I have taken Azure SQL database for demo, but that does not affect the procedure.

Use binary data column to create relationship in Power BI desktop

I have imported 2 tables from SQL Server to Power BI desktop in which each table contain one column having binary data. And these columns are used to create the relationship between that two tables.
When I proceed to create the relationship in Power BI these columns are not visible. I also tried the conversion of that binary column to text and try to create the relationship but it shows an error: Can´t create a relationship between two columns because one of the columns must have the unique value.
How can I create the relationship in Power BI desktop using Binary data columns?
As TDP stated, there has to be duplicate values, whether or not it is through an error in your data source. Please review the query editor and enable viewing column distribution and check to see if there are duplicate values in either of the columns you wish to use.
You will either need to modify your data source or make the changes within query editor directly to remove these duplicates.
It should not matter what data type you are using (binary/text) if there are duplicates. You will not be able to stop duplicates occurring just by changing the datatype.
EDIT: Oops, old thread. The answer still applies, please remove if unnecessary.
Can´t create a relationship between two columns
because one of the columns must have the unique value
This is your issue. One end of the relationship must have a distinct set of values.
Once you converted binary to text you would have been able to create the relationship if you had a distinct set on one side.
This isn't to do with binary being converted to text.

Changing datatype of field in OLAP Cube

I'm working on OLAP Cube on SQL-Server 2008 and I have to add one field to existing OLAP Cube.
I got a problem, because field in source database is of type Integer, and in the cube it have to be Date. It has format MMYYYY.
DataType in properties of this field is grayed out so I cannot edit it. Is there any way to change it's type to Date?
I have never worked with OLAP.
In the Data Source View in your SSAS project, add a computed column that uses SQL to derive a Date column from the value of the int column.
Then in your cube, reference the computed column in your Data Source View instead of the original column.

Change data size of all columns with same column name in sql developer data modeler

I have a column USER_ID in almost 100 Tables. I have both relational and logical models in Sql developer data modeler(4.2)
I need to change data size from varchar2(5) to varchar2(10)
How can i do this in 1 shot instead of manually changing the size 200 times.
There are several ways. The first method would have been proactive, defining a domain for that. The second way is to create a custom transformation that will go through all the tables in your model, look for any occurrence of a USER_ID column, then adjust its datatype accordingly. Kris Rice's blog was a great source of information when I had to create my own custom scripts: http://krisrice.blogspot.com/search?updated-max=2011-02-02T16%3A49%3A00-08%3A00&max-results=3

SQL Server + triggers: How to get information about the inserted/deleted tables

Is there any way to get information about the updated/deleted tables in a trigger, meaning
which columns are in the inserted/deleted tables?
which data types do they have?
The background for this question is: I would like to create a 'generic' trigger which can be used without having need to be adapted for the table in question.
Dummy code:
foreach column in inserted table
get column name and data type and column (e.g. to exclude text columns or columns with a special name)
if the value has changed do some logging into another table
Unfortunately I could not find the needed information so far; I have to admit that I don't know the proper key words which have to be used.
It would even be helpful to get a list of functions (e.g. UPDATE()) which can be used in triggers to query information about the inserted/deleted tables.
The TSQL code should work on MS SQL Server >= 2008.
TIA

Resources