필터 지우기
필터 지우기

using sqlwrite to attempt insertion of matlab table into sql server table. odbc error involving uniqueidentifier columns.

조회 수: 2 (최근 30일)
I have tables in a sql server database with uniqueidentier datatypes for the primary and foreign keys. I am populating matlab tables with data that includes a string representation of the uniqueidentifier values for the primary and foreign keys already populated.
When I call sqlwrite(conn,tablename,data,'ColumnType',coltypes) I get an odbc error on row 1 column 1 which is the string representation of the uniqueidentifier for the primary key.
In my coltypes array, I've tried uniqueidentifier, char, and varchar(37) as data types for this column, but same results every time.
Please advise.
Steve Satterfield
  댓글 수: 1
Dave Chandler
Dave Chandler 2022년 12월 7일
The problem may be in how you are initializing the uniqueidentifier. Please look at this uniqueidentifier documentation (mainly the two bullets under "Remarks") to see if this points to an initialization issue.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Database Toolbox에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by