How to get logs into the Tool Log in Release Management for Visual Studio - ms-release-management

In the Release Management for Visual Studio Deployment log, which can be found under the Details button found when viewing the details of a release, there are a number of columns.
The last three of these are Tool Log, Command Output and Status.
I have never seen anything in Tool Log, but I am in the situation now where I have a component running tests using vstest.console.exe.
Under "Command Output", I see the output from this program as it appears in the console window. However, vstest.console.exe can also be instructed to create a test log (a .trx file), which I would like to view under Tool Log. But I have no idea how to make this happen.
How do I get a log to appear under the Tool Log column?

The answer, it seems, is to set the "Log File Name" in the Tool definition to whatever log file you wish to view (in my case, the .trx file).
This obviously requires that you are using a tool that defines this, or a custom one. Fortunately, I'm using a custom tool.

Your Tool have to copy/create the .trx file to/in the Tool's work directory (%LOCALAPPDATA%\Temp\RM\T\RM\\).
Don't forget to add .trx extesion to Administration -> Settings -> Approved File Extension List.

Related

Open multiple copies of same file in SSMS

We have a script file called CreateClientDatabase.SQL, double clicking it opens it in SSMS where we can change a few parameters and execute it.
Problem:
A few hours/days later we may need to do the same again for another client, but if the original tab in SSMS has not been closed then double clicking the file will simply bring that tab to the fore and not actually open the file.
So it's easy to assume the script you are now looking at is the same as the file when it is not, and this can lead to all sorts of issues.
Is there a way round this?
Can SSMS open a second copy of the file, or warn the user that it hasn't actually opened it much like Excel does.
What you need, I think, is something similar to excel or word template files: whenever you open such file by double-click, a new document with the contents of the template is created.
SSMSBoost add-in (that I develop) has “Autoreplacements” feature: you can define a “magic token”, that will be replaced by your script, whenever that token is typed. For example, we have pre-defined token “sel”, which is replaced by “select * from” whenever you type “sel” and press space.
You could associate your script with any word, like “doit”, so whenever you visit next customer, you just open new query window, type that word+space and you have your script in the window immediately.
Just to mention: SSMSBoost allows you to define “favorite” connections, so, you can save all your cutomer’s servers in one list and quickly switch between them.
Alternative:
Have a look at SSMS Templates (View->Template explorer). SSMS allows creating your own templates and opening them by double-clicking their name from Template Explorer. In connection with SSMSBoost “Preferred connections” list you have a good setup to start your work quickly.
Hope this helps.
If file is opened from the windows explorer then it opens another instance of SSMS.
I think what you need is to detect when the SQL script file is changed outside if the SSMS environment:
make sure that Tools -> Options -> Environment -> Documents -> Detect when file is changed outside the environment is checked.
More details can be found here.

SQL Server Database Project dbml file is always modified [duplicate]

I'm running into a small but weird annoyance that seems to be happening to other people, too (for example, check out the revision history of SEDE). I have a SQL Server 2008 database project in Visual Studio 2010 that works properly. When I go to commit/checkin to source control, I'm told that my DB project's .dbmdl file has changed, even when I've made no changes to the project!
I'm not sure if the changes are triggered by building my solution (which also includes an ASP.NET MVC application and a unit test project) or by simply opening the DB project, but this is getting kind of annoying and is creating clutter in source control.
Is it possible to stop these changes from occurring, or get rid of the .dbmdl file whatsoever?
If you delete the .dbml file, it is rebuilt without errors or warnings, so I think it's just a cache file for references, intellisense, etc. I'm going to exclude it from source control.
I believe Visual Studio serializes the dbmdl file every time the project is opened. The only possible work around would be to keep the project open.
See related question here. The .dbmdl file is unique per user (and some kind of cache, as said above) and so the right solution is indeed to exclude it from source control.

Installing SQL Server Express 2014 with Wix Burn

I'm trying to run an unattended install of SQL Server Express 2014 in a burn package chain and I keep running into problems so I'm looking for advice.
Right now I'm installing it by running the self extracting SQLEXPR_x64_ENU.exe with switches but there are two problems with this method the first being that the extract window doesn't appear in front of my custom bootstrapper UI and second that I have no way to specify the default extraction directory. There is the /X:"C:/Temp" switch but if I use this then the main Setup.exe isn't run upon extract completion.
I tried to resolve this problem by extracting it and including all the required files as a payload group. This works but the compile time and install time are unacceptably slow due to all the small files it has to extract and verify.
I also tried simply referencing the Setup.exe in the extracted folder and left it uncompressed as to have the files in a sub-directory in the root of the installer directory but this to was giving me some startup problems.
I've contemplated installing it with scripts but I feel this is an ugly approach to the problem and I'm avoiding it like the plague but I realize it's possible.
I'd be interested to hear how others have handled this and any advice would be greatly appreciated.
We have worked around this issue using our managed bootstrapper application as follows.
Sql Server 2014 Express SP1 resolved the issue they were having with /qs switch. We can use /qs with /x to specify the extract folder, and extraction proceeds with no user input.
However, as you noted, this just extracts the files, and doesn't start setup.exe. The good news is that the extracted files are still in the folder specified with the /x switch.
In our managed bootstrapper application, we handle the ExecutePackageComplete event. When the Sql Server package has completed (all it did was extract files), we use System.Diagnostics.Process.Start to run the Sql Server setup.exe.
When Setup completes we delete the extract folder.
This isn't what we thought we would do when we started, but at least it's working.
More Information:
As you also mentioned, the progress window for the extracting process opens behind the bootstrapper application window.
I'm not sure what in the bootstrapper is bringing the bootstrapper window back on top. Our UI has a progress bar, so perhaps a progress event is firing after the extracter has started.
We used a timer to give the bootstrapper time to process any events, then we enumerate Process.GetProcesses and look for ProcessName containing "extracting sql". When we find it we use SetWindowPos to bring it to the front.

Log to text file - items in Progress Tab of SSIS Package

In SSIS, i need to write into a log, whatever items get displayed on the Progress tab. Is there an inbuilt feature to do this? i tried the logging option but it logs too many details and the log is pretty huge for a single package run.
i need only whatever gets logged on the Progress tab to be logged on to a text file when the package undergoes a scheduled run through Sql server agent
Here is a possible solution.
You have an option at DTEXEC at the command-line. There is a switch called /Reporting or /Rep for short.
I found it here
This link says the same.
This is your question in MSDN. Its pretty useless since they suggest you turn on logging, which you've already done. I thought I should add it anyways for completeness.

code template in management studio

Can I find in management studio the Following feature?
I want to write a specific word and that it be replaced by a statement specifies. Ex: I write "ss" and replace "select * from" or write "johnid" and is replaced by "where id = '555 '"
 
In Toad for Oracle You might still in: "option - behsvior - template code - code template"
http://www.toadworld.com/Blogs/tabid/67/EntryId/343/Customizing-Toad-Code-Templates.aspx
There is nothing I know of built into Management Studio that will behave exactly like you are suggesting. There are some shortcuts you can advantage of in Tools > Options > Environment > Keyboard > Query Shortcuts, but these run the code rather than paste them into your window, so you can't use them as partial syntax completion. For example if you assign SELECT * FROM to Ctrl+9, then open a new query window and press Ctrl+9, you have an empty query window and the following error message:
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near 'FROM'.
Chris already mentioned templates, so I won't treat those.
In SQL Server 2012 you can use a new feature (well, an old feature recycled from Visual Studio) called Snippets, which I think is a lot more powerful than the Template feature (I wrote about them here, and someone else did a decent job here). But I still don't think it's quite what you're after - there's a menu system to go through to insert a snippet, and so far in my research I've been unable to assign a keyboard shortcut -- even though there is an empty element in the Snippet XML called <Shortcut></Shortcut>, and most of the people who talk about this feature mention it, but I've yet to see a working snippet that used it (and I have tried many variations to get it work like it does in Visual Studio with no luck).
You can also use 3rd party tools, such as Mladen Prajdic's free SSMS Tools Pack. For what you want to do, I think this is the best fit, since it allows you to do real expansions snippets where the replacement text is put into your code based on the keyword you typed ad further keystrokes. However if you're using SQL Server 2012, at the time of posting we're still waiting on a compatible release for that version of SSMS. You may also want to look into Red-Gate's SQL Prompt, but I'd try Mladen's free tool first if you can. I'm sure there are other alternatives you can turn up with a standard search.
This feature is present in these free add-ins:
SSMSBoost or SSMS Tools Pack
Use Template Explorer
SQL Server provides a variety of templates. Templates are boilerplate files containing SQL scripts that help you create objects in a database. 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\110\Templates.
You can browse the available templates in Template Explorer, then open a template to incorporate the code into a code editor window. You can also create custom templates.

Resources