Hi
I want to programatically attach a DB to an instance of MSDE, and then
create the user, and give permissions to the DB I've just attached.
I can successfully attach the DB, but cannot get the permissions correct
Which sequence of T-SQL commands should I be calling to:
a). create the login in the instance of MSDE
b). associate the login with the newly attached DB
I have played around with:
sp_attach_single_file_db
sp_addlogin
sp_grantdbaccess
sp_grantlogin
but I cannot get a successful logon with the new account, even though the
T-SQL commands run successfully.
Thanks
Hi Paul,
Is there any chance the users already exist in the database you're
attaching? If so, you get into a weird situation because you have users with
the same name but different SID's. If you download a copy of MSDE Manager
from our site (free for personal use), it's got a menu option that lets you
list and fix security ID problems. Might well help.
To avoid these, we normally create the users on the target system by
supplying the sid parameter.
HTH,
Greg Low [MVP]
MSDE Manager SQL Tools
www.whitebearconsulting.com
"Paul Aspinall" <paul@.aspy.co.uk> wrote in message
news:m%IUd.241292$K7.73273@.fe2.news.blueyonder.co. uk...
> Hi
> I want to programatically attach a DB to an instance of MSDE, and then
> create the user, and give permissions to the DB I've just attached.
> I can successfully attach the DB, but cannot get the permissions correct
> Which sequence of T-SQL commands should I be calling to:
> a). create the login in the instance of MSDE
> b). associate the login with the newly attached DB
> I have played around with:
> sp_attach_single_file_db
> sp_addlogin
> sp_grantdbaccess
> sp_grantlogin
> but I cannot get a successful logon with the new account, even though the
> T-SQL commands run successfully.
> Thanks
>
>
|||Hi Greg,
I was reading Paul message and experienced the same problems setting up MSDE.
I installed the MSDE on a machine i was using for the server.
Used (local)netSDK for instance as in the documentation .
Then I accessed the database NorthWind using the SQLClient.
The samples in VB.net now work ok when ran from the server where I installed
MSDE.
However, I then got very bold, and tried to access the NorthWind database
from another computer that was setup on our network.
I added a login name, added a role and a member, granted premission.
Then in the vb.net program I tried to open the database with the same code
from the program on the server. I did change the server name to the Name of
the computer that MSDE was installed on. I also tried the IP address as the
server.
I kept getting the error "Server not found or do not have premission.
WHAT AM I DOING WRONG?
Best regards,
Dave
"Greg Low [MVP]" wrote:
> Hi Paul,
> Is there any chance the users already exist in the database you're
> attaching? If so, you get into a weird situation because you have users with
> the same name but different SID's. If you download a copy of MSDE Manager
> from our site (free for personal use), it's got a menu option that lets you
> list and fix security ID problems. Might well help.
> To avoid these, we normally create the users on the target system by
> supplying the sid parameter.
> HTH,
> --
> Greg Low [MVP]
> MSDE Manager SQL Tools
> www.whitebearconsulting.com
> "Paul Aspinall" <paul@.aspy.co.uk> wrote in message
> news:m%IUd.241292$K7.73273@.fe2.news.blueyonder.co. uk...
>
>
Showing posts with label attached. Show all posts
Showing posts with label attached. Show all posts
Thursday, March 22, 2012
Adding users
Sunday, February 19, 2012
Adding drive dependencies to WIN2k/SQL2k cluster resource
I need to add two additional SAN attached volumes to be dependencies
for my SQL Server Cluster resource. Do I have to restart the cluster
service for this to take affect? Is there another way for the cluster
resource to re initialize it's dependencies without restarting?
If you want to create databases on these drives, you need to add them to the
SQL Server resource dependency list. To do that, you don't need to restart
the cluster service. But you do need to take the SQL Server resource offline,
add the drives as the dependencies, and then bring the SQL Server resource
online.
Linchi
"zoneranger@.gmail.com" wrote:
> I need to add two additional SAN attached volumes to be dependencies
> for my SQL Server Cluster resource. Do I have to restart the cluster
> service for this to take affect? Is there another way for the cluster
> resource to re initialize it's dependencies without restarting?
>
for my SQL Server Cluster resource. Do I have to restart the cluster
service for this to take affect? Is there another way for the cluster
resource to re initialize it's dependencies without restarting?
If you want to create databases on these drives, you need to add them to the
SQL Server resource dependency list. To do that, you don't need to restart
the cluster service. But you do need to take the SQL Server resource offline,
add the drives as the dependencies, and then bring the SQL Server resource
online.
Linchi
"zoneranger@.gmail.com" wrote:
> I need to add two additional SAN attached volumes to be dependencies
> for my SQL Server Cluster resource. Do I have to restart the cluster
> service for this to take affect? Is there another way for the cluster
> resource to re initialize it's dependencies without restarting?
>
Labels:
adding,
additional,
attached,
cluster,
clusterservice,
database,
dependencies,
dependenciesfor,
drive,
microsoft,
mysql,
oracle,
resource,
restart,
san,
server,
sql,
sql2k,
volumes,
win2k
Subscribe to:
Posts (Atom)