I am experiencing an issue working with a database project in Visual Studio 2010 Ultimate with TFS. The following describes the work flow that I use:
I work locally modifying a SQL schema via SQL Server Management Studio.
Next I open up the Visual Studio database project & perform a "Schema Compare" operation.
I choose my local database with the latest changes as the "Source Schema" and the "Target Schema" as the database project.
Next I look at the "Schema Comparison" results and choose "Skip" for the "Update Action" on items that I do not want to change. For the items I do want to change I choose the appropriate "Update Action".
When I am finished I then choose the "Write Updates" command to apply the changes to the database project.
The problem that I have is that when I look at the database project, some of the database tables that I told to ignore get updated in the database project by commenting out the database create script.
For example this is what one looks like:
/*CREATE TABLE [SchemaName].[TableName] (
[Col1] BIGINT IDENTITY (1, 20) NOT NULL,
[Col2] INT NULL
);*/
The question is: Since I told the compare to ignore this table then why did it modify the project and comment out the code?
Ok people I found a solution for this issue via a fellow co-worker.
It turns out that there is an extra step you need to do while performing the Schema Compare:
Step 4A - After choosing the appropriate "Update Action" for all items you must now click the "Refresh" button. After you perform a refresh you may proceed to step 5.
Related
I have a VS 2013 installed, and successfully installed "Microsoft SQL Server Data Tools - Business Intelligence for Visual Studio 2013"
All BI project templates are OK, all toolbox items are OK. I also can create a new Integration Services project, and toolbox correctly shows all the SSIS out of the box items.
.
.
However when I try to add a new custom Toolbox item and choose Tools/Choose Toolbox Items the dialog has no "SSIS Data Flow Items" and "SSIS Contol Flow Items" tabs.
.
.
Because of the tabs are missing, I can not add custom component to my SSIS Data Flow Items tab. The following picture is from a tutorial, it shows what I am expecting to see:
I consider the missing tabs a symptom of something went wrong, but not insist to see the tabs, if there is any alternative way to add custom component to the SSIS Data Flow toolbox. But the most relaxing would be if the tabs were appeared...
Btw I have two machine with this exactly same symptoms, a 2012 Server and a Win 7 box.
Any help appreciated, thanks in advance.
One of the complaints custom component developers for SSIS had was that installation of their product (to the GAC and Program Files) still required the manual adding of them, as your final screenshot depicts.
2012+ no longer has this requirement. Instead, by virtue of a DLL being correctly built for that specific version of SSIS, "it will just show up" TM
I'm not finding the blog references but there were announcements about the change
"It just works" was already claimed
I added a new table in the sql server db and used visual studio sql compare to compare it to the existing db project. When i select the newly added table in the comparison results and say update, it does not show up in tfs pending changes.
Updates to procs show up in pending changes.
Any suggestions?
Run the compare again and it should go green.
it'll confirm that it was committed. Then check the project to see if the file is listed and has an addition graphic + in tfs
According to my experience i did rebuild the solution and compared again then it showing correct
In Visual Studio 2013, is there a way to ignore column ordering when doing a Schema Compare? I see that this feature was removed from Visual Studio 2012 (according to this: https://stackoverflow.com/a/13848952/188740), but I'm hoping it was brought back in version 2013.
Here's a quick visual to illustrate what I'd like to ignore:
As described on this blog post, Ignore column order is now an option in SSDT version 17.0, which is compatible with Visual Studio 2015.
If you’ve ever had to deal with accidental data
motion when putting a column in the middle of a table definition,
you’ll know how hard this can be to spot and manage. In this release
you can now check the “Ignore Column Order” option in the Advanced
Publish Options. This will append new columns to the end of an
existing table rather than altering the table structure to add the
column in its listed position.
You can find the setting by going into the Advanced... button section of your publish profile, as well as in the Advanced... button section of the database project properties' Debug tab.
You can also achieve the same effect by adding the following element to your publish.xml file:
<IgnoreColumnOrder>True</IgnoreColumnOrder>
Unfortunately I do not know of a way to have this work in Visual Studio 2013, but hopefully you have upgraded to a newer version of Visual Studio by now :)
Ignore column order is now available in VS2015.
Additionally, for relational and Azure SQL databases SSDT 17.0 GA includes a highly requested improvement to ignore column order in upgrade plans as well as numerous other bug fixes.
See: https://blogs.msdn.microsoft.com/ssdt/2017/04/19/announcing-the-general-availability-ga-release-of-ssdt-17-0-april-2017/
The 'Ignore column order' setting is not available in visual studio 2013. There are Tentive to reintroduce this option in the future.
Sources: Microsoft
This feature is also available in Azure Data studio -> Schema Compare -> Ignore Column Order.
I am working on project (VS2010 .NET) and have two SQL Server databases, Dev and Prod.
I make all database structure changes in the Dev database and after testing I apply the same changes to the Prod database.
Maybe someone could suggest schema comparison tool which could help me to compare structure and apply changes.
RedGate makes excellent tools for the purpose.
I know of two really good tools:
Red-Gate SQL Compare
ApexSQL Diff
You can also get SSDT (free) here - more about SSDT on my blog.
although you are working in 2010, if you can get hold of VS 2012
go to SQL (menu item) -> Schema Compare. Click on Select Source on the left, and select the dev database. Select the production database on the right.
Then click on the generate script icon (next to the Update icon, it looks more or less like a music icon). That will generate the update script. You may also untick any of the changes that you do not want to include in the script. And it is ... 'free' if you happen to own Visual Studio 2012
I am currently modifying a web application to use a MS SQL 2008 database with will be located in the app_data folder and auto-attached. Everything is fine and I can connect to the database and query it from within the application and also Visual Studio.
Although I need to also create/update some triggers and stored procedures, which I can not do - every time I choose the 'Add new stored procedure' from the right click menu in Visual Studio's Server Explorer menu, it creates a new template but I am unable to execute it, as there are not options enabled on the 'Query Designer' tool bar.
Maybe I am doing something completely wrong, but surely it should be just a case of creating my stored procedure and then clicking an execute button?
If you have never used Server Explorer for any database schema editing in Visual Studio and have previously only used SQL Server Management Studio, all I can say is that it is very unintuitive!
From within SQL Server Management studio, you create the procedure using the usual 'CREATE PROCEDURE' code and then execute it, if you happen to click the save button you are able to save a local copy as a .sql file, but doing so will not change anything within the database.
In Visual Studio's Server Explorer however, there is no way to execute any SQL, you can not execute any 'CREATE PROCEDURE', 'ALTER TRIGGER', etc. If you want to make changes to an object you have to click save instead - which is certainly not what you would do from within SQL Management Studio!
Microsoft certainly don't make simple tasks easy!
Select the SQL that you want to run (CTRL + A to select all), then right-click on it and choose RUN SELECTION. I can't, however, find any equivalent short-cut key.
Robert Harvey's answer was news to me, I admit, and is just weird. You can only "save" a query which begins with the word CREATE, it appears - and it's contrary to every principle of SQL that you can do so!