Showing posts with label login. Show all posts
Showing posts with label login. Show all posts

Tuesday, March 27, 2012

Getting the database name in Server-Side trace event

I'm trying to audit all the database activities using Server-side trace
in SQL Server 2000.
Basically I need to get the login information (login Id, Login time
etc) along with the name of the database.Can some one suggest a way to
do that?

Thanks in advance.
JJacand4321 (jacand4321@.yahoo.com) writes:
> I'm trying to audit all the database activities using Server-side trace
> in SQL Server 2000.
> Basically I need to get the login information (login Id, Login time
> etc) along with the name of the database.Can some one suggest a way to
> do that?

You can find in Books Online exactly which columns that are populated for
which events. The database name is not always populated, but in such
case the database ID usually is. What I do when I analyse trace files is
that I load them into a table, and then supplement columns like database
name and object name, when only the ID is present. (In some cases, not
even the object id is populated, in which case I try to extract it from
TextData.)

The place to look in Books Online is
Administering SQL Server
Monitoring Server Performance and Activity
Monitoring with SQL Profiler
Monitoring with SQL Profiler Event Categories

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

Monday, March 12, 2012

Getting Problem in giving database permission to group user

hi ,

I am getting some problem in using group in sql server login.

i have two NT groups in windows.i) developer and tester

I added a user Lalit in both gruop. I want to give db_owner permission on a particular database(Employee) to developer group and data_denyreader and deny_writer on same database(Employee) to tester group.

Now when i logging in to sql server using Lalit(windows authentication) iam not able to access the database(Employee).

Now my concern is that Lalit should have full access to the employee database when entered as developer user and limited access to employee database when entered as tester user.

how can i achieve this set up?

Please do help.

Thanks a lot in advance !!!!!!!!!!!!!!!!!!

Deny trumps any other permission (other than SA). For my testing groups, I set up SQL Server login accounts, one called "Owner" and the other called "tester". That way when the devs log in they don't have to change NT contexts.

Friday, March 9, 2012

getting native error 18456 Error = login failed for user(username) when using BCP

Hi ,
can any one help in exporting data to a flat file by using BCP,
iam trying to use BCP but iam getting following error
Error : native error 18456 Error = login failed for user when using
BCP
thanks well in advanceexec master..xp_cmdshell 'BCP northwind..orders OUT
c:\test1.txt -c -C850 -SServer -Usa -Ppwd'
"RPK" <praveen.rampally@.gmail.com> wrote in message
news:1143093192.808073.125810@.u72g2000cwu.googlegroups.com...
> Hi ,
> can any one help in exporting data to a flat file by using BCP,
> iam trying to use BCP but iam getting following error
> Error : native error 18456 Error = login failed for user when using
> BCP
> thanks well in advance
>

Wednesday, March 7, 2012

getting login id in trigger

I have a web application which connects to Microsoft SQL Server 2000 through
JDBC-ODBC Driver. The application server is JBoss and I am using connection
pooling.
When the application connects to the database it provides userid and
password which are 'sa' and 'password' respectively. They are constants for
all users. The user also type in his/her own login id which I stored in the
HTTPSession.
Problem is my triggers wants to get that login id. Is it possible?
Thanks
RizwanHi
You should not be using 'sa' as the login to SQL Server as this may be too
privileged.
The users login id is only used as authentication mechanism, therefore you
will either need to pass it as part of each call to the query/stored
procedures or possibly generate some kind of session token and pass that and
then use the session token as a link to the login.
John
"Rizwan" <hussains@.pendylum.com> wrote in message
news:5Ozce.14173$gA5.818174@.news20.bellglobal.com...
>I have a web application which connects to Microsoft SQL Server 2000
>through
> JDBC-ODBC Driver. The application server is JBoss and I am using
> connection
> pooling.
> When the application connects to the database it provides userid and
> password which are 'sa' and 'password' respectively. They are constants
> for
> all users. The user also type in his/her own login id which I stored in
> the
> HTTPSession.
> Problem is my triggers wants to get that login id. Is it possible?
>
> Thanks
> Rizwan
>|||> possibly generate some kind of session token and pass that and
> then use the session token as a link to the login.
can you explain this solution a bit more about what is session token?
thanks
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:uNfEUWWTFHA.3176@.TK2MSFTNGP09.phx.gbl...
> Hi
> You should not be using 'sa' as the login to SQL Server as this may be too
> privileged.
> The users login id is only used as authentication mechanism, therefore you
> will either need to pass it as part of each call to the query/stored
> procedures or possibly generate some kind of session token and pass that
and
> then use the session token as a link to the login.
> John
>
> "Rizwan" <hussains@.pendylum.com> wrote in message
> news:5Ozce.14173$gA5.818174@.news20.bellglobal.com...
>|||Hi
The easiest way is to store and pass the user_id that the person
authenticated with within you code. You than pass this value to each
procedure that is called e.g.
EXEC myProc @.user_id = 'John'
If you want to access the user_id in a trigger you would have to add a
user_id column to each table (say last_modified_by) and set 'John' as the
value. This way you can see who changed it by accessing the last_modified_by
in the inserted table in your trigger. Alternatively you can do the work
that the trigger would have done in the stored procedure and you would not
need the extra column.
A token would be a means of relating the session to the user, if you have a
users table it may be stored in there. That way you are not passing
something that is clearly a username, but you can get the username by
selecting the appropriate record from the users table.
HTH
John
"Rizwan" <hussains@.pendylum.com> wrote in message
news:9srde.1176$3U.240756@.news20.bellglobal.com...
> can you explain this solution a bit more about what is session token?
> thanks
> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:uNfEUWWTFHA.3176@.TK2MSFTNGP09.phx.gbl...
> and
>