Skip to main content

Posts

Showing posts from August, 2022

MS SQL - How to find all tables in a database by a column name

Sometimes you might need to find all your MS SQL database tables by a column name.  This could be because you might want to investigate a database error and here is how you can do it - all credit goes to AdaTheDev on StackOverflow ; Error SQL Script to Find All Tables by a Column Name --Search Tables SELECT       COLUMN_NAME AS 'ColumnName'             , TABLE_NAME AS   'TableName' FROM         INFORMATION_SCHEMA . COLUMNS WHERE        COLUMN_NAME LIKE '%preventCleanup%' ORDER BY     TableName             , ColumnName ;     --Search Tables and Views 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 '%preventCleanup%' ORDER BY     TableName             , ColumnName ; Final Result

How to fix "Umbraco cannot start. A connection string is configured but the Umbraco cannot connect to the database." error on local dev website

Recently I have started working on a Umbraco v7 website and as a first step, I wanted to create a local database by restoring it from a backup file, and after creating the DB and create a new Login for the Umbraco v7 database, I started to see the following problem; After doing some investigation, I realised that other people had a similar problem with their Umbraco V7 local websites. After trying some of the suggestions, I ended up doing some more investigation and came up with the following solution; Right-click on your localhost and select Properties Go to the Security page and select "Server authentication" as "SQL Server and Windows Authentication mode" Hit OK. Go to Services and find your SQL Server service and restart it. You should be able to see your website now. If you still have problems, check your local setup and permissions.  Further details are below, hope this helps somebody else.