Comments
Sort by recent activity
Thanks @Alex B for researching into this and getting back to me. I'm not totally convinced about the explanation though as I've subsequently found that the error only surfaces when there is a 'WITH' clause included with the constraint creation statement, even when the table creation statement is not qualified with the database name. Splitting apart the table and constraint creation script gives the error in this scenario: CREATE TABLE [Logging].[LogEntries] ( [LogEntryId] INT IDENTITY (1, 1) NOT NULL ) GO ALTER TABLE [Logging].[LogEntries] ADD CONSTRAINT [PK_LogEntries] PRIMARY KEY CLUSTERED ([LogEntryId] ASC) WITH (FILLFACTOR = 90) GO
...but not in this one: CREATE TABLE [Logging].[LogEntries] (
[LogEntryId] INT IDENTITY (1, 1) NOT NULL
)
GO
ALTER TABLE [Logging].[LogEntries] ADD
CONSTRAINT [PK_LogEntries] PRIMARY KEY CLUSTERED ([LogEntryId] ASC)
GO
The only difference is the omission of the WITH clause in the second pair of statements. I agree that this is evidently an edge case and so likely isn't worth spending the time on fixing. Thanks again Chris / comments
Thanks @Alex B for researching into this and getting back to me.I'm not totally convinced about the explanation though as I've subsequently found that the error only surfaces when there is a 'WITH'...
Alex B said:
If you try formatting both of these, what is the result:
<div>WITH test AS
(SELECT 1 AS col1)
SELECT * FROM test</div>
and SELECT 1
WITH test AS
(SELECT 1 AS clo1)
SELECT * FROM test
For me, the first one does not add a semicolon before the WITH and the second one will add a semicolon after the 1 as normal for insert semicolons, does that happen for you? Kind regards,
Alex
Hi Alex, I get the same as you - no semicolon for the first (as I would expect), semi-colon after the SELECT 1 statement for the second. The error I'm getting appears to be something relating to the word 'Logging' (the table's schema name in my example). If I add an 's' to the schema name (i.e. 'Loggings') then the semi-colon adding works just fine. The error I reported only seems to happen if I attempt to refactor with just the table CREATE statement. As soon as I add in a 'CREATE SCHEMA Logging' statement then the refactor completes. Thanks Chris / comments
Alex B said:
If you try formatting both of these, what is the result:
<div>WITH test AS
(SELECT 1 AS col1)
SELECT * FROM test</div>
andSELECT 1
WITH test AS
(SELECT 1 AS clo1)
SELECT * FROM ...
Hi @Alex B, I think I've sussed out what's going on. If the schema name in which the table is being created has the same name as a database attached to the instance of SQL Server, then the error occurs. You should be able to replicate the behaviour if you try this on a SQL Server instance: USE master GO CREATE DATABASE Logging GO ...then in a new SSMS query window change context to the new Logging database then refresh the SQL Prompt cache. Then attempt to add semicolons to the following in ANY database on the SQL Server instance (not just the one newly created): CREATE TABLE [Logging].[LogEntries] (
[LogEntryId] INT IDENTITY (1, 1) NOT NULL,
CONSTRAINT [PK_LogEntries] PRIMARY KEY CLUSTERED ([LogEntryId] ASC) WITH (FILLFACTOR = 90)
)
GO
You should then experience the error. It so happens that the database in which I am trying to create the above table is also named 'Logging', I didn't think that this was relevant at first but it now seems that it might be. Thanks Chris / comments
Hi @Alex B, I think I've sussed out what's going on.If the schema name in which the table is being created has the same name as a database attached to the instance of SQL Server, then the error occ...
Assuming that you will never have to restore to a point in time between the completion of Full Backup 1 and Full Backup 2, and that you are sure that Full Backup 2 is integral, then yes you can delete the log backups.
I'd recommend keeping them for at least 3 days 'just in case', but obviously the retention policy is dependent on your requirements.
Chris / comments
Assuming that you will never have to restore to a point in time between the completion of Full Backup 1 and Full Backup 2, and that you are sure that Full Backup 2 is integral, then yes you can del...
Brilliant, thanks - seems to be working fine. Thanks again, Chris / comments
Brilliant, thanks - seems to be working fine.Thanks again,Chris
DanC said:
Hi @howarthcd I've managed to reproduce this, it still allows you to run the comparison in 14.2 although it shows an error. I've done a bug report for this and will keep you posted! Bug report reference SC-10773
Great, thanks for this. I've had to downgrade to v14.1.7.14336 as 14.2 wouldn't work against the database projects, complaining of duplicate definitions in the script files, even though there weren't any duplicates. I did find that if a RedGateDatabaseInfo.xml file is added to the root project folder then the comparison succeeds. / comments
DanC said:
Hi @howarthcd I've managed to reproduce this, it still allows you to run the comparison in 14.2 although it shows an error. I've done a bug report for this and will keep you posted...
Tianjiao_Li said:
Thanks for your patience. I'm pleased to let you know the fix has been released in 14.0.4.13251. Please upgrade at your convenience. Thanks.
I've tested this new build and found the problem has been resolved. Thanks for the quick turnaround! Chris / comments
Tianjiao_Li said:
Thanks for your patience.I'm pleased to let you know the fix has been released in 14.0.4.13251. Please upgrade at your convenience.Thanks.
I've tested this new build and fo...
A. SQL Clone / comments
A. SQL Clone
I've come up with a workaround which is to append the contents of the StandardError property (which contains the SQL error message) of the SQL Compare process to the output text file. Not ideal but it does the job in my particular situation. / comments
I've come up with a workaround which is to append the contents of the StandardError property (which contains the SQL error message) of the SQL Compare process to the output text file.Not ideal but ...
You could do one of the following:
1. Expand the file using the sqb2mtf.exe utility that is installed along with SQL Backup. You should be able to copy this from the server that was used to create the backup file: http://help.red-gate.com/help/SQLBackup5/0/en/Topics/SBU_CommandCONVERT.html#sqb2mtf
2. Install SQL Backup on the server that you are trying to install to and perform the restore within the trial period.
Chris / comments
You could do one of the following:
1. Expand the file using the sqb2mtf.exe utility that is installed along with SQL Backup. You should be able to copy this from the server that was used to create ...