Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Datetime conversion

Status
Not open for further replies.

ConChoona

IS-IT--Management
May 19, 2005
22
GB
Hi,

When I run the following on one server, it runs correctly and adds the entry to the database:

exec sp_executesql N'INSERT INTO [BO_DEMO].[dbo].[CXV_LIST] ([LIST_UNO], [CREATED], [CREATED_BY], [LAST_MODIFIED_BY], [NAME], [START_DATE], [END_DATE], [OWNER_UNO], [SPONSOR_UNO], [LIST_TYPE_UNO], [DISCRIMINATOR], [INACTIVE], [LAST_MODIFIED], [ISSUE_DATE]) VALUES (@ListUno, @Created, @CreatedBy, @LastModifiedBy, @Name, @StartDate, @EndDate, @OwnerUno, @SponsorUno, @ListTypeUno, @Discriminator, @Inactive, @LastModified, @IssueDate)',N'@ListUno int,@Created datetime,@CreatedBy int,@LastModifiedBy int,@Name varchar(100),@StartDate datetime,@EndDate datetime,@OwnerUno int,@SponsorUno int,@ListTypeUno int,@Discriminator char(1),@Inactive char(1),@LastModified datetime,@IssueDate datetime',@ListUno=1,@Created='2008-07-15 22:41:08:777',@CreatedBy=4,@LastModifiedBy=4,@Name='TEST',@StartDate='2008-07-15 08:00:00:000',@EndDate='2008-07-15 08:30:00:000',@OwnerUno=33,@SponsorUno=33,@ListTypeUno=7,@Discriminator='P',@Inactive='N',@LastModified='2008-07-15 22:41:08:777',@IssueDate='2008-07-15 22:41:02:763'

However, if I run it on another server, on a slightly different db I get the following:

Conversion failed when converting datetime from character string.

Now, I'm not a programmer, so I am wondering if this is a problem with the SQL server configuration or something set incorrectly within the database setup? It should work on the second database, as they are essentially the same barring some transaction differences.

Cheers,

Con
 
Check thread183-1487770

Borislav Borissov
VFP9 SP2, SQL Server 2000/2005.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top