I'm able to use the publishing wizard command line to script a database with foreign keys. I was getting the same error but then I found this post: http://social.msdn.microsoft.com/Forums/en/sqlexpress/thread/ecfd4379-ee88-4a60-81a4-d6cc9542b1ff[^] which said to make sure that the case of the database name has the correct case. When I fixed that the error went away.
J
Josh Handley
@Josh Handley