SQL Server Express is a free edition of Microsoft's SQL Server, which is a relational database management system (RDBMS). However, remote access is not enabled by default on this SKU. To access a SQL Server Express instance from the network, we have to do a few steps. There's plenty of guide on the internet telling you how to enable remote access via GUI, but I would like to do it from PowerShell. …
My blog project, "Moonglade", is optimized for running on Microsoft Azure. It can combine up to 14 Azure services together for a full deployment, manually setup is difficult and takes time. I chose Azure CLI with PowerShell Core to write a deployment script that enables a quick on-board experience to setup Moonglade in 10 minutes with minimal Azure Services. Let's see how it is done. …
Recently, there was a demand to switch data storage from SQL Server database to Azure Storage Table. However, neither SSMS nor Azure Portal provide a direct import function. You may now consider writing a tool to import data, but actually it isn't necessary. I still managed to do it within mouse clicks. But the first thing to warn everyone is that relational databases like SQL Server are not …
We can use SSMS to export data-tier application for an SQL Server database. I've been using this method for several years on my local machine. However, to make things work under automated environments, like CI/CD environments, or some automated scheduled tasks. We usually need to do it under the command line. Microsoft has provided a cross-platform command-line tool that can import/export DAC: …
First of all, I don't recommend storing images in the database, especially in a web project. Because file systems can provide static file access and get many benefits such as performance. Storing images in the database has certain limits.
But if you must store images into SQL Server, here's how to do it.
SQL
Image files are in fact, binary data. SQL Server provides us the image type for …
上周公司有个妹子问了我一个关于SQL Server授权的问题,我没怎么玩过授权,不是很清楚。问题是这样的:如果用户A授权给用户B,用户B再授权给用户C,那么回收A的权限会不会把C的一起回收了。 我以前玩的都是在SQL Server中,给一个数据库添加Windows或者AD帐号,他们都是sysadmin角色,所以删除某个帐号并不影响别的帐号访问。这不适用于妹子的问题,所以今天我特地做了下测试。 测试内容: 用sa(SQL Server管理猿帐号)创建UserA, UserB。然后把SELECT News表的授权给UserA,再让UserA授权给UserB,最后回收UserA的权限,看看UserB还有木有权限。 首先,创建用户的脚本如下: -- Create a SQL Server login named UserA, and then creates a corresponding …