This is a migrated thread and some comments may be shown as answers.

handling user defined types (UDT)?

3 Answers 66 Views
Databases and Data Types
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
john
Top achievements
Rank 1
john asked on 21 May 2014, 06:02 AM
i get this log when updating my database from data model

-- Column was read from database as: [ACCT_CODE] 'ud_ACCT_CODE'(12) not null
-- modify column for field _ACCT_CODE
ALTER TABLE [ACCOUNT_BUDGET] ALTER COLUMN [ACCT_CODE] varchar(12) NOT NULL

go

how can i prevent it from replacing my user defined type?

3 Answers, 1 is accepted

Sort by
0
Doroteya
Telerik team
answered on 23 May 2014, 03:14 PM
Hi John,

In order to avoid unnecessary changes of the database, I would suggest to you to review the Select Changes page of the wizard and to uncheck those that you do not intend to persist. If this is not applicable in your scenario, another possibility is to select the Create Script File option on Summary Page and to edit the generated script before executing it.

I hope this helps. In case you have additional questions, do not hesitate to get back to us.


Regards,
Doroteya
Telerik
 
OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
 
0
Carlos
Top achievements
Rank 1
answered on 22 Jun 2015, 05:09 PM

Hi I got a problem check this :

  private int _usrIdIdt;
[Column("usr_id_idt", OpenAccessType = OpenAccessType.Int32, IsBackendCalculated = true, IsPrimaryKey = true, Length = 0, Scale = 0, SqlType = "identificador")]
[Storage("_usrIdIdt")]
[System.ComponentModel.DataAnnotations.Required()]
[System.ComponentModel.DataAnnotations.Key()]
public virtual int UsrIdIdt
{
get
{
return this._usrIdIdt;
}
set
{
this._usrIdIdt = value;
}
}

 

This is the PK of my table , but this SqlType = " ' identificador ' " property of the Column attribute , im getting problems when I tried to insert a new record , the problem is that DataAccess is incluiding single quotes when build de sql query and mssql rise and exception like this : Incorrect syntax near 'identificador' , identificador is a User Defined Datatype , my question is if there is a way to avoid que double single quotation in the property attribute ?

0
Doroteya
Telerik team
answered on 24 Jun 2015, 07:51 PM
Hi Carlos,

I am sorry that you are experiencing issues.

The support of Data Access for user-defined types is very limited, and it seems that the type of your primary key is out of its scope. To either confirm this or resolve the problem, I will ask you for your cooperation. Can you send me the script of the user-defined type to which the primary key is mapped?

I am looking forward to your feedback.


Regards,
Doroteya
Telerik
 
Check out the latest announcement about Telerik Data Access vNext as a powerful framework able to solve core development problems.
Tags
Databases and Data Types
Asked by
john
Top achievements
Rank 1
Answers by
Doroteya
Telerik team
Carlos
Top achievements
Rank 1
Share this question
or