Comments
4 comments
-
Hi,
This sounds like a text encoding issue, but it's hard to locate the problem since there are subtly different ways of exporting the script. Would you mind letting me know which of these methods work?
- Does the script look OK in the SQL Compare deployment wizard?
- Can you run the script using "Deploy Now" in SQL Compare?
- Does it look OK if you click "Save Script"?
- Does it look OK if you press the "Copy" button and paste into Notepad or SSMS?
- Does it look OK if you select all the text and copy it with keyboard shortcuts? (Ctrl+A, Ctrl+C)
- What locale (language) is your local machine using? -
Here are my results from the questions you asked.
- Does the script look OK in the SQL Compare deployment wizard?
No
- Can you run the script using "Deploy Now" in SQL Compare?
It is listing it out wrong, but it looks like it correctly added itself to the other database when finished.
- Does it look OK if you click "Save Script"?
Same spacing issue.
- Does it look OK if you press the "Copy" button and paste into Notepad or SSMS?
No
- Does it look OK if you select all the text and copy it with keyboard shortcuts? (Ctrl+A, Ctrl+C)
posting it to notepad actually removed most of the spacing structure and the words still run together.
- What locale (language) is your local machine using?
English (United State)
Does it matter what encoding I am using? under application options for Encoding I am currently set to use Unicode (UTF-16) -
Thanks for your information. It looks like SQL Compare is having trouble with unusual whitespace in your text objects - if I run
CREATE TABLE PROJECT (id INT) DECLARE @NewLineChar AS CHAR(1) = CHAR(13) EXEC ('CREATE PROC Procodile @DeptValue int'+@NewLineChar+'AS'+@NewLineChar+'SET'+@NewLineChar+'NOCOUNT ON'+@NewLineChar+'DELETE FROM PROJECT')
then the deployment wizard shows the behaviour you are describing. Additionally, the syntax highlighting is colouring some of the text white, so you have to select the text to make it visible in the deployment wizard.
The reproduction I found uses the Carriage Return character without a Line Feed - can you check whether your function definition contains this kind of line ending? -
The fix for this should be available in 12.0.23 - does it solve your problem?
Cheers,
Add comment
Please sign in to leave a comment.
1. "intASSET NOCOUNT ONDELETE from" which should be "int AS SET NOCOUNT ON DELETE"
2. "OUTPUTASSET NOCOUNT ONINSERT INTO PROJECT" which should be "OUTPUT AS SET NOCOUNT ON INSERT INTO PROJECT"
3. "[update_date] = @update_dateWHERE" which should be "[update_date] = @update_date WHERE"
So from what I can see either carriage returns or spaces are being lost when creating the deployment scripts for a large amount of stored procedures.