Friday, March 30, 2012
How to control SQL Server 2000 login and logout Method / Event.
Is there a question somewhere in that post?
*mike hodgson* |/ database administrator/ | mallesons stephen jaques
*T* +61 (2) 9296 3668 |* F* +61 (2) 9296 3885 |* M* +61 (408) 675 907
*E* mailto:mike.hodgson@.mallesons.nospam.com |* W* http://www.mallesons.com
SOHO wrote:
|||Hi,
Did you mean the Enable auditing in SQL Server 2000 Login/ Logout, Then
there is no control to control those.
Could you please explain us in details about your actual requirement?
Thanks
Hari
SQL Server MVP
"SOHO" <hkwin2000@.hotmail.com> wrote in message
news:%23$0ZCplcFHA.3032@.TK2MSFTNGP10.phx.gbl...
>
> --
> Thanks !
>
>
|||Sorry!
Thanks !
"SOHO" <hkwin2000@.hotmail.com> glsD:%23$0ZCplcFHA.3032@.TK2MSFTNGP10.phx .gbl...
>
> --
> Thanks !
>
>
sql
How to control SQL Server 2000 login and logout Method / Event.
Is there a question somewhere in that post?
*mike hodgson* |/ database administrator/ | mallesons stephen jaques
*T* +61 (2) 9296 3668 |* F* +61 (2) 9296 3885 |* M* +61 (408) 675 907
*E* mailto:mike.hodgson@.mallesons.nospam.com |* W* http://www.mallesons.com
SOHO wrote:
|||Please don't cross post
Greg Jackson
PDX, Oregon
|||Hi,
Did you mean the Enable auditing in SQL Server 2000 Login/ Logout, Then
there is no control to control those.
Could you please explain us in details about your actual requirement?
Thanks
Hari
SQL Server MVP
"SOHO" <hkwin2000@.hotmail.com> wrote in message
news:%23$0ZCplcFHA.3032@.TK2MSFTNGP10.phx.gbl...
>
> --
> Thanks !
>
>
|||Sorry!
Thanks !
"SOHO" <hkwin2000@.hotmail.com> glsD:%23$0ZCplcFHA.3032@.TK2MSFTNGP10.phx .gbl...
>
> --
> Thanks !
>
>
How to control SQL Server 2000 login and logout Method / Event.
Is there a question somewhere in that post?
*mike hodgson* |/ database administrator/ | mallesons stephen jaques
*T* +61 (2) 9296 3668 |* F* +61 (2) 9296 3885 |* M* +61 (408) 675 907
*E* mailto:mike.hodgson@.mallesons.nospam.com |* W* http://www.mallesons.com
SOHO wrote:
|||Hi,
Did you mean the Enable auditing in SQL Server 2000 Login/ Logout, Then
there is no control to control those.
Could you please explain us in details about your actual requirement?
Thanks
Hari
SQL Server MVP
"SOHO" <hkwin2000@.hotmail.com> wrote in message
news:%23$0ZCplcFHA.3032@.TK2MSFTNGP10.phx.gbl...
>
> --
> Thanks !
>
>
|||Sorry!
Thanks !
"SOHO" <hkwin2000@.hotmail.com> glsD:%23$0ZCplcFHA.3032@.TK2MSFTNGP10.phx .gbl...
>
> --
> Thanks !
>
>
How to control SQL Server 2000 login and logout Method / Event.
Thanks !This is a multi-part message in MIME format.
--080702060202030100030105
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Is there a question somewhere in that post?
--
*mike hodgson* |/ database administrator/ | mallesons stephen jaques
*T* +61 (2) 9296 3668 |* F* +61 (2) 9296 3885 |* M* +61 (408) 675 907
*E* mailto:mike.hodgson@.mallesons.nospam.com |* W* http://www.mallesons.com
SOHO wrote:
--080702060202030100030105
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<tt>Is there a question somewhere in that post?</tt>
<div class="moz-signature">
<title></title>
<meta http-equiv="Content-Type" content="text/html; ">
<p><span lang="en-au"><font face="Tahoma" size="2">--<br>
</font> </span><b><span lang="en-au"><font face="Tahoma" size="2">mike
hodgson</font></span></b><span lang="en-au"> <font face="Tahoma"
size="2">|</font><i><font face="Tahoma"> </font><font face="Tahoma"
size="2"> database administrator</font></i><font face="Tahoma" size="2">
| mallesons</font><font face="Tahoma"> </font><font face="Tahoma"
size="2">stephen</font><font face="Tahoma"> </font><font face="Tahoma"
size="2"> jaques</font><font face="Tahoma"><br>
</font><b><font face="Tahoma" size="2">T</font></b><font face="Tahoma"
size="2"> +61 (2) 9296 3668 |</font><b><font face="Tahoma"> </font><font
face="Tahoma" size="2"> F</font></b><font face="Tahoma" size="2"> +61
(2) 9296 3885 |</font><b><font face="Tahoma"> </font><font
face="Tahoma" size="2">M</font></b><font face="Tahoma" size="2"> +61
(408) 675 907</font><br>
<b><font face="Tahoma" size="2">E</font></b><font face="Tahoma" size="2">
<a href="http://links.10026.com/?link=mailto:mike.hodgson@.mallesons.nospam.com">
mailto:mike.hodgson@.mallesons.nospam.com</a> |</font><b><font
face="Tahoma"> </font><font face="Tahoma" size="2">W</font></b><font
face="Tahoma" size="2"> <a href="http://links.10026.com/?link=/">http://www.mallesons.com">
http://www.mallesons.com</a></font></span> </p>
</div>
<br>
<br>
SOHO wrote:
</body>
</html>
--080702060202030100030105--|||Hi,
Did you mean the Enable auditing in SQL Server 2000 Login/ Logout, Then
there is no control to control those.
Could you please explain us in details about your actual requirement?
Thanks
Hari
SQL Server MVP
"SOHO" <hkwin2000@.hotmail.com> wrote in message
news:%23$0ZCplcFHA.3032@.TK2MSFTNGP10.phx.gbl...
>
> --
> Thanks !
>
>|||Sorry!
--
Thanks !
"SOHO" <hkwin2000@.hotmail.com> ¼¶¼g©ó¶l¥ó·s»D:%23$0ZCplcFHA.3032@.TK2MSFTNGP10.phx.gbl...
>
> --
> Thanks !
>
>
How to control SQL Server 2000 login and logout Method / Event.
*mike hodgson* |/ database administrator/ | mallesons stephen jaques
*T* +61 (2) 9296 3668 |* F* +61 (2) 9296 3885 |* M* +61 (408) 675 907
*E* mailto:mike.hodgson@.mallesons.nospam.com |* W* http://www.mallesons.com
SOHO wrote:|||Hi,
Did you mean the Enable auditing in SQL Server 2000 Login/ Logout, Then
there is no control to control those.
Could you please explain us in details about your actual requirement?
Thanks
Hari
SQL Server MVP
"SOHO" <hkwin2000@.hotmail.com> wrote in message
news:%23$0ZCplcFHA.3032@.TK2MSFTNGP10.phx.gbl...
>
> --
> Thanks !
>
>|||Sorry!
Thanks !
"SOHO" <hkwin2000@.hotmail.com> glsD:%23$0ZCplcFHA.3032@.TK2MSFTNGP10.phx.gbl...[vbc
ol=seagreen]
>
> --
> Thanks !
>
>[/vbcol]
How to control SQL Server 2000 login and logout Method / Event.
Is there a question somewhere in that post?
*mike hodgson* |/ database administrator/ | mallesons stephen jaques
*T* +61 (2) 9296 3668 |* F* +61 (2) 9296 3885 |* M* +61 (408) 675 907
*E* mailto:mike.hodgson@.mallesons.nospam.com |* W* http://www.mallesons.com
SOHO wrote:
|||Hi,
Did you mean the Enable auditing in SQL Server 2000 Login/ Logout, Then
there is no control to control those.
Could you please explain us in details about your actual requirement?
Thanks
Hari
SQL Server MVP
"SOHO" <hkwin2000@.hotmail.com> wrote in message
news:%23$0ZCplcFHA.3032@.TK2MSFTNGP10.phx.gbl...
>
> --
> Thanks !
>
>
|||Sorry!
Thanks !
"SOHO" <hkwin2000@.hotmail.com> glsD:%23$0ZCplcFHA.3032@.TK2MSFTNGP10.phx .gbl...
>
> --
> Thanks !
>
>
sql
how to control it's right of a sysadmin roles menbers
for a application. but the application still can't work well unless i
give the account sysadmin server roles.
so ,i give the accout sysadmin roles. but i don't the user to view other
database.
I have refuse some right like " view any database " for the account on
the server property-- right.
but i don't know why the accout staill have all the sysadmin right , to
view any database.
. how can i control it's right of a sysadmin roles menbers
i donn'n know how to do?
Ryan.You can't restrict permissions of sysadmin role members. The purpose of the
sysadmin role is to provide administrators with full access to SQL Server.
It is not intended for routine application use.
> but the application still can't work well unless i
> give the account sysadmin server roles.
Can you elaborate on why the application won't work as a non-sysadmin role
member? I would think you could create your own role(s), grant the role the
permissions needed to execute your application and then add the application
users to the role.
Hope this helps.
Dan Guzman
SQL Server MVP
"Ryan" <Ryan@.discussions.microsoft.com> wrote in message
news:48867756-671D-4CCB-8E26-C7581999EEA5@.microsoft.com...
>i have a sql 2005 server, I caeat i login accout & give it db_owner roles
> for a application. but the application still can't work well unless i
> give the account sysadmin server roles.
> so ,i give the accout sysadmin roles. but i don't the user to view other
> database.
> I have refuse some right like " view any database " for the account on
> the server property-- right.
> but i don't know why the accout staill have all the sysadmin right , to
> view any database.
> . how can i control it's right of a sysadmin roles menbers
> i donn'n know how to do?
> --
> Ryan.sql
Wednesday, March 28, 2012
how to connect to sql server as other's window login rather than user's window login thorugh A
In MSDN, it says that it is recommended to use windows authentication to connect to SQL Server rather than use mixed authentication.
I create user delta\sqluser on windows OS, and I specify in my webform ASP.NET script below :
protected System.Web.UI.WebControls.Label Label1;
private string _connString = @."data source=delta\sql2000;initial catalog=northwind;integrated security=false;user id=delta\sqluser";
/*
comment : I login to my windows as delta\koronx, and I want to every user (including me), connected to sql server through IIS, will be identified as delta\sqluser not as user's login (impersonate)
*/
private void Page_Load(object sender, System.EventArgs e)
{
SqlConnection conn = new SqlConnection(_connString);
SqlCommand cmd = new SqlCommand();
cmd.Connection = conn;
cmd.CommandType = CommandType.Text;
cmd.CommandText = "select suser_sname()";
conn.Open();
string userName = cmd.ExecuteScalar() as string;
conn.Close();
conn.Close();
Label1.Text = userName;
}
at web.config, I add :
<identity impersonate="false" userName="delta\sqluser" password="" />
at IIS webApplication1's properties, tab "Directory Security", at "Authentication and access control" section, I checked "enable anonymous access" with user : DELTA\IUSR_DELTA and checked "Integrated Windows Authentication",
at query analyzer, I login as "sa" and execute script below :
exec sp_grantdbaccess 'delta\sqluser','northwind'
when I run the ASP.NET script, error at conn.Open(); with error message :
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.
What should I do so that IIS login to SQL Server as user delta\sqluser not as "NT AUTHORITY\NETWORK SERVICE" ?
Regards,
Koronx
Your connection string is incorrect. You specify using SQL Authentication (integrated security = false) but what you want is integrated security. However, the connection string for integrated security does not allow you to impersonate a user. You should look for help on configuring your application to impersonate a specific account on an ASP.NET forum at: http://forums.asp.net/.
Thanks
Laurentiu
how to connect to sql server as other's window login rather than user's window login thoru
In MSDN, it says that it is recommended to use windows authentication to connect to SQL Server rather than use mixed authentication.
I create user delta\sqluser on windows OS, and I specify in my webform ASP.NET script below :
protected System.Web.UI.WebControls.Label Label1;
private string _connString = @."data source=delta\sql2000;initial catalog=northwind;integrated security=false;user id=delta\sqluser";
/*
comment : I login to my windows as delta\koronx, and I want to every user (including me), connected to sql server through IIS, will be identified as delta\sqluser not as user's login (impersonate)
*/
private void Page_Load(object sender, System.EventArgs e)
{
SqlConnection conn = new SqlConnection(_connString);
SqlCommand cmd = new SqlCommand();
cmd.Connection = conn;
cmd.CommandType = CommandType.Text;
cmd.CommandText = "select suser_sname()";
conn.Open();
string userName = cmd.ExecuteScalar() as string;
conn.Close();
conn.Close();
Label1.Text = userName;
}
at web.config, I add :
<identity impersonate="false" userName="delta\sqluser" password="" />
at IIS webApplication1's properties, tab "Directory Security", at "Authentication and access control" section, I checked "enable anonymous access" with user : DELTA\IUSR_DELTA and checked "Integrated Windows Authentication",
at query analyzer, I login as "sa" and execute script below :
exec sp_grantdbaccess 'delta\sqluser','northwind'
when I run the ASP.NET script, error at conn.Open(); with error message :
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.
What should I do so that IIS login to SQL Server as user delta\sqluser not as "NT AUTHORITY\NETWORK SERVICE" ?
Regards,
Koronx
Your connection string is incorrect. You specify using SQL Authentication (integrated security = false) but what you want is integrated security. However, the connection string for integrated security does not allow you to impersonate a user. You should look for help on configuring your application to impersonate a specific account on an ASP.NET forum at: http://forums.asp.net/.
Thanks
Laurentiu
Monday, March 26, 2012
How to connect to DB with username and passwd?
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?
GreetzYou should use GRANT statement to grant to this user privillege use the DB1 before use that username to login to DB|||have granted access to user manually in DB.
Changed the Conn String an d now it works:
"Data Source=TURM21; Database= Db1 ; USER id= testuser; PASSWORD = testPWD; Trusted_Connection=True ";
Set the Trusted_Connection to true
how to connect to a local sql server on your laptop?
i tried using the username and password i use to log onto my computer. but it doesnt work.
can anyone tell me how to do it?
the code is typed is
connection = new sqlconnection("server=localhost;uid=sekhar;pwd=sekhar;database=chandu")
..................
.............................
........................
connection.open()..............i have all the next statements correct.
my username is sekhar and the password is sekhar too but it gives me an error.
somebody help me
Thank you
sekhartry using server=(local)
and whether you need the password or not depends on how the SQL Server is set up. does the users view show a user called 'sekhar'? no? when you right click the server node and go to properties->security, does it show windows auth only, or Windows and SQL Server auth?
Sunday, February 19, 2012
How to check/verify SQL login Credential
Hi,
I am making a module to backup SQL Db from webpage. I impersonate asp.net user to a given Windows Account and need to verify that account has required permission in SQL Server.
I don't know how to verify the windows account credential for SQL Server login.
Now what I am doing is to run SQL query against database to select row from some table, if it is successful, the user is valid SQL login. But I know it's not the way.
Any idea?
Thanks,
Why don't you just try to login and do the backup and if it fails you know you don't have permission
How to check whether SQL login exists?
Is there any way to check whether the login exists before creating login ?
create login should be executed after check.
thanks,
Sreenath
Try something like this:DECLARE @.SqlStatement nvarchar(4000)
Declare @.loginName varchar (100)
Select @.loginName = 'test\thermanson'
If not Exists (select loginname from master.dbo.syslogins where name = @.loginName and dbname = 'PUBS')
Begin
Set @.SqlStatement = 'CREATE LOGIN [' + @.loginName + '] FROM WINDOWS WITH DEFAULT_DATABASE=[PUBS], DEFAULT_LANGUAGE=[us_english]'
End