Windows Username

Apr 25, 2008

Hi all,
I want create a trigger that will log all modification to a table.
I need to identify the username that modified the data.
Here is my problem :
- they are connected to a Terminal Server so stationName il always TSName
- They are using an application I cannot modify that always use the same login information using SQL authenticationMode

So I need to be able to get their Windows session Username.

Is there any way I can do that in my trigger ?

Thanks

View 5 Replies


ADVERTISEMENT

Can't Access Database Because Asp.net Replaces Windows Username

Feb 25, 2006

In visual studio 2005 I created a web page which accessed some information from a database on an sql server.
Various pages highlighted that aspnet replaces the windows username with it's own variant which is likely to blocked when trying to access the server.
I adjusted the web.config to use a connection string with Trust_Connection=True.
This doesn't seem to have worked.
Any Suggestions as to why this would be?.
Server Error in '/ChartWebSite' Application.


Login failed for user 'A0034138ASPNET'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'A0034138ASPNET'.Source Error:



An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace:



[SqlException (0x80131904): Login failed for user 'A0034138ASPNET'.]

View 1 Replies View Related

Get Windows Logged In Username In SQL When Using Win Auth Mode In SQL Form ASP

Jun 18, 2007

Hi Guys,
I have an Intranet web application and I have to use windows authentication. They are 4 main users group to access the application, each with different set of permission on my store procedures.
I have created a windows group for each of those group in my windows environemnt. My DB Connection String in web.config is set to Integrated Windows Authentication ( Integrated Security=SSPI)
I have done all configuration based on this article: http://msdn2.microsoft.com/en-us/library/ms998292.aspx
I have 4 different database Roles in my database and 4 different database users. I also add NT AUTHORITYNETWORK SERVICE as a member of each of those database Roles.
Now I get connected, fine and set permission on the database roles.
1 thing I want to know, How Can I get the Windows Group name in the database, which has the same name as my SQL Login and Database Roles or User
I tried all SUSER_SNAME() and ... they all return NT AUTHORITYNETWORK SERVICE
I want to get AppPowerUser Role or windows group name. I think I should be able to because I am using windows authentication.
Any help is appreciated.
Mehdi

View 1 Replies View Related

SQL 2012 :: Windows 2008 Evaluation Default Username / Password?

Nov 19, 2014

i have installed windows 2008 evaluation, during installation i was not asked for username and pssword but when i try and start up its asking for administrator password.

View 0 Replies View Related

Windows Vista Truncates Username During Logon To SQL 2005 Express

Apr 5, 2008

As the titel suggests I am having quite a strange problem

I have installed an Enotebook on our domain server at work and it uses MSQL express 2005.
When I ask it to automatically connect using window authentication to connect it works on windows XP machines with DomainUSERNAME. However when I try the same thing on Windows vista it tells me the logon failed with "DomainUSERNAM". I change it to SQL Authetifcation and type the same username fully (I have added the user via active directory as a SQL user) then it works

Basically it looks like the windows username is sent from Vista missing the last letter.

I have Googled this a lot and have not really found an answer. Am I mearly being very stupid or is this a known issue. Can anyone give me a suggestion as to why this might happen?.

View 5 Replies View Related

Export Username / Password To CSV File To Test SP To Output Username / Password

Jun 2, 2014

I put this together to export the user name /password to a csv file to test my SP to output the user name/password.

DECLARE @user_name varchar(50)
DECLARE @psswrd varchar(10)
SELECT @user_name ,@psswrd
FROM ngweb_bulk_enrollments
EXEC master.dbo.xp_cmdshell 'bcp NGDevl.dbo.ngweb_bulk_enrollments out C: est.csv -Sserver1 -T -t, -r
-c'

This works but I don't get the headers in the file. How can I include the headers?

View 7 Replies View Related

Get Username

Feb 21, 2002

Hi!! I use nt groups to give access to users. I need to now the name of the user who is connected to a especific database.

I tryed with suser_name() function but it returns null value because ntgroups are used.

if someone now any function that can help me, i will appreciate your help.

Thanks.

View 1 Replies View Related

Username: Sa

Jan 26, 2008

I just installed SQL 2005 Server. I am using SQL Server 2005.
Why do I have to login with the username with "sa"?

I failed to sign in with other usernames.

What is the trick?



Thanks

View 3 Replies View Related

Is It Possible Adding Windows (activi Directry Users) From SQL Server Which Is Running Windows Authotication.

Dec 12, 2007



Is it Possible adding Windows (activi directry users) from SQL Server which is running Windows authotication.?

View 4 Replies View Related

Package Execution Fails In Windows Service But Runs Fine As A Windows Application.

Jun 23, 2006

I am attempting to write a Windows service that watches a database for uploaded files to import. When a new file is found, the corresponding SSIS package is run from the file system with variables passed through. I started development as a Windows app and copied the functionality to a service.

The app runs fine. The service does not. I get a "Failure" each time a package is executed. Everything is identical behind the scenes with the obvious exceptions that OnStart and OnStop handlers are buttons in the app. I added a script task at the beginning of one of the SSIS packages to notify me that it is even running at all. It doesn't even hit that initial task.

Again, the app will run all packages just fine. The data is imported and the results return as "Success."

The following is the code executing the package. Any help is appreciated. I've been banging my head on this one for a few days now. (Is there a tag to format a code sample?)

Dim pkgLocation As String
Dim pkg As New Package
Dim app As New Application
Dim pkgResults As DTSExecResult

pkgLocation = sPackageFolder & PackageName & ".dtsx"

pkg = app.LoadPackage(pkgLocation, Nothing)

Dim vars As Variables = pkg.Variables

vars("ImportId").Value = ImportId
vars("ProductionServer").Value = ProductionServer
vars("ProductionDatabase").Value = ProductionDatabase
vars("SourceFileName").Value = FileName
vars("SourceFilePath").Value = FilePath

pkgResults = pkg.Execute()

View 3 Replies View Related

How To Open SDF File Stored On Windows Mobile Device From A Windows Desktop App?

Apr 14, 2008

Long story short -

Have two C# applications - one WinForms desktop app, the other a WinForms smart device app. Both use SQL Server Compact CE 3.5 to store data locally. Both work just fine.

Now the desktop app needs to open and update the .SDF file that is stored on the Windows Mobile device. (Device will be docked via USB.)

What format would the path to the .SDF look like that the WinForms application would need to specify in order to open it?

Thanks for reading.

View 3 Replies View Related

Passing UserName To SQL

Jul 8, 2007

A beginner's question I'm sure.  When visitors have logged into my site, how do I then use their UserName as a parameter in an SQL WHERE clause so that I can pull up their detailed information.  I'm using VB if additional code is required.
Thanks in advance.

View 2 Replies View Related

Username && Password

Oct 4, 2005

I built an eommerce site on my local computer at work. It's now time to
put the site on our server and get things rolling... anyways, I'm
trying to perform an sqldump so I can gather the appropriate text files
so I can upload the database.  Anyways, the sqldump program I am
using requires a username and password to access the sql database.

I am using MSDE and have no clue as to what the username and password may be....

My VisualStudio .Net automatically connects when I work on the site.

Does anyone know what the default username and password may be or what my options are to get this sqldump to work?

Any help would be appreciated.

View 2 Replies View Related

Get NT Username...10-July-01

Jul 10, 2001

Hello out there in SQL land! I'm writing a T-SQL script to create tables and grantlogins to local machine NT accounts. The problem is that I'm sending this script out to about 1700 machines with 1700 different DomainNames!
So hard-coding the domainusername is NOT an option. In other words, non-networked computers. In the T-SQL command:

EXEC sp_grantlogin [DomainUsername]
-OR-
EXEC sp_grantdbaccess [DomainUsername]

note: Domain= @@SERVERNAME
Username = Jib

I want to have a variable of some sort pass the DomainName & concatenated username in order to grant login the SQL Server for the NT user. Any help would be greatly appreciated.
Thanks!

View 1 Replies View Related

Suggest Username

Aug 1, 2006

hey can anyone suggest me how to write the efficient( a bit faster) stored proc to generate alternative usernames( with logical variations like the one of hotmail ) if provided one is already present in database... :)

View 5 Replies View Related

Username & Password

Dec 13, 1998

how do you send SQL Server the proper username and password in ASP Scripts?

So far, I have: Connection.Open "DSN=DSNname;pwd=password"

Where does username play in all this and what is its format.

Appreciate any help....

View 2 Replies View Related

How Can I Get The Username From An Application?

Aug 9, 2004

Hi everybody,

Here the environment is application in 3 layers.
So the user in his client machine, access the application in an application server that sends the request to my sql server database server.
My problem is: when I run sp_who from Query Analyzer, I see the host name that is pre-defined inside code application. But, actually, I need to know the user who is requesting the transactio so I can know right the person who is slowing my database performance....
Do you know, any function, procedure or anything else that I can use in the application code in order to provide the user or the host name from the client machine?????
I hope some answers...

Thank you all,

View 7 Replies View Related

Using UserName As A PK VS. UserId

Jan 6, 2005

Hello

Currently, I am using a varchar "UserName" as a primary key instead of an Identity or GUID.

System Info:
When user's sign up they provide the "UserName" that is used as a PK.
Creating a message board type web application.
UserNames will never change.
UserNames are used extensively as FK's in other Tables.
We want to scale well.

Does anyone know the implications?
I understand Joins are faster on numerical values than strings but we will not be performing many joins.

In my case is it better to use Identity as a PK or is it better to use a varchar for a "Users" table?

Thanks
jenn

View 1 Replies View Related

Query Help - Get Last Username?

Apr 22, 2006

Hi, I hope this is the right place to post this. I am pretty much stuck but think I am doing pretty good so far as I am getting more and more into SQL

using SQL Server 2000 here.

 

I want to be able to get the last username who replied to a topic. The "DateOfLastReply" works great, it gives me the last date of a reply to a topic so pretty much along with this, I want to get who it was that replied last. Any ideas? so far, I have this but it isnt correct:




SELECT Threads.[ID] 'ThreadID', ThreadName, DateOfCreation 'DateCreated',

(SELECT TOP 1 DateOfReply FROM Replies WHERE Replies.ThreadID = Threads.[ID] ORDER BY DateOfReply DESC) 'LastReplyDate',

(SELECT TOP 1 e.Username FROM Replies, Threads WHERE Replies.UserID = e.[ID] AND Threads.[ID] = Replies.ThreadID AND Threads.ThreadStarterUser = e.[ID] ORDER BY DateOfReply DESC) 'LastUserReplied', --HERE

(SELECT COUNT(ReplyID) FROM Replies WHERE ThreadID = Threads.[ID]) 'NumberOfReplies',
e.username 'UsernameCreator'
FROM Threads
INNER JOIN Users e ON
e.[ID] = ThreadStarterUser

 

View 6 Replies View Related

Unable To Connect To SQL SERVER 2005 Database Engine Using Windows Authentication Under Windows Vista...

Mar 26, 2008

Hallo there,

I just upgraded from Windows XP Pro to Windows Vista Bussiness and tried to reinstall SQL Server 2005 Developers Edition. After the installation i downloaded (using microsoft windows update) and installed all the service packs for sql and vista available.

My problem is when i open sql server management studio and try to connect to my default instance using windows authentication and database engine, an 18456 error occurs.

I enabled all the protocols and all the ports
I disabled windows firewall and antivirus (eset nod32)
I installed all service packs available
I have also installed Visual Studio 2005 without installing sqlexpress

But nothing happens!

Please i am very desperate, any information will be gratefully accepted.

This is my installation Information



Code Snippet

Microsoft SQL Server Management Studio 9.00.3042.00
Microsoft Analysis Services Client Tools 2005.090.3042.00
Microsoft Data Access Components (MDAC) 6.0.6001.18000 (longhorn_rtm.080118-1840)
Microsoft MSXML 3.0 5.0 6.0
Microsoft Internet Explorer 7.0.6001.18000
Microsoft .NET Framework 2.0.50727.1434
Operating System 6.0.6001


Thank you in advance,
Patonios


View 3 Replies View Related

Pass UserName To The SQL Select ? (VB)

Jul 11, 2007

 
VB   ASP.NET 2.0 
How do I get the Authenticated UserName passed to a Select Command of a data control ?
I'm not clear on how to get the logged in username from User.Identity.Name as a string or how to pass it to the Select Command of a control.
I've had some success with SelectParameters / ControlParameter's in the Master Control context, but otherwise I don't understand how to create a Parameter for use with the SQL.
I want to show the user data from a database, based on who is logged in .
Help, greatly appreciated.
Chris
 

View 8 Replies View Related

Username Rather Than Sa In Sql Server 2000

Aug 16, 2004

how can i change the username of SQL Server 2000 from sa to another username?
thank you for the help and for the time

View 7 Replies View Related

How To Set Up A Username And Password For MSDE

Jan 1, 2005

Hi,

I have installed MSDE using the following parameter:

commandline> setup SAPWD="MySAPwd"

now all was set up... when i opened the osql utility..i wasnt able to login... it kept asking me the login name ans password...

i entered my windows login name which is 'home' and entered 'kham00s' as the password... it didnt work... then i entered my windows login name again which is 'home' and entered 'OTHERPASSWORD' as the password which is my system password...but did not work either...

then i logged in using :

commandline> osql -E

It successfully logged in... and i was able to create databases and tables...

can someone tell me how to set a username and password for MSDE please... so that i can connect to MSDE using WebMatrix...

i m coming from a PHP/MySQL background so i know SQL and stuff... but dont know how to handle and configure MSSQL...

waiting for the response..
thanks in advance...
Bye.
Kamran.

View 6 Replies View Related

_ In NT UserName. Looking For Janne Hakulinen

Jan 11, 1999

I want to establish logging using NT Security. The problem is that user names in NT have underscore(_). When I establish NT Scurity in SQL security manager, SQL Server tries to add blank names as login id and they will not go through. Is it manadatory to remove underscore from username?

Because of structrual hierarchy, I have different groups in NT to be mapped to SQL Server groups and each group has different permission on SQL tables. In some cases we might have same users in more than one group. I read that it is not possible if you use NT integrated security. Is there any thing that can be worked around this and is this problem still exists in SQL 7.

Janne Hakulinen gave me a reply (Appreciate that) but when I did as he said, I got no success. So I am asking him to reply me at alim@goldline.net and let me send him an e-mail.

Thank you in advance
Ali Malekshahi

View 1 Replies View Related

HELP -- Password & Username Recovery

Aug 16, 2000

I need to get into a database and need the password and username for a Microsoft SQL Server v.6.5 database. Can you help or do you know someone else who can? This database is owned by us and this is a "legal" project.

Thank you.

Michael A. Wise
Manager, MIS/IT
EBARA International Corporation
Cryodynamics, Electric Motor, Standard Pumps Divisions
"World's Leader in Liquefied Gas Pumps and Turbines"
350 Salomon Circle
Sparks, Nevada, USA 89434
775-356-2796, xt. 215; FAX: 775-356-2884
mailto:mwise@ebaraintl.com
www.ebara.co.jp/indexe.html
www.ebaratech.com
www.pumpsebara.com

View 1 Replies View Related

How To Connect To DB With Username And Passwd?

May 23, 2006

Hi I've created a login in my SQL Server 2005 like this:

CREATE LOGIN testuser
WITH PASSWORD = 'TestPWD';
USE DB1;
CREATE USER testuser FOR LOGIN testuser;
GO

now i want to connect from a c# app with the following connection STring
"Data Source=TURM21;Initial Catalog= Db1; Database= Db1 ; USER = testuser; PASSWORD = TestPWD; pooling=false; "

and i get the following Exception:
SqlConnection Handle : System.Data.SqlClient.SqlException: A connection was successfully established with the server, but then an error occurred during the login process. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.)

CAn somebody help me? Whats wrong? Is it my connection string?

Greetz

View 2 Replies View Related

Difference Between Username And Groupname

Jun 8, 2006

I set up a group within an SQL Server database, of which I am a member. In some visual basic code, I do a dislay of user names.

My question: why does the code show my individual name (Servermyname) as opposed to showing the group name I want to see? I have confirmed that the only user of the database is the group, and not an individual user name.

Any ideas? Thanks!

*********************************************************************
This forum is best viewed with a computer. Questions asked freely. Confusion happily shared.

View 3 Replies View Related

Change Username And Password

Sep 30, 2006

Hello

I newly installed the SQL Server 2005.During installation i chose the option Mixed Mode.I aslo did nit mention any user name and password to the SQL Server.Iam able successfully create Databases using the SQL Server Management Studio.
My problem iam unable to connec to the SQL Server from my .net windows application.My application code is

Dim strCon As String
Dim sValue As String
Dim strQuery As String
Dim dsEventTransac As New DataSet
Dim daEventTransac As New SqlClient.SqlDataAdapter
Dim rowCount As New Integer
Dim oWebService As New WebReference.TkmService
'Dim nwRow As DataRow
'Dim delCmd As SqlClient.SqlCommand


strQuery = "SELECT * FROM EventTransaction"

strCon = "Data Source=localhost;integrated security=SSPI;initial catalog=KmsDb;User ID=sa;password="
objCon = New SqlClient.SqlConnection(strCon)
If objCon.State = ConnectionState.Closed Then
objCon.Open()
End If
daEventTransac = New SqlClient.SqlDataAdapter(strQuery, objCon)
Dim cmdBuilder As New SqlClient.SqlCommandBuilder(daEventTransac)
daEventTransac.Fill(dsEventTransac)

'update the DataAdapter
daEventTransac.Update(dsEventTransac)
oWebService.Url = "http://192.168.0.10/TkmService1/TkmService.asmx"

''display the table in a grid
dgEventTransac.DataSource = dsEventTransac.Tables(0)

Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub

Private Sub DataGrid1_Navigate(ByVal sender As System.Object, ByVal ne As System.Windows.Forms.NavigateEventArgs) Handles dgEventTransac.Navigate

End Sub
End Class

When i donot specify user ID and password i get connected correctly.But when i run the above code i get an error
"Unable to connect to the remote server"
Now i want to change the username and password.Please tell me how to do

View 2 Replies View Related

Setting Username And Password

Jun 11, 2007

How do you set a username and password for a database in SQL Server 2005?

View 1 Replies View Related

How To Clear SQL Authenication Username?

Oct 16, 2007

Hi,

I had deleted the login and user in my SQL 2005 database. However, each time when i connect to my database using the SQL enterprise manager, I can still see the deleted username under the login. It seems that the username is stored or cache somewhere after the first time that I have login. Does anyone know how to clear it? I am using SQL 2005 authenication method on 2003 Server machine. Thanks.

Regards,

View 14 Replies View Related

Index For Username/password

Dec 28, 2005

Does this make sense for a logon table:CREATE TABLE Logon(ID INT NOT NULL IDENTITY PRIMARY KEY,name VARCHAR(15) NOT NULL,password VARCHAR(15) NOT NULL)GOCREATE UNIQUE INDEX IX_Logon_Name ON Logon(name)CREATE INDEX IX_Logon_NameAndPassword ON Logon(name,password)GOI do want the name to be unique but also will search frequently on bothname & password. Is this how it should be done? I don't fullyunderstand the difference between placing a single index in name &password VS one on both name & password.

View 12 Replies View Related

DB Hostname, Username, Password Etc

Jun 25, 2007

I'm trying to get into an installation of v.6.5 to use with anotherserver and I need the following information:Database hostnameDatabase nameDatabase usernaneDatabase passwordIs this information available anyplace within the installation files?I'm not asked for uname and pwd to get into the database.Thanks!

View 1 Replies View Related

Reports Asking For Username And Password

May 18, 2007

I have two questions -



1. I have deployed the reports on our webserver. When I access the link http://servername/Reports from IE it asks me for a username and password the first time. I tried all the passwords including admin user/pwd but the dialog remains there. I close IE and start again I can access the reports. For your information, the checkbox 'Save my password' is checked in the reports. Does anyone know why the username/password dialog appears the first time?



2. Sometimes some of us get a 'Page cannot be displayed' while the others can access it. I have to start Reporting services and everyone can access the reports. Any ideas?



Thanks!!

View 3 Replies View Related







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