Upcoming in VS2017 – Script debugging

Changes to the script debugging setting coming in a future update:

https://blogs.msdn.microsoft.com/changes-to-script-debugging-in-visual-studio-15-7

Advertisements

Search an MS-SQL database for a specific named column

Need to find a column in a database? The following SQL will return the tables, and columns, that contain a wildcard value

SELECT c.name AS ColumnName,
       t.name AS TableName
FROM sys.columns c
JOIN sys.tables t
 ON c.object_id = t.object_id
WHERE c.name LIKE '%column_name%'
ORDER BY TableName,
         ColumnName;

Windows PC not auto-booting?

Since I installed the “Windows 10 Fall Creators Update”, build 16299, the desktop has stopped auto-starting, to it’s BIOS configured schedule. It’s scheduled for a 5:01am start, but every morning I’ve come into the room, since the update, it’s sitting there switched off.

A couple of Google’s later and here’s the answer, well I hope it is as I haven’t verified it yet, something for tomorrow morning. So the suggestion is to disable Windows “fast startup” mode, details on doing that can be found over at TechAdvisor.co.uk, and a more detailed explaination of why is at HowToGeek.com.

29th October 2017: Seems to have resolved the issue.

Cannot synchronise MLAT with Piaware?

Possibly an issue with Pi firmware of 4.9.x, find out your version by using this command

uname -a

If so then issue these commands, the first installs the firmware updater the second the 4.4.50 version of the firmware.

sudo apt-get install rpi-update
sudo rpi-update 52241088c1da59a359110d39c1875cda56496764

If you can’t install the firmware because you have a “custom” kernel then you’ll have to get the latest version of Raspbian and install that, then run the above two commands.

Transact SQL – (Global) script variables

Problem:

When running a SQL script using the command sqlcmd tool if you switch context to another database, by using the “use database” command, then any variables defined before this are lost. A similar thing happens if you use the “go” command to group, or batch, commands in the script.

Solution 1:

Create a temporary table, e.g

CREATE TABLE #GlobalVariables (variableOne varchar(30), variableTwo int)
INSERT INTO #GlobalVariables (variableOne, variableTwo) VALUES ('ABCdef', 222222)

Solution 2:

Use script variables

:setvar variableOne "ABCdef"
:setvar variableTwo 222222

To access these in your SQL code you would do the following:

UPDATE #GlobalVariables SET variableOne = '$(variableOne)', variableTwo = $(variableTwo)

Setting update proxy in Notepad++

Having problems setting, and retaining, the Updater Proxy in the Notepad++ UI?

Then resort to the command line. Open a cmd prompt, with administrator privileges.
At the prompt go to the Notepad++ updater directory, the following works for default installations:

cd C:\Program Files (x86)\Notepad++\updater

From here run this command:

gup -options

This brings up the same dialog as the UI but this time the values you enter will be saved.

gup-options

 

The current identity (IIS APPPOOl\xxxxxxx) does not have write access to…

If you encounter the following error then this may be the fix you’re looking for.


Server Error in ‘/’ Application.


The current identity (IIS APPPOOL\xxxxx) does not have write access to ‘C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files’.


Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: The current identity (IIS APPPOOL\xxxxx) does not have write access to ‘C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files’.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[HttpException (0x80004005): The current identity (IIS APPPOOL\xxxxx) does not have write access to ‘C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files’.]
System.Web.HttpRuntime.SetUpCodegenDirectory(CompilationSection compilationSection) +10003412
System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags, PolicyLevel policyLevel, Exception appDomainCreationException) +204

[HttpException (0x80004005): The current identity (IIS APPPOOL\xxxxx) does not have write access to ‘C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files’.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9947380
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +456

 


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1055.0


Simply run this code, from the Developer Command prompt: aspnet_regiis -i

Update 3-Jul-17:
On Windows Server 2012 you may need to run this command:

dism /online /enable-feature /featurename:IIS-ASPNET45 /all