Activity overview
Latest activity by emmar00
Are you familiar with PowerShell and dbatools? Sync-DbaAvailabilityGroup seems like what you are looking for. / comments
Are you familiar with PowerShell and dbatools? Sync-DbaAvailabilityGroup seems like what you are looking for.
SqlCloneTemp databases stuck Restoring
We have a dedicated server/SQL Server instance that we use for clone management. There are a couple of databases that start with SqlCloneTemp that seem to be stuck in the Restoring state - in fact,...
While T-SQL syntax typically does not require semicolons, THROW is an exception. Microsoft docs: "The statement before the THROW statement must be followed by the semicolon (;) statement terminator." Yes, even if the previous "statement" is BEGIN. So just add a semicolon in there and you will be good to go. / comments
While T-SQL syntax typically does not require semicolons, THROW is an exception.Microsoft docs: "The statement before the THROW statement must be followed by the semicolon (;) statement terminator....
I did file a feature request. I was eventually able to find a workaround similar to the suggestion from Nov 30 and thought I would share: 1. Create a new database 2. Use SQL Compare to copy over: a. Source schema (in above discussion, this would be test_schema) b. Target schema (new_schema) c. Objects on target schema Tip: exclude users and roles first to eliminate clutter, then filter for schema name = target. 3. Move objects to the other schema USE YourNewDB GOSELECT 'ALTER SCHEMA <source> TRANSFER ' + s.name + '.' + o.name FROM sys.objects o INNER JOIN sys.schemas s ON s.schema_id = o.schema_id WHERE s.name = '<target>' AND o.type IN ('U', 'V', 'P') -- tables, views, procedures, expand list as needed Copy output and execute 4. Go back to SQL Compare, clear any filters or selected items, and refresh the comparison. Now you have the comparison report. If you want to deploy the changes across, probably the easiest way would be to generate the comparison script, save it, replace the schema name, and then execute it on the original database. / comments
I did file a feature request. I was eventually able to find a workaround similar to the suggestion from Nov 30 and thought I would share:1. Create a new database2. Use SQL Compare to copy over: ...
@Dan_J Interesting that it works for you. My understanding based on the documentation page (linked in my original post) was that it shouldn't work at all - it's pretty explicit about that in the 3rd bullet point. Nevertheless, I turned on logging this morning and got the error captured. Log file is attached. / comments
@Dan_J Interesting that it works for you. My understanding based on the documentation page (linked in my original post) was that it shouldn't work at all - it's pretty explicit about that in the 3r...
@Dan_J That doesn't work, because you can't leave schemas unmapped, apparently. I created a new database and used SQL Compare to copy over the structures. I set up the comparison like you said: [image] And on running the compare: [image] If I map them back together, then the comparison will go through, but that just brings me back to square one. / comments
@Dan_J That doesn't work, because you can't leave schemas unmapped, apparently. I created a new database and used SQL Compare to copy over the structures. I set up the comparison like you said:And ...
I've learned that SQL Compare for Oracle can do this - https://www.red-gate.com/products/schema-compare-for-oracle/compare-two-oracle-schemas . Isn't there a way to do this for SQL Server with the regular SQL Compare? / comments
I've learned that SQL Compare for Oracle can do this - https://www.red-gate.com/products/schema-compare-for-oracle/compare-two-oracle-schemas . Isn't there a way to do this for SQL Server with the ...
"Duplicates" when remapping owners
I'm trying to compare tables in two different schemas from the same database and server. There could be columns that are renamed or missing, or even tables that don't exist on one side or the other...