Change Text in Stored Procedure on Microsoft SQL Server

Microsoft SQL ServerI did some work for a client recently creating a script which they could run after copying their live Microsoft Dynamics GP system to a development server. This script did a variety of tasks, one of which was to change the folder location to which Post Master Enterprise was exporting a generated SSRS report as a PDF; this path was embedded within a stored procedure.

I’ve previously written a SQL script which updated SQL views. I was able to use that script as the basis for this one which replaces text within a specific stored procedure.

The first highlighted section is the path on the live server, the second the path on the dev server and the third is the name of the stored procedure to be updated:

/*
Created by Ian Grieve of azurecurve | Ramblings of an IT Professional (http://www.azurecurve.co.uk) This code is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0 Int). */
DECLARE @SprocDefinition AS NVARCHAR(max) SELECT @SprocDefinition = REPLACE( REPLACE(['SQL Modules'].definition, 'CREATE PROC', 'ALTER PROC') ,'\\SQL01\Dynamics Central\CompanyA\Invoices\','\\SQL02\Dynamics Central\CompanyA\Invoices\') FROM sys.all_objects AS ['All Objects'] LEFT JOIN sys.sql_modules AS ['SQL Modules'] ON ['SQL Modules'].object_id = ['All Objects'].object_id WHERE ['All Objects'].name = 'zDP_ESS80000_PostSSRS' EXEC (@SprocDefinition) GO

Adventures With A Raspberry Pi: Check Version of OS on Raspberry Pi

Raspberry PiThis post is part of the Adventures with a Raspberry Pi series.

When I was researching upgrading the Raspberry Pi, the consensus seemed to be that the OS should be upgraded one version at a time. This means that to do the upgrade, you need to know the exact version of the OS you’re using.

There is a command you can run on the Raspberry Pi which will return details of the OS:

cat /etc/os-release

As the screenshot below shows, there is a number of pieces of information returned; in terms of the OS the important line is the VERSION one:

Data on the installed OS

Adventures With A Raspberry Pi

Adventures With A Raspberry Pi
Building The Raspberry Pi: CanaKit Raspberry Pi 3 B+ Complete Starter Kit
Building The Raspberry Pi: Raspberry Pi Build
Building The Raspberry Pi: Install Operating System
Building The Raspberry Pi: First Run
Building The Raspberry Pi: System Configuration Tool
Building The Raspberry Pi: Enable SSH For Remote Access
Building The Raspberry Pi: Securing the Raspberry Pi
Building The Raspberry Pi: Conclusion
Installing Pi-hole On A Raspberry Pi: What is Pi-hole?
Installing Pi-hole On A Raspberry Pi: Install Pi-hole
Installing Pi-hole On A Raspberry Pi: Change Pi-hole Admin Password
Installing Pi-hole On A Raspberry Pi: Configure Network to use Pi-hole
Using Pi-hole On A Raspberry Pi: Blocked Adverts
Using Pi-hole On A Raspberry Pi: Admin Interface
Using Pi-hole On A Raspberry Pi: Disabling Pi-hole
Using Pi-hole On A Raspberry Pi: Whitelisting a Site
Using Pi-hole On A Raspberry Pi: Update Blocklists
Using Pi-hole On A Raspberry Pi: Maintain Blocklists
Using Pi-hole On A Raspberry Pi: Change DNS Servers
Using Pi-hole On A Raspberry Pi: Connecting With SSH
Using Pi-hole On A Raspberry Pi: Updating the Pi-hole
Using Pi-hole On A Raspberry Pi: Conclusion
What Else Can I Use It For?
Prepare New SD Card For Raspberry Pi OS: Download SD Card Formatter
Prepare New SD Card For Raspberry Pi OS: Install SD Card Formatter
Prepare New SD Card For Raspberry Pi OS: Format SD Card
Prepare New SD Card For Raspberry Pi OS: Download NOOBS
Prepare New SD Card For Raspberry Pi OS: Copy Files To The SD Card
Prepare New SD Card For Raspberry Pi OS: Conclusion
Installing Pi-hole On A Raspberry Pi: Changing the IP Address
Raspberry PI Update Fails
Check Version of OS on Raspberry Pi
How to Update the OS on a Raspberry Pi

Adventures With A Raspberry Pi: Raspberry PI Update Fails

Raspberry PiThis post is part of the Adventures with a Raspberry Pi series. I always intended for this to be a long running series, but it’s been quite a while since I did anything with the Pi. I bought one initially to use as a Pi-hole which I have been using ever since although this usually just goes as far as applying updates or whitelisting a site.

There was recently a pending update which I tried to apply, but the update failed saying that an unsupported OS was detected:

Unsupported OS detected

Continue reading “Adventures With A Raspberry Pi: Raspberry PI Update Fails”