Click here to Skip to main content
15,606,434 members
Home / Discussions / Database
   

Database

 
Questiondeploy PostgreSQL database Pin
Jassim Rahma26-Oct-10 3:56
Jassim Rahma26-Oct-10 3:56 
Questioncreate script for entire database in PostgreSQL Pin
Jassim Rahma26-Oct-10 3:55
Jassim Rahma26-Oct-10 3:55 
AnswerRe: create script for entire database in PostgreSQL Pin
Jules VDV26-Oct-10 4:31
Jules VDV26-Oct-10 4:31 
QuestionSQL Server CE : How to create a database from C++ with ADO Pin
Leif Goodwin26-Oct-10 2:11
Leif Goodwin26-Oct-10 2:11 
AnswerRe: SQL Server CE : How to create a database from C++ with ADO => SOLVED Pin
Leif Goodwin26-Oct-10 3:33
Leif Goodwin26-Oct-10 3:33 
QuestionField ordering in a table Pin
john john mackey25-Oct-10 7:10
john john mackey25-Oct-10 7:10 
AnswerRe: Field ordering in a table Pin
J4amieC25-Oct-10 21:21
J4amieC25-Oct-10 21:21 
AnswerRe: Field ordering in a table Pin
i.j.russell25-Oct-10 23:32
i.j.russell25-Oct-10 23:32 
AnswerRe: Field ordering in a table Pin
Mycroft Holmes26-Oct-10 3:04
professionalMycroft Holmes26-Oct-10 3:04 
GeneralRe: Field ordering in a table Pin
Gerben Jongerius26-Oct-10 3:41
Gerben Jongerius26-Oct-10 3:41 
QuestionSQL Server Trigger [modified] Pin
Jay Royall25-Oct-10 5:03
Jay Royall25-Oct-10 5:03 
AnswerRe: SQL Server Trigger Pin
Chris Meech25-Oct-10 6:13
Chris Meech25-Oct-10 6:13 
GeneralRe: SQL Server Trigger Pin
Jay Royall25-Oct-10 22:20
Jay Royall25-Oct-10 22:20 
GeneralRe: SQL Server Trigger Pin
Chris Meech26-Oct-10 2:38
Chris Meech26-Oct-10 2:38 
QuestionSimple question from new sql server user ... [modified] Pin
Yanshof25-Oct-10 2:25
Yanshof25-Oct-10 2:25 
AnswerRe: Simple question from new sql server user ... Pin
PIEBALDconsult25-Oct-10 3:34
professionalPIEBALDconsult25-Oct-10 3:34 
GeneralRe: Simple question from new sql server user ... Pin
NeverHeardOfMe25-Oct-10 4:18
NeverHeardOfMe25-Oct-10 4:18 
GeneralRe: Simple question from new sql server user ... Pin
PIEBALDconsult25-Oct-10 9:22
professionalPIEBALDconsult25-Oct-10 9:22 
GeneralRe: Simple question from new sql server user ... Pin
Mycroft Holmes26-Oct-10 1:42
professionalMycroft Holmes26-Oct-10 1:42 
GeneralRe: Simple question from new sql server user ... Pin
NeverHeardOfMe26-Oct-10 2:00
NeverHeardOfMe26-Oct-10 2:00 
GeneralRe: Simple question from new sql server user ... Pin
Mycroft Holmes26-Oct-10 2:57
professionalMycroft Holmes26-Oct-10 2:57 
GeneralRe: Simple question from new sql server user ... Pin
PIEBALDconsult26-Oct-10 15:12
professionalPIEBALDconsult26-Oct-10 15:12 
QuestionSQL Server 2008 R2: Errrors when sending ISO 8601 timestamp values as parameters to a parametrized insert statement Pin
Per Nilsson24-Oct-10 23:24
Per Nilsson24-Oct-10 23:24 
I have problem inserting datetime values into my SQL Server 2008 R2.
The server is capable of handling ISO 8601 format, but If I send them as parameters, the SQL Server/OLE DB provicer, seems to be less tolerant on the timestamp string format.


I use OLE DB from C++ and would like to make my insert statement parametrized
INSERT INTO BATCH VALUES (?, ?, ?, ?....

When I specify timestamp values on the ISO8600 format, "2010-10-23T19:41:56.002+02:00", I get errors.

When enter the same timestamp format directly in the statement, I don't get errors
INSERT INTO BATCH VALUES ('2010-10-23T19:41:56.002+02:00', ?, ?, ?....

I have tried two different OLE DB providers. "Microsoft SQL Server Native Client 10.0" and "Microsoft OLE DB Provider for SQL Server"
They both behave slightly differently.

When sending the timestamp values as part of the SQL INSET, both providers accepts the following formats
2010-10-23 19:41:58.000
2010-10-23T19:41:57.001
2010-10-23 19:41:56.002+02:00
2010-10-23T19:41:55.003+02:00


When sending timestamp as parameter:
2010-10-21 13:44:59.092        Is accepted by both
2010-10-21T13:44:57.092        Is rejected by Microsoft SQL Server Native Client 10.0 and accepted by the other
2010-10-23 19:41:56.002+02:00  Rejected by both providers
2010-10-23T19:41:55.003+02:00  Rejected by both providers


The both providers also report different errors
Microsoft OLE DB Provider for SQL Server reports "Conversion failed when converting date and/or time from character string" which I may understand.
The "Microsoft SQL Server Native Client 10.0" reports HRESULT=DB_S_ERRORSOCCURRED.

I would be glad if someone could explain these differences, especially why I can send the timestamp stirng litterally in the sql but not as a parameter.
AnswerRe: SQL Server 2008 R2: Errrors when sending ISO 8601 timestamp values as parameters to a parametrized insert statement Pin
Bernhard Hiller24-Oct-10 23:32
Bernhard Hiller24-Oct-10 23:32 
QuestionDatabase Unit Testing with Visual Studio 2010 Pin
dotman124-Oct-10 16:38
dotman124-Oct-10 16:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.