Pages

Showing posts with label TFS. Show all posts
Showing posts with label TFS. Show all posts

Saturday, January 18, 2014

TFS 2012 Tips - Part 1

 1) Copy work item name with ID

Often we need to copy the work item name and ID,
For example, to copy the ID and name of a bug, requirement or task.
This can be done by opening a work item and double clicking
on the title and it will copy to the clipboard its name and the ID,
all you need is to do 'paste'. Try it.
Other method is to click on the "O" icon and it will open new email
with this item in the outlook and on the email subject you can see the
work item ID and name and you can copy it from there.














2)  Ctrl + C will copy the full URL of the document in the TFS
 when you stand on it.

When you are in “Documents” section and you
Select a file and you want to copy its URL you can press Ctrl+C
Or right mouse click and press on “Copy” option
Open notepad and press Ctrl+V and you will get the
Full URL to the file.
 


 


 










3) Compare files on double click in Pending Changes view

In “Pending Changes” screen in the Team Explorer
When you double click to the file on default behavior
the file will be opened in the code editor.

Press Shift + double click to open Compare tool to compare
the differences between the file and the workspace version



















4) DB toolbar disappears when solution is opened.

If you have DB project in the Source Control, you
can open a stored procedure in the VS, connect to a DB
and work against a DB. To connect the a DB we have
'connect' option in the toolbar.
But the issue is that this toolbar disappears when we have
solution opened in the Solution Explorer. Close the solution
and the toolbar will appear again.


Friday, February 1, 2013

"Create Unit Tests" option greyed out in Database project

In the Visual Studio in database project, when you open Solution and switch to
Schema View , go to a stored procedure and right click, you should see the
option "Create Unit Tests...".
The problem is that it can be greyed out (sometimes).


"Create Unit Tests" option greyed out
















In my case it is greyed out when there was no successful build of the database
project, try to issue build, fix errors if you have and see again the option
"Create Unit Test" is greyed out.

Tuesday, March 29, 2011

How to resolve references to system objects in TFS, References to Master/MSDB objects

To continue of TFS/DB Dude subject, I want to share with you
some  issues we had with starting to work with the TFS Database
edition.

This post will discuss "How to resolve references to system objects
in TFS, References to Master/MSDB objects". In next posts
I will describe additional problems, like merge issues, adding
new objects to DB and etc.

Probably you use system objects in your stored procedures,
For example: system tables, system views, DMVs or system
catalogs or you use MSDB objects in your SPs, like sending
emails from DB.


In such cases, when you
run a build of the solution
or database project, you
will get warnings indicating
that the system objects used
in the stored procedures
cannot be resolved.


Here some examples:

XXX has an unresolved reference to object [sys].[schemas].
XXX has an unresolved reference to object [sys].[tables].
XXX has an unresolved reference to object [sys].[dm_db_index_physical_stats].
XXX has an unresolved reference to object [msdb].[dbo].[sp_send_dbmail].

The solution :

To reference a master or msdb database containing system
objects, you can reference to a master.dbschema file or
msdb.dbschema file accordingly to resolve the references
to the system objects.









These files can be found in :

C:\Program Files\Microsoft Visual Studio 10.0\VSTSDB\
Extensions\SqlServer\2008\DBSchemas\

The red values can vary, depending of you version of TFS
and DB project.
Note that each supported version of SQL Server has
corresponding master.dbschema and msdb.dbschema files.

You may see problems such as 'master.dbschema does not exist'
when you do Build from other machines, for example,
from TFS Server.
Or when you do a Branch.

Error Example:
C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0\TeamData\Microsoft.Data.Schema.TSqlTasks.targets (56): File D:\Builds\NeoApp\Program Files\Microsoft Visual Studio 10.0\VSTSDB\Extensions\SqlServer\2008\DBSchemas\master.dbschema does not exist.

This happens because the path to these files saved in dbproj file
by using relative path, something like this \..\..\xx\xxx\x

One way of dealing with this problem is to make your referenced
dbschema files a part of the solution and reference using
a relative path. For example, create a folder in your
Solution/Project, copy files into it and create the reference to
these files in the folder. This will solve the path issues
between machines.

Finally, here is a link to good article about the
Microsoft Visual Studio Team System 2008 (VSTS) Database Edition

Friday, December 17, 2010

TFS and SSMS integration

In my company, we are starting to use TFS as source control
of DB projects.














This is a big change in the work flow and development processes.

Do you know if there an option to use SSMS
instead of VS. What I mean is to do automatically
check in and check out in SSMS like you do in VS.

For example, I want to open VS, go to source control
Or go to local solution (after getting latest version),
Open a stored procedure, it will open it in SSMS,
Then edit this SP and save it back.
On editing the SP, I want automatically to do check out.

Do you use TFS source control on databases?
If so, in which way? Editing stored procedures in VS?

Note:
There is TFS MSSCCI Provider tool.
It helps you in situation when you create a project in
SSMS, add it to the source control, then you can automatically do
check in and check out directly in the SSMS files that relate to
the project you created.

What I want, is to create a database project in the VS database
edition, add it to the source control and then use SSMS instead
of Visual Studio.