Hello,
Is there any way to get a list of NT logins (not just SQL logins) ?
I have a form that adds logins to a database. Since user's don't have access to create logins, we have a stored
procedure that does this as a job. I want to be able to check if a username is a valid NT login before allowing
the user to add it to the "add" table. Otherwise, a user would have to wait a day to find out that the they account
didn't get added since they misspelled the login.
Thanks in advance, and forgive my spam scramble in my email name. Web crawlers have been my bane.
Hi
My preference is to grant a login to an NT group and then add the NT user to
that group. Then there is no misspelling and it can be done by the system
admin rather than the DBA!
John
"ChuckRoddy" <CUTHERESPAMTRAP_seresrj@.upmc.edu> wrote in message
news:1210DFA5-3668-418F-AA74-362280135B32@.microsoft.com...
> Hello,
> Is there any way to get a list of NT logins (not just SQL logins) ?
> I have a form that adds logins to a database. Since user's don't have
access to create logins, we have a stored
> procedure that does this as a job. I want to be able to check if a
username is a valid NT login before allowing
> the user to add it to the "add" table. Otherwise, a user would have to
wait a day to find out that the they account
> didn't get added since they misspelled the login.
>
> Thanks in advance, and forgive my spam scramble in my email name. Web
crawlers have been my bane.
>
|||Thanks for the reply.
Actually, neither the DBA or the sys admin would be involved. Researchers will be granting their work studies access through a web based interface, and the entire hospital will be using this. We'll need to save our sys admins for network problems. I'm jus
t trying to find a way to validate an NT name
so we can get around problems caused by simple username misspellings.
|||Hi
If the login does not exist then then sp_grantlogin will fail. If you really
want to allow people to see all the usernames on the domain then you should
also consider the security aspects of doing that. You may want to try the
NET GROUP command to see members of a specific domain group, it would then
be possible to restrict what is seen.
John
"ChuckRoddy" <anonymous@.discussions.microsoft.com> wrote in message
news:FE3EEB2B-2D18-44BF-8059-BE6286DFC907@.microsoft.com...
> Thanks for the reply.
> Actually, neither the DBA or the sys admin would be involved. Researchers
will be granting their work studies access through a web based interface,
and the entire hospital will be using this. We'll need to save our sys
admins for network problems. I'm just trying to find a way to validate an NT
name
> so we can get around problems caused by simple username misspellings.
Showing posts with label adds. Show all posts
Showing posts with label adds. Show all posts
Friday, March 9, 2012
Getting NT users
Hello,
Is there any way to get a list of NT logins (not just SQL logins) ?
I have a form that adds logins to a database. Since user's don't have access
to create logins, we have a stored
procedure that does this as a job. I want to be able to check if a username
is a valid NT login before allowing
the user to add it to the "add" table. Otherwise, a user would have to wait
a day to find out that the they account
didn't get added since they misspelled the login.
Thanks in advance, and forgive my spam scramble in my email name. Web crawle
rs have been my bane.Hi
My preference is to grant a login to an NT group and then add the NT user to
that group. Then there is no misspelling and it can be done by the system
admin rather than the DBA!
John
"ChuckRoddy" <CUTHERESPAMTRAP_seresrj@.upmc.edu> wrote in message
news:1210DFA5-3668-418F-AA74-362280135B32@.microsoft.com...
> Hello,
> Is there any way to get a list of NT logins (not just SQL logins) ?
> I have a form that adds logins to a database. Since user's don't have
access to create logins, we have a stored
> procedure that does this as a job. I want to be able to check if a
username is a valid NT login before allowing
> the user to add it to the "add" table. Otherwise, a user would have to
wait a day to find out that the they account
> didn't get added since they misspelled the login.
>
> Thanks in advance, and forgive my spam scramble in my email name. Web
crawlers have been my bane.
>|||Thanks for the reply.
Actually, neither the DBA or the sys admin would be involved. Researchers wi
ll be granting their work studies access through a web based interface, and
the entire hospital will be using this. We'll need to save our sys admins fo
r network problems. I'm jus
t trying to find a way to validate an NT name
so we can get around problems caused by simple username misspellings.|||Hi
If the login does not exist then then sp_grantlogin will fail. If you really
want to allow people to see all the usernames on the domain then you should
also consider the security aspects of doing that. You may want to try the
NET GROUP command to see members of a specific domain group, it would then
be possible to restrict what is seen.
John
"ChuckRoddy" <anonymous@.discussions.microsoft.com> wrote in message
news:FE3EEB2B-2D18-44BF-8059-BE6286DFC907@.microsoft.com...
> Thanks for the reply.
> Actually, neither the DBA or the sys admin would be involved. Researchers
will be granting their work studies access through a web based interface,
and the entire hospital will be using this. We'll need to save our sys
admins for network problems. I'm just trying to find a way to validate an NT
name
> so we can get around problems caused by simple username misspellings.
Is there any way to get a list of NT logins (not just SQL logins) ?
I have a form that adds logins to a database. Since user's don't have access
to create logins, we have a stored
procedure that does this as a job. I want to be able to check if a username
is a valid NT login before allowing
the user to add it to the "add" table. Otherwise, a user would have to wait
a day to find out that the they account
didn't get added since they misspelled the login.
Thanks in advance, and forgive my spam scramble in my email name. Web crawle
rs have been my bane.Hi
My preference is to grant a login to an NT group and then add the NT user to
that group. Then there is no misspelling and it can be done by the system
admin rather than the DBA!
John
"ChuckRoddy" <CUTHERESPAMTRAP_seresrj@.upmc.edu> wrote in message
news:1210DFA5-3668-418F-AA74-362280135B32@.microsoft.com...
> Hello,
> Is there any way to get a list of NT logins (not just SQL logins) ?
> I have a form that adds logins to a database. Since user's don't have
access to create logins, we have a stored
> procedure that does this as a job. I want to be able to check if a
username is a valid NT login before allowing
> the user to add it to the "add" table. Otherwise, a user would have to
wait a day to find out that the they account
> didn't get added since they misspelled the login.
>
> Thanks in advance, and forgive my spam scramble in my email name. Web
crawlers have been my bane.
>|||Thanks for the reply.
Actually, neither the DBA or the sys admin would be involved. Researchers wi
ll be granting their work studies access through a web based interface, and
the entire hospital will be using this. We'll need to save our sys admins fo
r network problems. I'm jus
t trying to find a way to validate an NT name
so we can get around problems caused by simple username misspellings.|||Hi
If the login does not exist then then sp_grantlogin will fail. If you really
want to allow people to see all the usernames on the domain then you should
also consider the security aspects of doing that. You may want to try the
NET GROUP command to see members of a specific domain group, it would then
be possible to restrict what is seen.
John
"ChuckRoddy" <anonymous@.discussions.microsoft.com> wrote in message
news:FE3EEB2B-2D18-44BF-8059-BE6286DFC907@.microsoft.com...
> Thanks for the reply.
> Actually, neither the DBA or the sys admin would be involved. Researchers
will be granting their work studies access through a web based interface,
and the entire hospital will be using this. We'll need to save our sys
admins for network problems. I'm just trying to find a way to validate an NT
name
> so we can get around problems caused by simple username misspellings.
Wednesday, March 7, 2012
Getting last Identity value inserted in a table
Suppose we have a table with an identity field. Someone adds a record and wants to retrieve the value of the identity field from the just added record. I have seen code like this:
BEGIN TRAN
.... INSERT data
select newlyAddedID from table
END TRANS
In other words, they think that surrounding the INSERT and SELECT in a transaction insures they will get the correct value (even when other apps are updating this table).
Is this approach sound?
TIA,
barkingdog
Immediately after your insert, do:
SELECT SCOPE_IDENTITY()
Subscribe to:
Posts (Atom)