Solved

XML inserts to a table with a time stamp

Posted on 2002-03-21
3
273 Views
Last Modified: 2012-08-14
OK XML/SQL gurus, answer this...

I created a simple table :
A int
B datetime
C money

and used OPENXML to insert test values using a simple XML string like

<Order A="33" B="21-Dec-2000" C="78.7"/>

No problem. I noticed that any fields not matched against attribute names don't get set. fair enough.
Then I added a timestamp field to the table. I got this error

Server: Msg 273, Level 16, State 1, Line 7
Cannot insert a non-null value into a timestamp column. Use INSERT with a column list or with a default of NULL for the timestamp column.

I am not even trying to insert a value to time stamp. I tried the WITH clause and specific column names , but
that didn't work.

Any experts out there ?

0
Comment
Question by:josereyes
3 Comments
 
LVL 3

Accepted Solution

by:
mgmanoj earned 50 total points
Comment Utility
Go to table editor allow null in timestamp column or put default value in that.

Manoj
0
 

Expert Comment

by:CleanupPing
Comment Utility
josereyes:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now