Red Gate forums :: View topic - SQL command error and unexpected token:
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Data Compare 10
SQL Data Compare 10 forum

SQL command error and unexpected token:

Search in SQL Data Compare 10 forum
Post new topic   Reply to topic
Jump to:  
Author Message
bbinf



Joined: 08 Mar 2012
Posts: 4

PostPosted: Fri Mar 09, 2012 1:18 am    Post subject: SQL command error and unexpected token: Reply with quote

Hi,

We have recently upgraded to SQL 2008 R2 and when trying to compare a database against a backup file, I am regularly getting an error:

The following SQL command caused the error:

SELECT [field1], [field2], [field3], [field4], [field5]
FROM [dbo].[table1] ORDER BY [field1]

The log file shows errors like:


create default def_blank as ''

09:39:02.359|Error |SQL Compare Engine P|32 |line 1:88: unexpected token: ["create",<666>,line=1,col=88] [char=81]
09:39:02.359|Error |SQL Compare Engine P|32 |Parse error for:
/****** Object: Default dbo.def_today Script Date: 23/03/99 3:54:43 ******/
CREATE DEFAULT def_today AS getdate()

09:39:02.359|Error |SQL Compare Engine P|32 |line 1:90: unexpected token: ["CREATE",<666>,line=1,col=90] [char=83]
09:39:02.374|Error |SQL Compare Engine P|32 |Parse error for:
/****** Object: Default dbo.def_zero Script Date: 23/03/99 3:54:43 ******/
CREATE DEFAULT def_zero AS 0

09:39:02.374|Error |SQL Compare Engine P|32 |line 1:89: unexpected token: ["CREATE",<666>,line=1,col=89] [char=82]

I also upgraded to Data Compare 10, just to ensure if this is related to an issue in earlier version, but the same error repeats.

This error is only reported on two tables (biggest tables in terms of numbers of rows) for the database.

We have been successfully running the compare earlier when the databases were on SQL 2000.

Any suggestion on how to resolve this issue?

Regards
Samir
Back to top
View user's profile Send private message
Chris Auckland



Joined: 24 Oct 2006
Posts: 755
Location: Red Gate Software Ltd.

PostPosted: Fri Mar 09, 2012 2:38 pm    Post subject: Reply with quote

Thanks for your post.

It looks like the error is coming from the SQL Compare engine parsing one of your objects.

Could you try comparing the schemas using SQL Compare? It should give you a better error if it encounters errors reading the objects.

If it shows you which object it's having trouble with, could you post or email me the SQL for that object?

There might be a bug in the engine parsing some of the syntax you're using.
_________________
Chris
Back to top
View user's profile Send private message Send e-mail
bbinf



Joined: 08 Mar 2012
Posts: 4

PostPosted: Mon Mar 12, 2012 12:12 pm    Post subject: Reply with quote

Hi Chris,

Thanks for the response. We only bought the license for SQL Data Compare, hence do not have SQL Compare to verify the process. I will check if I can download a trial version to run this test.

Also, just in case it helps, the error only occurs when comparing against a backup file. Running the data compare between two databases works fine.

I will get back to you with the results from SQL Compare.

Regards
Samir
Back to top
View user's profile Send private message
bbinf



Joined: 08 Mar 2012
Posts: 4

PostPosted: Wed Mar 14, 2012 12:47 pm    Post subject: Reply with quote

Hi Chris,

I have run the comparision between the backup file and database using SQL Compare 10. This comparision has run successful without any errors messages.

The database contains commercial information for customers and I will have to seek permission from our CEO regarding providing a copy of the backup.

Does the fact that comparision runs properly using SQL Compare but reports error with Data Compare help in any way?

Regards
Samir
Back to top
View user's profile Send private message
bbinf



Joined: 08 Mar 2012
Posts: 4

PostPosted: Fri Mar 16, 2012 1:15 am    Post subject: Reply with quote

Hi Chris,

Please advise how can I send you the backup file for testing? Size of the zip file is approx 200 MB.

Regards
Samir
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group