Recently I cam across an issue when making HTTP DELETE or PUT requests to API would result in “405 method not allowed” error. After a quick research it turned out to be WebDAV component’s doing in IIS. Let’s re-create this issue locally, and learn how to solve it.
I was helping one old university project and as part of user experience and SEO tweaks we decided to move away from Facebook app comments to Disqus comments. The main reason was problems with comments/replies not appearing on the website, and on top of this we wanted to boost SEO having comments that could be indexed by search engines.
Sometimes you need to find database or tables sizes to find out what is taking the most disk space in a Microsoft SQL database server. Following two queries can be very handy in such case. Result looks following.
Sometimes you need to clean and shrink SQL database, since once database grows even if all records get deleted, the database file would still take the space as before clean up. To achieve this we can manually delete records and call SHRINKFILE command. However, it’s important to delete records in small batches in transaction not to clog up the database server.
RefreshViews is simple stored procedure to refresh all database views in a Microsoft SQL database server. This is especially useful when working with legacy systems that have select * from some_view like queries in views, and needs updating after adding/removing columns.
SQL quick row count script gets row counts for all tables in a database in Microsoft SQL database servers. Result looks following.
I’ve decided to write this blog post when I came across an issue with Swashbuckle trying to validate JSON file in Swagger and was failing since Swagger’s online validator was trying to fetch JSON file from an development server which is not accessible from external networks.
Different developers have different coding styles, however when you work as a team you want to make sure everyone can quickly pick up any part of code and could get their head around in no time. For this reason, it’s great when code has unified style. This can be done manually (not recommended :)) or by using code analyzers in Visual Studio. Default set of rules check for the most common issues, however do not keep the coding style itself unified. Therefore, such tools like StyleCop Analyzers become really handy in such cases. Continue reading .NET Core projects with StyleCop Analyzers
If you used a SQL login and needed to restore a database (dev/test), you should notice that your SQL login doesn’t work for the database anymore. The reason for this is that SQL login and database user mapping was lost. Even you can see the user name in database user’s mapping, however in internal SQL memory the restored database’s user has different reference than the SQL login.
Sometimes you need to find a specific string or value in a database that you are not familiar with. You may not know where to start since a completely new database for you, or there are just way too many tables. In such cases there is a very handy stored procedure that searches for a string through all the tables.