Quantcast
Channel: Red Gate forums: SQL Compare 10
Viewing all 1066 articles
Browse latest View live

RE: Change PK cols and Non-CL Index should DROP NCL First?

$
0
0
I will give you credit where credit is due - switching the indexes around makes the query run consistently 5 seconds faster on my server. It looks like there are a lot more latches going on.

If you are using Source Control, it may be a good idea to put a migrations script there to change the order. I can log a bug on this side but it doesn't seem to be a critical issue.

RE: How to get /include:StaticData functionality with /Filter?

$
0
0
Thanks, I'll add something to the feature request page. My intentions aside, I'm still unclear how the /include:StaticData actually works. Is it dependent on other /include switches?

For example for me "/include:StaticData" scripts up static data as well as other table schema change.
If I run "/include:StaticData /exclude:Table" or "/include:StaticData /exclude:Role" nothing is scripted.
If I run "/include:StaticData /exclude:View" the data gets scripted as well as just about everything other than views.

Is there anyway to ONLY script out the static data (and maybe table schema since I could understand the dependency) in a comparison?

RE: Change PK cols and Non-CL Index should DROP NCL First?

$
0
0
Thanks Brian.

For completeness, the table in question contains about 110MM rows, which takes considerably longer to alter with the NCI in place.

Haven't yet got the hang of migration scripts in SSC - too much else going on to spend time on them, to be honest, so I keep my scripts in sequence in the file system and run them manually. Thankfully with only one target production server per application, it's not arduous.

Best regards,

Stephen

RE: SQLCompare and SQL Server 2014

$
0
0
I get this error now(April 10, 2014) for sql server 2014. Does Red Gate support it now?

RE: How to get /include:StaticData functionality with /Filter?

$
0
0
I'm not entirely sure how it works under the hood- you could try using /include:StaticData and also /include:Table <tables> to see if that works - the help states that you shouldn't use exclude and include together (which sort of makes sense as if there's a "conflict of interests" which would win?)

RE: SQLCompare and SQL Server 2014

SC can't read new repo: "Unable to find a RedGate.ssc file"

$
0
0
SQL Compare fails to read a schema folder it has created if you try to read it direct from an SVN repository.

It works if you add an empty file called RedGate.ssc to the schema folder.

Follow these steps to reproduce the issue.

Repro steps

In steps 1-6 you create a Red Gate database schema folder and commit it to a new SVN repository.

This creates the condition to reveal the bug.

1. Create new SVN repo.

Code:

$ svnadmin create DummyRepo


2. Create new SVN working copy.

Code:

$ svn checkout file:///C:/Users/iain/DummyRepo DummyWC
Checked out revision 0.


3. Create new database with a single object.

Code:

$ sqlcmd -Q "CREATE DATABASE DummyDB;"

$ sqlcmd -d DummyDB -Q "CREATE PROCEDURE DummyProc AS RETURN 1;"


4. Script out the database to the working copy.

Code:

$ sqlcompare /database1:DummyDB /makescripts:DummyWC
SQL Compare: activated, edition: professional, serial number: XXX-XXX-XXXXXX-XXXX
SQL Compare Command Line V10.5.0.611
======================================================================================================================
Copyright © Red Gate Software Ltd 1999-2013

Creating folder of scripts 'C:\Users\iain\DummyWC' from database 'DummyDB' on '(local)'...
OK


5. Add new files to version control.

Code:

$ svn add DummyWC/*
svn: Skipping argument: E200025: 'DummyWC/.svn' ends in a reserved name
A         DummyWC\RedGateDatabaseInfo.xml
A         DummyWC\Stored Procedures
A         DummyWC\Stored Procedures\dbo.DummyProc.sql


You can see from the output that sqlcompare created the RedGateDatabaseInfo.xml metadata file and a file for DummyProc.

sqlcompare did not create a file called RedGate.ssc (this matters in step Cool.

6. Commit files to repository.

Code:

$ svn commit DummyWC --message "Initial commit. Folder contains one DummyProc and RedGateDatabaseInfo.xml"
Adding         DummyWC\RedGateDatabaseInfo.xml
Adding         DummyWC\Stored Procedures
Adding         DummyWC\Stored Procedures\dbo.DummyProc.sql
Transmitting file data ..
Committed revision 1.


In steps 7-8 you try to read the schema folder direct from the SVN repository. SQL Compare rejects the folder.

The bug reveals itself in step 8.

7. Open a new project in the SQL Compare GUI.

Set the source type to "Source Control".

Set the source to "Direct from Source Control" and choose "Browse source control..." from the Repository list.



8. Set the source control system to Subversion (SVN).

Set the database repository URL to the repo URL file:///C:/Users/iain/DummyRepo (what you checked out in step 2).

Click Link.



SQL Compare shows an error dialog.



Quote:

Database location isn't valid

Unable to find a RedGate.ssc file at the database location specified



In steps 9-10 you try to read the schema folder from the working copy. SQL Compare accepts the folder.

9. Click OK then click cancel.

10. Set the source to "Scripts folder".

Set the scripts folder path to the working copy path C:\Users\iain\DummyWC (what you created in step 2).

SQL Compare accepts the path.

Quote:

Red Gate database schema found




In steps 11-12 you commit a dummy file to let SQL Compare accept the folder direct from source control.

This provides a workaround for the bug in step 8.

11. Commit an empty file called RedGate.ssc to the repo.

Code:

$ copy NUL DummyWC\RedGate.ssc
        1 file(s) copied.

$ svn add DummyWC\RedGate.ssc
A         DummyWC\RedGate.ssc

$ svn commit DummyWC --message "Add empty file RedGate.ssc to let SQL Compare read from SVN."
Adding         DummyWC\RedGate.ssc
Transmitting file data .
Committed revision 2.


12. Repeat steps 7 and 8.

Now SQL Compare accepts the folder direct from source control.

The repository field contains the URL file:///C:/Users/iain/DummyRepo (what you set in step Cool.

RE: SC can't read new repo: "Unable to find a RedGate.ssc file"

$
0
0
It not absolutely clear what the correct behavior should be.

Should SQL Compare create an empty file called RedGate.ssc, like SQL Source Control does?

Or should SQL Compare just stop checking for RedGate.ssc altogether?

I would prefer the second option because it seems simpler from a user's point of view.

Drops and Creates a Trigger Before the table is Altered

$
0
0
Hi All

We use SQL Compare to compare the versions of databases and generate the deployment script.

How ever recently I noticed, that it DROPS and CREATES a TRIGGER before the table itself is ALTERED.

So it fails because it tries to create a TRIGGER on COLMN that does not EXIST.

For an Example it Generates the SCRIPT in the Following Order

IF OBJECT_ID(N'[dbo].[OnPathwaySectionsUpdateRefreshBI]', 'TR') IS NOT NULL
DROP TRIGGER [dbo].[OnPathwaySectionsUpdateRefreshBI]
GO
PRINT N'Dropping trigger [dbo].[OnAddressHistory] from [dbo].[tblAddress]'
GO



IF OBJECT_ID(N'[dbo].[OnAddressHistory]', 'TR') IS NULL
EXEC sp_executesql N'
CREATE TRIGGER [dbo].[OnAddressHistory]
........
TRIGGER CODE
...


IF COL_LENGTH(N'[dbo].[tblAddressHistory]', N'fldPlanningRegion') IS NULL
ALTER TABLE [dbo].[tblAddressHistory] ADD[fldPlanningRegion] [uniqueidentifier] NULL
GO

Could you please let me know what's causing this and How to Fix this.

Thanx in Advance!

RE: SC writes empty script for drop, adds "1" to recreated name

$
0
0
Hi Evan,

Thanks for looking into it.

Were you able to reproduce the issues?

Can you report on the internal status?

Thanks,
Iain

RE: SC writes empty script for drop, adds "1" to recreated name

$
0
0
Hi Iain,

Sorry about the delay.

I was able to reproduce all the behavior you mentioned. It looks like bugs 1 and 3 are logged as SC-3645, which I've updated internally. It doesn't look like it's on the radar for an immediate fix, so I don't have a good timeline for you.

Regarding 2 and 4, it looks like no matter what, when you deploy to a scripts file source, it writes the xml file in the format that doesn't include the server version. So 2 looks like an inconsistency in which makescripts includes that tag when the folder is created, but it's removed if it's ever the target in a comparison. 4 looks like it occurs because it actually rewrites the file with the same content each time (I tried messing with the file right before deploying and it was changed back right after the deployment).

I logged 2 SC-7074 as and 4 as SC-7073.

Thanks,
Evan

Sync Extended properties on the database itself

$
0
0
I didn't find a matching post, so if this is a duplicate, please let me know. I'm trying to document my dbs using extended properties, and of course, for this to work, I'll need to sync across all the copies from dev, test, and production. I'm not finding any options in the sql compare to find these and create the script. Tables, views, etc. have the extended properties, but it's not listing the differences on the db itself.
Any suggestions?

RE: SC can't read new repo: "Unable to find a RedGate.ssc file"

$
0
0
SQL Compare has no code that reads from source control repositories: it uses the installed Source Control code. So the behavior of SQL Compare should be exactly equal to that of SQL Source Control.

RE: Drops and Creates a Trigger Before the table is Altered

$
0
0
Do you absolutely need the "check object existence" and/or "drop and create instead of alter" options? It may work with these off. There seems to be a bug in SQL Compare that causes this problem sometimes with this option on.

RE: Sync Extended properties on the database itself

$
0
0
Database-level extended properties are supported by SQL Compare since (I believe) version 8. For instance, this will show up as an extended property difference in SQL Compare:
Quote:
EXEC sp_addextendedproperty N'MyPropTest', N'testytest', NULL, NULL, NULL, NULL, NULL, NULL
Have you got an example of a script to create a database-level property that isn't being detected and/or scripted by SQL Compare?

RE: Sync Extended properties on the database itself

$
0
0
I found it in the interface! Thanks so much.

RE: SC writes empty script for drop, adds "1" to recreated name

$
0
0
Thanks for logging those, Evan.

SC-3645 is the most important one here.

Somehow our workflow ends up producing hundreds of empty files paired with script files with 1 on the end every few months.

When we gather enough someone shouts about it and we decide to clean up.

We've learned to be more vigilant about our commits in any case.

It would be great if SQL Compare was more tidy in the first place Smile

RE: SC can't read new repo: "Unable to find a RedGate.ssc file"

$
0
0
I wasn't aware that SQL Compare actually used SQL Source Control in the background.

Thanks for explaining that.

The read behavior is consistent. Both SQL Source Control and SQL Compare fail to read a repo without a RedGate.ssc file.

The write behavior is not the same. SQL Compare can't write directly to an SVN repo.

When you set SVN as the target and go to the deployment wizard, your only option is to create a deployment script.

Would be great if the tools were more consistent.

Would it be possible to ignore the presence of RedGate.ssc?

If not, would it be possible for SQL Compare to write a RedGate.ssc file whenever it creates a set of scripts?

Advice needed

$
0
0
I have a MS SQL Database from a POS System. I need to export data to a new POS system ( Blank Database on new POS system) . All I need is Products, Prices and Barcodes. My problem is the barcodes are stored in a different table. I have no problem exporting each table and then importing but I am missing the barcodes as they are in a different table. Can this be done?

Bottles, adeptness its of canteen or plastic

$
0
0
Bottles, adeptness its of canteen or plastic, are noticed to be the a lot of able adjustment to abundance commodity that abide in aqueous formparable to oil. Advantageous and big-ticket oils like acute oils aswell are adored in bottles about now not any canteen can aswell be used. Capital oil canteen isnt agnate to added oil bottles. Absolute important oil is big-ticket and admission to be stored with absolute care. To save capital oil from breakable and to canteen its ambrosial houses, they should finer be adored in both amber or azure dejected bottles. These are accurately acclimated to breach acute oils as a aftereffect of theyre aphotic canteen that forestalls aurora from penetrating. Canteen amber and canteen azure dejected bottles aremonly acclimated to banker acute oil. Azure dejected bottles are dearer than amber coloured bottle. Dont opt for cellophane canteen bottles if you acquisition chaussures new balance yourself analytic for absolute important oil. You may aswell to acquisition a few creditors affairs absolute important oil in aluminum bottles; theyre aswell able if the autogenous of the canteen is lined. Capital oil bottles are attainable in several sizes to accomplish the adapted needs and requirements of the people. They consistently are attainable in 5ml, 10ml in accession to 15ml. However, cher capital oils are to be had in altitude as low as 2ml. Advancement capital oil canteen candidly is alarming as they may abatement and anniversary down. In such instances, copse containers are the a lot of able to abundance absolute important oils. Association positioned acute oil at paintings for altered clandestine purposes. Absolute important oils are in actuality simple to accomplish use of and admission therapeutically benefits. They are afresh acclimated for simple inhalation, beef assimilation that may accommodate a duke with algid and influenza, beating that is allowance in firming the physique and activating abortive cells, allowance awakening or bath. Things you ambition to admission to accrue in apperception that: ? Capital oils will admission to aswell be stored in a cool, aphotic place. ? Beacon ablaze of diplomacy acute oils in artificial bottles as the capital oil can deliquesce the artificial ? Accrue abroad from arcade for capital oils that acquaintance a elastic chaussures nike shox eyedropper ball aural the a lot of alive ? Blockade boxes can be acclimated to abundance capital oils ? Beacon ablaze of oils which adeptness be awash in ablaze canteen bottles because the ablaze canteen can acquiesce affable that can abrasion the capital oils. ? Apprentice the assurance adeptness for the acute oils you admission to use Bethink to breach the absolute abovementioned credibility in apperception while you boutique for absolute important oil bottles next time. If you are demography a attending to boutique for copse box for the absolute important oil bottles you adeptness have, youll be able to buy able packing containers economically from abounding adeptness stores. However, in case you do not allegation to chaussures ralph lauren get into the adversity of traveling out of home. Youll attending for online creditors, artlessly admit capital oil canteen in any of the coursing engine it may be beam or beast and youll get admission to amaranthine bulk of online creditors afterwards which can accomplish a chaussures christian louboutin best the adapted absolute important oil and will adjustment for it, that too online.
Viewing all 1066 articles
Browse latest View live