[{"data":1,"prerenderedAt":240},["ShallowReactive",2],{"article-sql-server-profiler-trace-for-your-application":3},{"article":4,"tags":125,"previous":140,"next":201},{"id":5,"title":6,"author":7,"body":8,"createdAt":115,"description":14,"extension":116,"img":28,"meta":117,"navigation":118,"path":119,"seo":120,"stem":121,"tags":122,"updatedAt":115,"__hash__":124},"articles\u002Farticles\u002Fsql-server-profiler-trace-for-your-application.md","SQL Server Profiler - Trace for your Application","[object Object]",{"type":9,"value":10,"toc":111},"minimark",[11,15,18,33,36,46,57,60,70,73,83,103],[12,13,14],"p",{},"I want to watch the queries made by my application during development efforts.",[12,16,17],{},"Here is what I do… from SQL Server Management Studio, select SQL Server Profiler",[12,19,20],{},[21,22,24],"a",{"href":23},"\u002Farticles\u002Fimages\u002Fwindows-live-writer-cdd803dd36c3_860d-image_2.png",[25,26],"img",{"style":27,"src":28,"border":29,"alt":30,"title":30,"width":31,"height":32},"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;","\u002Farticles\u002Fimages\u002Fwindows-live-writer-cdd803dd36c3_860d-image_thumb.png",0,"image",240,147,[12,34,35],{},"Start a new trace, providing the trace name (here I entered My Trace).  Select ‘Tuning’ for the ‘Use the Template’.  The Tuning template only watches the key events from SQL (RPC:Completed, SP:StmtCompleted, SQL:BatchCompleted).  Many of the other events while important just are not important to me at this point.",[12,37,38],{},[21,39,41],{"href":40},"\u002Farticles\u002Fimages\u002Fwindows-live-writer-cdd803dd36c3_860d-image_4.png",[25,42],{"style":27,"src":43,"border":29,"alt":30,"title":30,"width":44,"height":45},"\u002Farticles\u002Fimages\u002Fwindows-live-writer-cdd803dd36c3_860d-image_thumb_1.png",326,208,[12,47,48,49],{},"Select the columns of value to you, including ApplicationName, HostName, LoginName and DatabaseName.  I also like to add columns StartTime, EndTime and RowCounts\n",[21,50,52],{"href":51},"\u002Farticles\u002Fimages\u002Fwindows-live-writer-cdd803dd36c3_860d-image_8.png",[25,53],{"style":27,"src":54,"border":29,"alt":30,"title":30,"width":55,"height":56},"\u002Farticles\u002Fimages\u002Fwindows-live-writer-cdd803dd36c3_860d-image_thumb_3.png",324,99,[12,58,59],{},"Select Column Filters.  Here we will only show the events from my Application.  The ApplicationName can be specified on your connection string and if you provide you can use here as a filter.  As shown I have provided the Like = ODOT and also I want to exclude (checkbox) all other applications but this one.  Note; You can use wildcards with the like filters i.e. % for wildcard",[12,61,62],{},[21,63,65],{"href":64},"\u002Farticles\u002Fimages\u002Fwindows-live-writer-cdd803dd36c3_860d-image_10.png",[25,66],{"style":27,"src":67,"border":29,"alt":30,"title":30,"width":68,"height":69},"\u002Farticles\u002Fimages\u002Fwindows-live-writer-cdd803dd36c3_860d-image_thumb_4.png",319,251,[12,71,72],{},"Select ‘Ok’ and execute some SQL.  You will see in the trace ONLY your sql queries from your application.  Invaluable.  I often have profiler running while I am performing unit testing in order to see the generated sql execution.",[12,74,75],{},[21,76,78],{"href":77},"\u002Farticles\u002Fimages\u002Fwindows-live-writer-cdd803dd36c3_860d-image_12.png",[25,79],{"style":27,"src":80,"border":29,"alt":30,"title":30,"width":81,"height":82},"\u002Farticles\u002Fimages\u002Fwindows-live-writer-cdd803dd36c3_860d-image_thumb_5.png",430,77,[12,84,85,86,89,90,92,93,95],{},"Above we are showing the Duration (Amount of elapsed time (in milliseconds) taken by the event.). ",[87,88],"br",{},"\n ",[87,91],{},"\nTip: when complete you can use File Save As to save the newly created profile as a Template, then when you want to re-use for another application it will be there and available (the only modification would be changing the application name variable in the filter).",[87,94],{},[21,96,98],{"href":97},"\u002Farticles\u002Fimages\u002Fwindows-live-writer-cdd803dd36c3_860d-image_6.png",[25,99],{"style":27,"src":100,"border":29,"alt":30,"title":30,"width":101,"height":102},"\u002Farticles\u002Fimages\u002Fwindows-live-writer-cdd803dd36c3_860d-image_thumb_2.png",322,205,[12,104,105,106],{},"Reference: ",[21,107,110],{"href":108,"target":109},"https:\u002F\u002Fmsdn.microsoft.com\u002Fen-us\u002Flibrary\u002Fms190176.aspx","_blank","SQL Server Profiler Templates MSDN",{"title":112,"searchDepth":113,"depth":113,"links":114},"",2,[],"2017-05-29T20:59:16.0698525Z","md",{},true,"\u002Farticles\u002Fsql-server-profiler-trace-for-your-application",{"title":6,"description":14},"articles\u002Fsql-server-profiler-trace-for-your-application",[123],"sqlserver","HTBk5k_jTh3xjo-5-NdIUQxyV-IPi6QAU0VhquYLg8g",[126],{"id":127,"title":128,"body":129,"description":133,"extension":116,"img":134,"meta":135,"name":123,"navigation":118,"path":136,"seo":137,"stem":138,"__hash__":139},"tags\u002Ftags\u002Fsqlserver.md","Sqlserver",{"type":9,"value":130,"toc":131},[],{"title":112,"searchDepth":113,"depth":113,"links":132},[],"SQL Server is a relational database management system, or RDBMS, developed and marketed by Microsoft.","https:\u002F\u002Fimages.unsplash.com\u002Fphoto-1598313183973-4effcded8d5e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=675&q=80",{},"\u002Ftags\u002Fsqlserver",{"description":133},"tags\u002Fsqlserver","pSzcNnE-XyUgq8RlgK2xBpbJV7_7o5NLS2XlwBxFyAg",{"id":141,"title":142,"author":7,"body":143,"createdAt":192,"description":193,"extension":116,"img":189,"meta":194,"navigation":118,"path":195,"seo":196,"stem":197,"tags":198,"updatedAt":192,"__hash__":200},"articles\u002Farticles\u002Ftfs-build-2015-not-transforming-web-config.md","TFS Build 2015 Not Transforming Web.Config",{"type":9,"value":144,"toc":190},[145,148,151],[12,146,147],{},"The following is the solution that addressed this problem. While setting up a project for TFS build, I came across issues with the build system not transforming my web.config to different configurations. i.e. I want my web.config to be transformed with web.config.release upon build\u002Fpublish. I found the following solution that worked for me.",[12,149,150],{},"Within Visual Studio, unload the web project (in this case I am working with a web application), scroll to the bottom and add the following task. On the build server you can ensure that the path is valid and it is referencing the most appropriate version. The UsingTask imports the TransformXml method from Microsoft.Web.Publishing.Tasks.dll",[152,153,156,167,168,180,181],"using-task",{"taskname":154,"assemblyfile":155},"TransformXml","$(MSBuildExtensionsPath)\\Microsoft\\VisualStudio\\v14.0\\Web\\Microsoft.Web.Publishing.Tasks.dll",[157,158,161],"target",{"name":159,"condition":160},"ApplyTransform","Exists('Web.$(Configuration).config')",[162,163],"transform-xml",{"source":164,"transform":165,"destination":166},"web.config","Web.$(Configuration).config","Web.config"," \nThen within the BeforeBuild Target add ",[157,169,171,172],{"name":170},"BeforeBuild"," \n",[173,174,176,177],"exec",{"command":175},"attrib -r Web.config"," ",[178,179],"calltarget",{"targets":159},"   Exec removes the read-only attribute from the web.config file and the CallTarget will ApplyTransform target \n",[21,182,185],{"style":183,"href":184},"display: none;width:65%","\u002Farticles\u002Fimages\u002Fopen-live-writer-7e779723aa75_11131-tfs2_2.png",[25,186],{"title":187,"style":188,"border":29,"alt":187,"src":189},"tfs2","border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px","\u002Farticles\u002Fimages\u002Fopen-live-writer-7e779723aa75_11131-tfs2_thumb.png",{"title":112,"searchDepth":113,"depth":113,"links":191},[],"2017-05-29T20:59:16.1568524Z",null,{},"\u002Farticles\u002Ftfs-build-2015-not-transforming-web-config",{"title":142,"description":193},"articles\u002Ftfs-build-2015-not-transforming-web-config",[199],"teamfoundationserver","lOC0JMfw8ZGxSAnqXj8dgfW8SGFqPE_xBIFss2cj8pg",{"id":202,"title":203,"author":7,"body":204,"createdAt":230,"description":231,"extension":116,"img":232,"meta":233,"navigation":118,"path":234,"seo":235,"stem":236,"tags":237,"updatedAt":230,"__hash__":239},"articles\u002Farticles\u002Fsql-server-2008-installation-ndash-not-so-quick.md","SQL Server 2008 Installation, not so quick",{"type":9,"value":205,"toc":228},[206,214,217,225],[12,207,208,209,213],{},"Before you rush to download SQL 2008 you may want to read the following KB article which warns that Visual Studio 2008 SP1 ‘may be required’ for SQL Server 2008 installations KB956139 (found ",[21,210,212],{"href":211,"target":109},"http:\u002F\u002Fsupport.microsoft.com\u002Fkb\u002F956139","here",")",[12,215,216],{},"”Because certain SQL Server 2008 features install components that are also part of the release version of Visual Studio 2008 SP1, SQL Server 2008 requires Visual Studio 2008 with SP1. If Visual Studio 2008 without a service pack is installed instead, it may not work correctly after you install SQL Server 2008.“",[12,218,219,220,224],{},"Currently, ",[21,221,223],{"href":222,"target":109},"http:\u002F\u002Fmsdn.microsoft.com\u002Fen-us\u002Fvstudio\u002Fcc533448.aspx","Visual Studio 2008 Service Pack 1"," (SP1) is in beta at the current time.",[12,226,227],{},"I do not know the expected delivery of SP1 but should be soon (hang tight).",{"title":112,"searchDepth":113,"depth":113,"links":229},[],"2017-05-29T20:59:15.8643544Z","Before you rush to download SQL 2008 you may want to read the following KB article contained within this blog.","\u002Farticles\u002Fimages\u002Fl2oWZnThPG.png",{},"\u002Farticles\u002Fsql-server-2008-installation-ndash-not-so-quick",{"title":203,"description":231},"articles\u002Fsql-server-2008-installation-ndash-not-so-quick",[123,238],"sql","uUgrYz6hVSOWfcqo-ApYDrtjGpXT3uL0jd9PBGOi3E8",1781574767983]