How to document a database project in visualstudio - sql

Based on my knowledge about c# documentation via Visual studio i activated the xml file in Properties -> SQLCLR-Build -> XML-Documentationfile.
now the xml file is created but i'm unable to figure out what tags are allowed and how to start the documentation
in c# i would do
/// <summary>
/// does some stuff
/// </summary>
public ....
so i did the same in sql
--- <summary>
--- does some stuff
--- </summary>
CREATE PROCEDURE ....
but the created xml doesn't reflect my documentation.
and even after some research about "visual studio SQLCLR build xml documentation" i'm unable to find some useful information on how to document my procedures, tables and functions in a way that the xml-documention is able to catch it
I'm using visual studio 2013 just in case this is importent

A couple of ideas:
There is a project on codeproject.com called SQL XML Documentation that extracts XML comments from SQL scripts using Microsoft SandCastle. I've never used it though so I cannot vouch for it.
If you don't necessarily need the documentation in XML, you can take advantage of the Description property in Visual Studio's Property pane. The description will be stored as an extended property in SQL Server.

Related

SSMS not using template for new stored procedure

I edit the template "Create Stored Procedure (New Menu).sql" with the template-explorer. And saved it. Restart ssms.
But if I create a new stored procedure by right-click in the object explorer and then "new -> stored procedure..." the changes are not visible. It seems ssms uses an standard-template I can't find...
If I call the template via template-explorer I can see my changes.
The template I changed is saved at C:\Users\breuerp\AppData\Roaming\Microsoft\SQL Server Management Studio\18.0\Templates\Sql\Stored Procedure.
Is there any other place? How to change the template ssms uses when clicking menu?
Google finds only instructions how to change the template - I did it like the hits described ir - or where they are saved - the place I find my template...
I'm using ssms Version 18.6 and with this infos:
SQL Server Management Studio 15.0.18338.0SQL Server
Management Objects (SMO) 16.100.41011.9 Microsoft Analysis
Services Client Tools 15.0.19205.0 Microsoft Data Access
Components (MDAC) 10.0.17763.1 Microsoft MSXML 3.0 4.0
6.0 Microsoft .NET Framework 4.0.30319.42000 Operating System 10.0.17763
The paths mention in Customise default 'New Stored Procedure' SSMS 2008 Template do not exist on my pc.
Sincerly
Peter
Looks like the templates are intended to start your own collection of starting points for frequently used scripts. Nowhere does the documentation state that it will import or include your custom templates in SSMS.
The documentation states the following (without higlights).
The first time the template explorer is opened, a copy of the templates are placed in the user's folder in C:\Users, under AppData\Roaming\Microsoft\SQL Server Management Studio\130\Templates.
Perhaps if the original location could be retrieve and the original scripts adjusted, then you might see changes in SSMS.
Create custom templates for tasks you perform frequently. Organize your custom scripts into the existing folders or create a new folder structure.
If creating a new folder structure is suggested as possible practice, but there is no option to configure the new folder path in SSMS, then there is no way for the application to find your custom templates.

Generating entity relationship diagram in Visual Studio 2015

Can you tell me how I can generate an ER diagram for my database1 (see below) created with VS 2015
Thanks in advance
Ensure you installed either Microsoft SQL Server Data Tools or Microsoft Web Developer Tools in order to get the Entity Data Model Designer.
These are the steps to generate entity relationship diagram. It was tested in VS2012
Open Visual Studio
Create a project or open an existing project
(must be Visual Basic, Visual C# project, or Console Application)
Right-click the project and choose Add -> New Item…
Under Visual C# Items select “Data”
Select the template “ADO.NET Entity Data Model”
Give it a name and click “Add”
Select “Generate from database” or “Empty model”
If “Generate from database” selected enter connection
info, choose the database objects and done!
The model is stored as a “.edmx” file.
With Visual Studio you can create a static diagram (class diagram) but not entity relationship diagrams (for you DB).
You will have to use another tool for this. For SQL server you can use SQL server Management Studio.
DB Objects in the editor will be related as in Diagram so Just relate objects in the Db and drag to editor.

LinqPad: how do I get help on a user defined assembly?

I have added a user defined assembly to query properties.
Now when using a function I don't see its documentation in Intellisense although I have specified <summary> and <remarks> tags.
Does LinqPad support this?
To view XML documentation from a custom assembly in LinqPad you need to ensure the following are in place:
You have a licensed version of LinqPad - IntelliSense is a paid for option.
Your custom assembly has an XML documentation file. To ensure this is created during your build process, open the project properties, select the Build tab and tick "XML Documentation File"

WCF - Add service reference XML docs

We have our projects set to build documentation files, but the Add Service Reference tool in Visual Studio creates files with no XML docs. This results in a ton of build warnings, which we'd like to avoid.
Is there a way to get Add Service Reference to generate XML docs? Or, if not, is there a way to modify a T4 template that generates service references?
I don't believe adding a service reference can generate the xml comments for you. See XML Comments not appearing in WCF Service for more information on that.
Your best bet is to turn the warning level down or off for the xml comment missing. In visual studio I think this will help (Visual Studio Disabling Missing XML Comment Warning).
If you are using a tool such as resharper you can ignore the entire file (http://blogs.jetbrains.com/dotnet/2011/06/preventing-items-from-being-analyzed-in-resharper/) or just ignore the xml comment warnings (How to switch off Resharper check for XML commets?).

MSBuild and BizTalk

Is it possible to specify (or override) the Deploy ApplicationName, database server, and database name for BizTalk projects? If so, how?
Unfortunately this data is stored in the btproj.user file instead of the .btproj file, and my client doesn't want to check the btproj.user files into the source control system.
(FYI - we are using BizTalk Build Generator from CodePlex.)
I've just reviewed the source on CodePlex. When I understood everything correctly they are generating
%AppName%.Custom.targets
%AppName%.Custom.properties
files. Within the properties file some properties are listed for BTS Database Connectivity
<BizTalkDatabaseServerName>.</BizTalkDatabaseServerName>
<BizTalkManagementDatabaseName>BizTalkMgmtDB</BizTalkManagementDatabaseName>
<BizTalkManagementDatabaseConnectionString>
server=$(BizTalkDatabaseServerName);
database=$(BizTalkManagementDatabaseName);
integrated security=sspi;
</BizTalkManagementDatabaseConnectionString>
<PipelineComponentsFolderPath>C:\Program Files\Microsoft BizTalk Server 2010\Pipeline Components</PipelineComponentsFolderPath>
You could easily override these Property values by using the commandline or by adding additional msbuild arguments in VS or TeamBuild using the Property switch
msbuild.exe MyBizTalkProject.proj /p:BizTalkDatabaseServerName=SqlCluster
The developer of this project should rewrite the default MSBuild.Custom.properties file to look like this
<BizTalkDatabaseServerName Condition="'$(BizTalkDatabaseServerName)'==''">.</BizTalkDatabaseServerName>
By using this approach the "." identifier (for local SQL Server) will only be used when no value for the parameter is given. Because with the current implementation the definition of the Property could! override you value passed from the command line. So be aware of that.