Synapse Dedicated SQL table Insert value issue

Srinivasan M 20 Reputation points
2023-11-02T17:00:14.8366667+00:00

i want insert value to synapse table(dedicated sql pool) but getting issue with date / or time string conversion error

table column

co1(int),col2(varchar(50)),col3(datetime)

insert into t1

(col,col2)

select 1,'2'

there are 3 columns of the table, but i am going to supply 2 columns values but getting issue

the above statement is not executed. pls help on this

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
5,373 questions
0 comments No comments
{count} votes

Accepted answer
  1. AnnuKumari-MSFT 34,556 Reputation points Microsoft Employee Moderator
    2023-11-03T05:41:18.4833333+00:00

    Hi Srinivasan M ,

    Welcome to Microsoft Q&A platform and thanks for posting your question here.

    It seems like you want to insert values into a table named t1 in a dedicated SQL pool in Azure Synapse Analytics. You are encountering issues with the column mismatch and date/time string conversion error.

    Kindly check the table schema to verify col3 is set as nullable or not .

    When inserting values into a table, you should provide values for all columns that are not defined as nullable in the table. In your case, you have three columns in the table, but you're supplying values for only two columns. Kindly try to explicitly provide the value for 3rd column as NULL or any date value .

    There was a unresolved product bug in dedicated sql pool where it was not accepting null values , for which the team has shared 3 possible workarounds. Kindly check if the below approach helps you in resolving the issue:

    246434-1.png

    246410-2.png

    Hope it helps. Kindly accept the answer by clicking on Accept answer button. Thankyou.


1 additional answer

Sort by: Most helpful
  1. Vahid Ghafarpour 23,385 Reputation points Volunteer Moderator
    2023-11-02T18:14:41.2866667+00:00

    Did you set col3 nullable or assign a default value?


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.