473,662 Members | 2,524 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Linking Windows SQL Login to user database

Hi,

I am migrating SQL 2000 database from one machine to another using the
detach/attach method. I used the TSQL
script sp_help_revlogi n procedure provided by microsoft to copy the
logins, this work for SQL Logins but not Window
Login.

I am able to logon to the SQL Server with the Window Login but have no
access to databases that I have right to
access. The Window Login name appears under the database's User node
but the value under the 'login name' is empty. So to relink it, I
change the database system table sysusers sid to match the Window
Login sid, this works but is there a better way to do this?
Is there a way to create Window Login with a specific security id
similar to how the SQL Login are create in sp_help_revlogi n, cause I
am aware that SQL 2005 doesn't allow you to change system tables so
this way of doing it isn't very robust.

Thanks
Aug 1 '08 #1
1 3665
(th*****@gmail. com) writes:
I am migrating SQL 2000 database from one machine to another using the
detach/attach method. I used the TSQL
script sp_help_revlogi n procedure provided by microsoft to copy the
logins, this work for SQL Logins but not Window
Login.

I am able to logon to the SQL Server with the Window Login but have no
access to databases that I have right to
access. The Window Login name appears under the database's User node
but the value under the 'login name' is empty. So to relink it, I
change the database system table sysusers sid to match the Window
Login sid, this works but is there a better way to do this?
Is there a way to create Window Login with a specific security id
similar to how the SQL Login are create in sp_help_revlogi n, cause I
am aware that SQL 2005 doesn't allow you to change system tables so
this way of doing it isn't very robust.
SELECT 'EXEC sp_grantlogin ''' + name + ''''
FROM master.sys.sysl ogins
WHERE isntname = 1 OR isntgroup = 1

You should not have to play with sids for Windows logins, as they
should be the same on both servers.
--
Erland Sommarskog, SQL Server MVP, es****@sommarsk og.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Aug 1 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
9442
by: tbone | last post by:
We were using sql authentication on our sql server 2000 servers, But need to use windows authentication. I have an sql user jdoe that owns many different objects in multiple databases. I have tried adding the windows login of jdoe with the exact same permissions as the sql user jdoe, but it complains because it says jdoe already exists. So I attempt to delete the sql user of jdoe (remembering the permissions so I can reapply them to...
2
1561
by: wschlichtman | last post by:
In my Windows application, I am attempting to access an SQL database called PhotoAlbum.mdf. I keep receiving the following error: Cannot open database "PhotoAlbum" requested by the login. The login failed. Login failed for user 'William\Will'. Here is my connection string: "data source=.\\SQLEXPRESS;initial catalog=PhotoAlbum;" + "integrated security=SSPI;persist security info=False;" +
2
2522
by: Amedee Van Gasse | last post by:
Hello, Since it is the first time I'm posting in these groups, I believe a (short) introduction of myself would not be a bad thing. I am mainly a support engineer, not a programmer. I do have some experience with Java and LAMP (Linux/Apache/MySQL/PHP) but don't consider me one of those boring OS advocates please. ;-) I also have done a little bit with Visual Basic (and GwBasic in a long forgotten past) and nowadays my job involves...
8
3424
by: Nils Magnus Englund | last post by:
Hello, I am having trouble using Integrated Windows Authentication between our intranet server and our database server, both of which are on our local domain. Windows authentication works for our intranet server - my domain user "DOM\nme" is correctly authenticated and authorized to view the ASP.NET page on our intranet. The ASP.NET application uses impersonation (<identity impersonate="true"> in Web.config).
0
1115
by: AAJ | last post by:
Hi all I am a relatively experiences Windows/SQL Server database programmes and have just started on my first ever web app. I have managed with most of the simple stuff i.e. datagrids, crystal etc, but I am finding the security model confusing (actually I'm a bit confused over the event model and postbacks as well, but that's a different story). Anyway, my first app is to run on our Intranet and the users are (possibly)
4
2344
by: Preben Zacho | last post by:
Hi there The scenario I got is this: I have created a Windows application in VS and I want to deploy it to another machine running Windows Vista. Since I have no control over this other machine, I've set it up to run SQL Authentication and I have added a new user called "MyUser" and applied a password. This user/password is used in my connection string whick looks like this: Server=.\SQLEXPRESS;Database=MyDB;User...
30
6959
by: diane | last post by:
I've got an application running with table-based security: i capture the user's windows login with fOsusername, then have them enter a password checked against their username/login in my own table. The problem is, they can't remember the passwords they've created, and I spend more time than I want to resetting. Here's what I'd LIKE to have happen: when the user opens the application (Access2k), a dialog box appears with the windows...
7
2857
by: coolsti | last post by:
I have the task to set up an application at work,using MS Access as a front end to a MySQL database. This will be done using an appropriate ODBC driver, and linking the MySQL database to Access. My question is whether it is possible to set something up so that when linking to the MySQL database, the user name which is used for the MySQL connection is taken as the user's Windows ID. If so, then I can set up users and access grants in MySQL...
0
8432
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8344
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8857
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8546
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8633
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7367
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5654
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4180
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1752
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.