15,923,168 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Member 14057347 (Top 8 by date)
Member 14057347
20-Nov-18 12:10pm
View
That was a typo on my part. The actual query has no errors in column names.
Member 14057347
20-Nov-18 11:31am
View
The INSERT statement as I am truncating the table and repopulating it every time. Now that I think of it, the Update is redundant here (old code)
Member 14057347
20-Nov-18 11:30am
View
Yes, query is trying to convert PartNote to int when it shouldn't. It is defined as nvarchar(500) in the source table, also being cast as nvarchar(500) when creating a temp table (which runs fine on it's own) and is also defined as nvarchar(500) in destination table. Why is SQL trying to convert it to Int? I know this field has Czech characters such as "Forma č" and also Chinese. Will that have anything to do with this error?
Member 14057347
20-Nov-18 10:50am
View
Also, when I CAST this column while creating my temp table, it does not throw any errors. I also tried creating a proper table instead of temp table to see if that made a difference.
It only throw an error when it tried to INSERT the rows in the destination table. I have also tried to recreate the destination table to make sure there where no data type conflicts.
Member 14057347
20-Nov-18 10:36am
View
Nvarchar(500)
I didn't mean to repost. New to the site and ended up creating 2 questions instead of one. Is there a way to merge them together?
Member 14057347
20-Nov-18 10:28am
View
Santosh - The MERGE statement is now corrected. That was never the issue, it was just a typo.
F-ES Sitecore:
The issue is specifically related to PartNote field. If I comment that out, the query runs flawlessly. PartNote field is defined as NVARCHAR(500) in the ERP system, the staging tables and the target tables. So I really can't understand why it would not recognize it in this perticular query. As this is a note field, there are no data type or language restrictions on this field. It could include anything and everything!
Is there any way I can pin point what might be causing it? I have also tried to eliminate and REPLACE special ASCII characters but that hasn't helped either.
Member 14057347
20-Nov-18 10:23am
View
First time using this site. Thanks for the suggestion.
Member 14057347
20-Nov-18 10:23am
View
My apologies for late reply.
I have been examining the code and every column as you suggested. The issue is specifically with PartNote column. Even if I force CAST or CONVERT that field (the usual remedy for the said error) it doesn't seem work with whatever data that is in this column. If I remove PartNote column from the query, it runs without any issue. As this is a note field, it has no data type restriction for the front end user. Also, the data comes from various countries so it could be mixed with different languages so it is impossible for to see where the issue would be. Is there any way I can cast/convert it or use some other advanced function? When we export it to other applications, we usually convert these to follow UTF-8 data type in SSIS and other integration processes. Can something similar be done in SQL?
Show More