Executing SQL Server 2008R2 Script

Topics: Business Logic Layer
Aug 15, 2013 at 2:51 AM
When I execute the 2.8 or 2.7 SQL Server script, I get the following errors. Am I using the right scripts?
Msg 547, Level 16, State 0, Line 1
The ALTER TABLE statement conflicted with the FOREIGN KEY constraint "FK_be_PostCategory_be_Posts". The conflict occurred in database "AlantusBlog", table "dbo.be_Posts".
Msg 4917, Level 16, State 0, Line 1
Constraint 'FK_be_PostCategory_be_Posts' does not exist.
Msg 4916, Level 16, State 0, Line 1
Could not enable or disable the constraint. See previous errors.
Msg 547, Level 16, State 0, Line 1
The ALTER TABLE statement conflicted with the FOREIGN KEY constraint "FK_be_PostTag_be_Posts". The conflict occurred in database "AlantusBlog", table "dbo.be_Posts".
Msg 4917, Level 16, State 0, Line 1
Constraint 'FK_be_PostTag_be_Posts' does not exist.
Msg 4916, Level 16, State 0, Line 1
Could not enable or disable the constraint. See previous errors.
Aug 16, 2013 at 4:27 PM
Interesting solution to the problem.

At first I copied the script into an editor and pasted it into Sql Server, that's when I get the errors!

Then I used the script directly from the file, and 100% working with no errors!

I'm shocked that it made a difference, but obviously the editor changed something in the sql.

I'm good to go now!
Aug 16, 2013 at 4:46 PM
Further test on the difference between the file saved in the text editor shows this

SET IDENTITY_INSERT [dbٴo].[be_Posts] ON - There is a funny character next to the "o" in dbo, which results in this
SET IDENTITY_INSERT [db‘ o].[be_Posts] ON - Which produces the error when copied into Sql Server Mgt Studio

It's ONLY on that line, everything else in the file shows absolutely no difference.