Is User Logged-on?

Jul 23, 2005

Dear Group

I wondered whether there's a function or script that will show me
whether a user is currently logged-on to a MSSQL 2000 database? I'm
using SQL Authentication.

Thanks very much for your help & efforts!
Have a nice day!

Martin

View 2 Replies


ADVERTISEMENT

How To Find Out The Logged In User

Mar 24, 2008

Hi,
I wanted to know How can i find out that with which user i am logged in. Is there any command to find out the same.
( like in oracle, we have command -- showuser, which will return the logged in user of your session).

Thanks in advance.
-- Chetan

View 5 Replies View Related

How To Find Out When A User Last Logged In

Jun 14, 2006

Hi There



I am in the process of cosolidating sql servers.

One of them literally has hundreds of sql logins, obviously i need to clean these up, however i a not sure how to determine when a user last logged in ?

How can i find out the last login date of a user ?

Thanx

View 3 Replies View Related

Select Latest Logged In User

Apr 23, 2007

Hi!
I would like to select the 10 latest logged in users and then display them in a gridview-control....
But Iam not good at SQL, so I would really appreciate if someone could help me to write the select-part for this!!
(I use the database 'ASPNETDB.mdf', which is automatically created by VVD 2005 Express Edition)

View 2 Replies View Related

Get The Currently Logged In User's SQL Role In A Different Database

May 14, 2008

NOTE: I am talking about roles in my sql server - NOT in asp.net. I need to create a stored procedure that retrieves the roles that the currently logged in sql user has for a different database. I have the code that gets the roles for the user, but it only works if the user is in the database. I want to be in one database, and get the roles for a different database. I have tried using USE DATABASE, but this is not allowed in a store procedure.

View 10 Replies View Related

Database List For The Currently Logged In User

Jul 11, 2004

I can get a list of all databases in SQL Server using

sqlText = "select name from sysdatabases order by name".

How can I get such a list for the currently logged in user only?

Thanks in advance

Harold Hoffman

View 1 Replies View Related

How Do I Refer To The User Logged On To The Database?

Apr 22, 2000

How do I refer to the user logged on to the database?
I can refer to a table as dbo.tblApptDaily,
but how do I refer to
[current user].tblApptDaily?

Create Procedure "prcCreateApptDaily"
as
Create dbo.tblApptDaily
(ID int primary key, ApptTime datetime,
book1 numeric, book_Status1numeric default (0), PN1 varchar (50), ApptID1
int,...LastID int)

View 2 Replies View Related

Select Records For The Current Logged On User

May 14, 2007

Hi all
I've been having a really difficult time finding out how to run a query which selects records from an SQL database for the current logged on user. I've tried a whole manner of different approaches but here is where I am at now:
<script runat="server">
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
If Not Page.IsPostBack Then
ds_meobservingcolleagues.SelectParameters(0).DefaultValue = User.Identity.Name
End If
End Sub
</script>
 
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="ds_meobservingcolleagues">
</asp:GridView>
<asp:SqlDataSource ID="ds_meobservingcolleagues" runat="server" ConnectionString="<%$ ConnectionStrings:StPaulsDatabase %>"
SelectCommand="SELECT [observeTeacher], [observeBy], [observeReason] FROM [Observations] WHERE ([observeBy] = @observeBy)">
<SelectParameters>
<asp:Parameter Name="observeBy" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
 
This is not resulting in any error. But it is not returning the records that it should be either.
Please can anyone help? I'm sure it shouldn't be this difficult to do

View 3 Replies View Related

How To Show Only Records That Belong To The Logged In User.

Sep 28, 2007

Hello.I realize that this question has been asked before, but I still can't get it to work. Below are some links that might be of help:http://forums.asp.net/p/1159666/1913519.aspx#1913519http://forums.asp.net/p/1161930/1924264.aspxhttp://forums.asp.net/p/1116601/1732359.aspx#1732359http://forums.asp.net/t/1104718.aspxhttp://forums.asp.net/p/1096290/1655706.aspx#1655706http://forums.asp.net/p/1110162/1707952.aspx#1707952 Basically, I need a DropDownList to display only projects for which the logged in user is assigned as leader. The [Projects] table contains an integer ProjectId, a string ProjectName, a uniqueidentifier ProjectLeader, and other fields. Can someone help me with the SQL query and code?  * Here is the definition of the SqlDataSource: <asp:SqlDataSource ID="SqlDataSource5" runat="server" ConnectionString="<%$ ConnectionStrings:ASPNETDB.MDFConnectionString %>" SelectCommand="SELECT [ProjectId], [ProjectName] FROM [Projects] WHERE ([ProjectLeader] = @Leader)" OnSelecting="SqlDataSource5_Selecting"> <SelectParameters> <asp:Parameter Name="Leader" Type="Object" /> </SelectParameters> </asp:SqlDataSource>  * Here is the definition of the SqlDataSource5_Selecting method:   protected void SqlDataSource5_Selecting(object sender, SqlDataSourceSelectingEventArgs e) { e.Command.Parameters("@Leader").Value = loggedInUserId; } where loggedInUserId is a global variable of type System.Guid. It has been evaluated in the Page_Load event to as: loggedInUserId = (System.Guid)Membership.GetUser().ProviderUserKey; Now the first problem I encounter is that when I run the page, the compiler complains and says, "error CS0118: 'System.Data.Common.DbCommand.Parameters' is a 'property' but is used like a 'method'." The second problem is when I insert the line: SqlDataSource5.SelectParameters("Leader").DefaultValue = loggedInUserId; in page_Load. The compiler again says, "error CS0118: 'System.Data.Common.DbCommand.Parameters' is a 'property' but is used like a 'method'." I've spent a long time trying to figure it out, but could not solve it. I would appreciate it if someone can help me out. Thank you very much. 

View 11 Replies View Related

SQL Server 2014 :: Get SharePoint Logged-in User

Mar 17, 2014

I have created a SharePoint external list using SQL Server, the data source is SQL Server. Is there way that I could get the logged-in SharePoint user and stored in SQL Seever?

View 2 Replies View Related

SQL 2012 :: Computer Details Of The User That Is Logged In

Jan 20, 2015

I need to get the computer details of the person that logged in. I have a client that needs me to write a computer asset logging system for them. This is a one table database that will keep all the computers in the company's details like serial number, bios serial number, ram size disk size, mother board info etc. This is a vast number of details and what they want to do is when for instance the ram changes e.g. taken out or added they need the program to update the table with the new information once the computer starts again.

View 4 Replies View Related

Transact SQL :: How To Find If User Not Logged In For 45 Days

Nov 20, 2015

I have created table called Login in sql server where i have column usercode, email and login_date (login_date is datetime type)So, i created web application using .net. whenever user logged in, i am allowing based userLoged table and  i am inserting into login table.

login table usercode  email       login_date
001          a@gmail.com    2015-11-18 22:02:41.153
001          a@gmail.com    xxx
.
.
.

I have another table called userLoged where i have column usercode,email and web_access 

UserLoged table usercode email         web_access
001         a@gmail.com   Y

Now, if a@gmail.com (001) is not logged in for 45 days, i need to update web_access to be 'N' how to know if he /she not logged for 45 days.

View 4 Replies View Related

Showing Data Based On The User Logged In.

Feb 25, 2008

Assume I have a heirarchy like the following:

- John Smith

- James Jones
- Robert Allen

- Lisa Andrews
- Bob Thompson

Now, I have a report where whoever is logged in will only see data for themselves and those below them, so John Smith would see everyone including himself, but Lisa Andres would only see herself and Bob Thompson. James Jones would be able to see everyone except John Smith.

How do I go about implementing this code, for example in an asp.net page where one of the user's logs on to view the report. Currently, there is a T-SQL function that creates a user heirarchy table, but it is very slow and I am curious if SSRS 2005 has any new capabilities in handling this.

Thanks,
Saied

View 3 Replies View Related

Filtering Data Based On Logged In User

Mar 10, 2008



Is this level of security possible in RS 2005? if so how?

Any guidance would be appreciated.

Thanks.

View 1 Replies View Related

How To Current Logged Windows User Name In Tsql

Mar 27, 2006

Hello



how can i get current logged windows user name in tsql. I know with windows aut it is possible how can i get this when sql auth.

Is there any system function or any special codeing required ?



regards

Chikuu

View 8 Replies View Related

Help With Trying To Insert The UserName Of The Logged In User Into The DB Field UserID

Feb 11, 2008

How do I insert the UserName of the Logged in user into the DB field UserID. I created a web form page, and added a form view control set the page default to Insert Mode.  The Page is used to insert data.  I have a hidden field called UserID that I would like to capture the Logged in user.  I have logged in to the default page with userID and password, added a new record, and the db table field UserID is empty. I have been trying to figure out what I am doing worng, but no luck, Please suggest the best way to do this.  I have listed what I have done thus far? 
I have added the login Control from Login and added it to the page as a hidden field thinking that I needed to have this field on the page to get this to work where you copy the value in the Loginname field to the useridTextbox on the formview1 insert template.  I read on line where the method below is better.  Please tell me what I am doint wrong.
System.aspx---------------------------------------------------------------------------------------------------------------1) <asp:FormView ID="FormView1" runat="server" AllowPaging="True" DataKeyNames="SystemID"        DataSourceID="SystemSqlDataSource1" DefaultMode="Insert" Width="583px">2) <asp:TextBox ID="UserIDTextBox" runat="server"                 Text='<%# Bind("UserID") %>' Visible="False"></asp:TextBox><br />3) <asp:SqlDataSource ID="SystemSqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:RCMISConnectionString %>"        DeleteCommand="DELETE FROM [tblSystem] WHERE [SystemID] = @SystemID" InsertCommand="INSERT INTO [tblSystem] ([SystemID], [SystemDesc], [Inactive], [TimeStampEntry], [TimeStampUpdate], [UserID]) VALUES (@SystemID, @SystemDesc, @Inactive, GETDATE(), @TimeStampUpdate, @UserID)"4)         <InsertParameters>            <asp:Parameter Name="SystemID" Type="String" />            <asp:Parameter Name="SystemDesc" Type="String" />            <asp:Parameter Name="Inactive" Type="Boolean" />            <asp:Parameter Name="TimeStampEntry" Type="DateTime" />            <asp:Parameter Name="TimeStampUpdate" Type="DateTime" />            <asp:Parameter Name="UserID" Type="String" />             </InsertParameters>    </asp:SqlDataSource>System.aspx.vb---------------------------------------------------------------------------------------------------------5) Partial Class MemberPages_RCM_frmSystem    Inherits System.Web.UI.Page    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load        'UserIDTextBox.Text = Membership.GetUser().ProviderUserKey.ToString()    End Sub    Protected Sub FormView1_ItemInserted(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.FormViewInsertedEventArgs) Handles FormView1.ItemInserted        'Set the UserID Value to the currently logged on user's ID        e.Values("UserID") = Membership.GetUser().ProviderUserKey    End SubEnd ClassThank you in advance,

View 7 Replies View Related

Show/hide A Field Based On The Logged In User In Reports

Apr 24, 2007

Hi,



I have some sensitive and non-sensitive info/fields in one of my reports. Is there a way to hide/show the info based on the logged in user? or do I have to create separte reports for each type of info like one for sensitive and another one for non-sensitive info.



Thanks inadvace for your help!



View 3 Replies View Related

How To Determine If The Logged On User Is A Member Of An Active Directory Security Group?

Aug 7, 2007



We are using Windows authenication within our system, and I was wondering how it would be possible to determine if the user conected to the SQL SERVER instance was a member of a particular active directory security group?

Thanks.

View 3 Replies View Related

Non Logged

Nov 17, 1999

How does SQL SErver detect that a non logged operation has occured? The syslogs table does not give any indication of this.

Thanks

View 2 Replies View Related

How To See Who You Are Logged In As

Mar 29, 2002

Hi,

I am new to SQL Server 2000, and would like to know how you can determine who is currently logged into the system on a specific PC. I was told there is a command that starts with "Sys", but they didn't know the specific command.

Also, how would I re-log in as a different user (to test the rights that were set per user). Thanks for the help in advance.

View 3 Replies View Related

Error Not Logged

Jul 7, 2000

Error 18456 will not write to the NT Event Log. I have made sure that it is set up to always write to the Windows NT Event log, but when the error occurs there is not entry in the log.
Other errors log just fine, but this one does not.

Has anyone had this problem?

TIA
Paul

View 2 Replies View Related

How To Specify &#34;NON-LOGGED&#34; DTS Operation

Jun 4, 2001

On SQL 2k, How can I set my DTS package, which imports a 3 million row .TXT file to a table, as a NON-LOGGED operation?

(LOGGING is taking tooooo long!! I will be sure to run a full DB backup when the job completes.)

thx-
BT

View 1 Replies View Related

Logged Operation

Dec 14, 2007

Can anybody explain whether Delete and Truncate are Logged Operations?

On some site, I came accross Truncate is not Logged Operation, on some site, Truncate is Logged Operation.

Can anybody explain, what exactly it is?

Thanks in advance,

Mahesh

View 2 Replies View Related

Users Logged In

Sep 28, 2007

Is there a way in 2005 to tell what user is logged into what databaseon the SQL Server?thanks,Scott

View 3 Replies View Related

Not Logged In With Appropriate Permissions

Jan 11, 2008

I'm trying to run the SDK Quickstart, but it keeps terminating due to login and permissions problems. It doesn't elaborate. I'm running SQL Express and SDK 2.0

View 4 Replies View Related

Is A Dbcc Dbreindex Logged?

Jan 5, 2001

If I reindex tables on a production server and dump the transaction log then load that tran log to a
warm standby server --will the indices be rebuilt on the standby server? My guess is no,
but I've heard people say otherwise.

--jen

View 1 Replies View Related

Periodically Trappng Whose Logged In?

Jul 13, 1999

Hello:

In order to eliminate all users who have been using the SA login, I would like to trap all users periodically who are logged in. We have changed the
sa password but just to monitor the login/userid usage, I have the following question:

1) how can I periodically write out to a log, which users are logged in to a given database at certain times of the day?

2) Which steps would I follow to do so?

Thanks.

David Spaisman

View 3 Replies View Related

Does Index Defrag Get Logged?

Sep 15, 2006

I've noticed a huge transaction log size after having run an
index defragmentation. Does a defrag get written to the transaction
log really? (Assuming the full recovery model.)

View 1 Replies View Related

Non-logged Delete Of Records???

Nov 1, 2006

I have a database in Simple mode from which I wish to delete several million rows of one table (not all rows so 'TRUNCATE TABLE' is no good), without making the transaction log file grow to several GB in size. Any ideas??? I'm almost at the point where I might create a new table and copy the records I want to keep instead...
Thanks, Simon.

View 2 Replies View Related

Stopping Transactions Being Logged

Mar 28, 2004

Hi,

I have searched google and have found no real answer to this....

We are creating a database to support an application which is loading in data as part of the cutover from their current db to SQL Server.

The datafile is around 56GB and when the data processing occurs, as its not just inserts, the transaction logs fills out to around 65GB, and probably more, just that we ran out of space. So question is, is there a workaround for stopping the logging of this processing at all. I have seen that bulk-logged mode may be used, but the option with TABLOCK must be used, and there is no way to get hands on code which performs this processing.

Is there a way to turn off transaction loggin at any point?

Thanks,
Jim

View 7 Replies View Related

SQL Users Logged In Report

Feb 15, 2006

Hi

I need to get a report that tells me the no. of users logged on to the SQL Server (this has to be an hourly report)

Will this do



WHILE 1=1
BEGIN
Select Hostname,getdate() from sysprocesses
WAITFOR DELAY '00:59:00'
END
GO


Will it have any bad affects on the SQL Server


Or can someone plz let me knw how to get that


Thanks

View 3 Replies View Related

Can't See Job Details Unless Logged Into Server.

Jul 6, 2007

I open up the SQL Server Agent Job window, and I can't see details under the General, Steps, Schedules, or other tabs unless I am running SSMS directly on that server. So much for remote management, eh?
Anybody else experiencing this problem?
Anybody else notice that jobs may fail to complete correctly without raising any errors or logging any issues?
Anybody else remember when, a year ago, SQL Server was a good product?
Anybody think Microsoft is listening?
Anybody? Buehler? Buehler?

e4 d5 xd5 Nf6

View 9 Replies View Related

How To Check How Many Users Logged In

Dec 15, 2007

Hi,
I have a question regarding sqlserver 2005
I am working on a production server.
how to check how many users are logged in currently in sqlserver and
also how to check the session info and memory usage by a paticular user......

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved