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 …