Showing posts with label trouble. Show all posts
Showing posts with label trouble. Show all posts

Monday, March 26, 2012

Incorrect syntax near the keyword 'CONVERT'

What in the name of all creation is wrong with this query? I just can't seem to find the trouble...

EXEC OppdaterForetak 900000000,'NO NON MOD DUNS Test 1','abcdveien 145','110','OSLO',NULL,'118','OSLO','22222222','22222222',CONVERT(datetime,'2006-07-18 00:00'), 101,'OSLO', 3,'Oslo','AS', 99999,'NB! TESTFORETAK',NULL,NULL,NULL, 345000001,CONVERT(datetime,'2006-07-17 00:00'),CONVERT(datetime,'2006-07-19 00:00'),'A',NULL,'Daglig leder alene.'

You can't use any function when you call the Procedure. It should be predefined.

Here you can use the variable to assign the values then reuse the varibale on the procedure call.

But for your query convertion is not nessasary.. since you are using the valid dateformat..

Code Snippet

EXEC OppdaterForetak 900000000,

'NO NON MOD DUNS Test 1',

'abcdveien 145',

'110',

'OSLO',

NULL,

'118',

'OSLO',

'22222222',

'22222222',

'2006-07-18 00:00:00',

101,

'OSLO',

3,

'Oslo',

'AS',

99999,

'NB! TESTFORETAK',

NULL,

NULL,

NULL,

345000001,

'2006-07-17 00:00:00',

'2006-07-19 00:00:00',

'A',

NULL,

'Daglig leder alene.'

Sunday, February 19, 2012

In trouble with Async Replication..

Hello Everybody,

In the past few days I try to work with SQL Mobil and Replication.

And now I have a big problem.

When the replication ist running in my little application the pda-user wants not stop there working. So I try to implement some routines of code that I find in this onlinearticle: http://msdn2.microsoft.com/en-us/library/2ysxae29.aspx

The codes workes fine as long I don't start another SQL Task. When I start either (Select, Insert, Update or Delete) Statement the Database crash with errormessage: "The database file may be corrupted. Run the repair utility...

Can anyone give me a tip what I must do to fix this problem.

Many Thanks

Markus

I'm not sure, but i think that replication must run alone. You can't work with the data from the replication tables while you're replicating.

If you look the SqlCeReplication.Synchronize() documentation, you'll read this remark: "All other connections to the database must be closed prior to calling this method."

http://msdn2.microsoft.com/en-us/library/system.data.sqlserverce.sqlcereplication.synchronize.aspx