如何在SQL Server中创建用户特定的数据库 [英] How to create a User Specific Database In SQL Server

查看:112
本文介绍了如何在SQL Server中创建用户特定的数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在SQL服务器中有数据库,我可以连接到Web应用程序使用它,但我希望这个Web应用程序为SQL服务器上的每个用户创建此数据库的副本,以便每个用户都有自己的数据库。 此图片显示了我想说的内容。

问题我将不得不在Web应用程序中发送命令到SQL Server为用户创建数据库,否则我将不得不在SQL Server端编码?

提前谢谢

I have database in SQL server, I can connect to web app to use it, but I want this web app to create a copy of this database for each user on SQL server so that each user will have his own database. This Pic shows what I want to say.
Question is that will I have to work in web app to send command to SQL Server to create database for user or I will have to code on SQL Server side?
Thanks in advance

推荐答案

我建​​议您,当新的商店经理注册时,从您的网络应用程序运行DB脚本。



1。连接到主数据库并运行创建数据库查询。

2.连接到刚刚创建的数据库并执行所有其他脚本(创建数据库,创建表,创建视图,创建过程,创建函数等)

3.在您的网络应用程序中使用数据库,如您所愿.......



如果有帮助,请标记为答案.. ..
I would suggest you, when a new store manager signs up, run the DB Scripts from your web application.

1. connect to master db and run create database query.
2. connect to database just created and execute all other scripts(create db, create tables, create view, create procedure, create function, etc.)
3. use the database in your web application, as you like.......

Mark as answer if helpful....


(我无法查看该图片。)





创建一个每个用户的这个数据库的副本



那个d听起来不是一个好主意。你究竟想要完成什么?
(I can't view that image.)


"create a copy of this database for each user"

That doesn't sound like a very good idea. What are you actually trying to accomplish?


这篇关于如何在SQL Server中创建用户特定的数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆