.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How to get notification if a new login is created in SQL Server??

Posted By:      Posted Date: October 21, 2010    Points: 0   Category :ASP.Net


I have a requirement wherein to automate a process that when a new login is created in SQL Server 2005, I need to execute code to add the newly created username to another user table in my database.

I am aware of the system tables that can be queried to pull out the list of logins that exist in SQL Server database and identify any newly created logins.

However, I am looking at an alternate solution that allows me to get notified when a new login is created. It would be more like a trigger. Since I am dealing with system tables, I don't want to user triggers on system objects.

I have come across SQL Server Notification Service but I am not sure if it would be an appropriate feature to use for such a requirement.

If anyone knows of a better solution or if SQL notificaition services can be used for this, please share your thoughts.




View Complete Post

More Related Resource Links

send the login credentials from site to another server



  i have a site which uses windows credentials to login and in the site i have link to ssrs server.

when i select the report it asks for authentication which i want to skip and send the same user

crendentials to the ssrsserver to access the report.

can anyone suggest on this..

remove server name from login name

hi, is it possible to remove the servername that appear infront of the login name when the user login? when the user login i see the loged in name like this: server\username can i change this to only the user's name? thnx

MS Word Component Not Getting Created on Windows 2008 64 bit Web Server Edition When I Try Using ASP

Hi All, This might look like a similar question to a lot of you considering there are a lot of web activity happening in terms of blogs/forums/suggestions that I have seen with reference to changes that one needs to do in COM+ Services to enable their ASP.NET Web Application to be able to create Word Objects & I have actually used them personally & they worked for me on Windows 2003 32 bit/64 bit servers. The issue started some 1 month back when I was told that we are upgrading our server to Windows 2008 Web Server edition 64 bit ‘cause of some real benefits it offers if used only as a web server. This was just great as we tested a lot of features /functionality that we were using on our existing server & everything seems to be working just fine on this product by Microsoft. However we also have one web module which is responsible for opening up a MS Word 2007 template file at runtime and fill it with data & is then converted into a PDF document. A lot of ideas on Web suggested that we should move onto Open XML standards to generate documents at runtime, which I have been able to do with no issues. But one activity which still requires me to create a Word document is when I have to convert/SaveAs the Word (docx) document into PDF. I tried all the COM+ & registry related changes that I did on my Windows 2003 64 bit server, but nothing seems

SSL Using Server Created Certificate

We need to secure a SQL server using an SSL certificate and I understand there are a couple of ways of doing it.  One of which is having SQL Server generate a self-signed certificate which exposes the man-in-the-middle attack vulernability.  Thus we want to avoid this approach.  My question is, can we just allow the Windows Server 2003 we are running to be configured to be a Ceriifcate Authority and ust it create an SSL certificate.  Is that just a secure as getting an SSL certificate from a third party company such as Verisign?  If it is better to go with a third party company, how do you get a certificate from them when it is not going to be used for a website? Thanks NickNick's Programming Tips

Login to SQL, using Windows 7, SQL Server Error 18452, "Login failed. The login is from an untrusted

I have a File/Sharing Server which is Server 2008 SP2 and SQL Server 2008 is installed on it. My system which is on the same workgroup, was running Windows 2003 Server, which I have saved Server 2008 login credential on it and used that credential to login to SQL Server on Server 2008 system in Windows Authentication mode using SQL management studio. Recently I installed Windows 7 on that system, and I have also saved that Server 2008 credential in Windows 7 Credential Manager. The problem is here when I want to login in Windows Authentication mode using SQL management studio like past, and I will get below Error: Cannot connect to [SERVER] Login failed. The login is from an untrusted domain and cannot be used with Windows authentication. (.Net SqlClient Data Provider) Error Number: 18452 Severity: 14 State: 1 Line Number: 65536 I tried that registry solution (DisableLoopbackCheck=0x01 this thread), but no luck with that. I have checked the outgoing packets when I click on connect, and I found out that SQL management studio tried to send my local windows credential instead of Server 2008 saved credential. I don't want to login in SQL Mode, and also I don't want to convert my server to Domain controller. Is there any other solution with this issue? Regards

Login Failed for User "XXX" when login from a ETL machine for Sql Server 2005 SP2

Hi Guys, I have a straange issue with Login Failed errors coming intermittently probabaly twice in a week: I have a  production Database on Server A and we have Two ETL servers on Server B and Server C. Sometimes when the ETL's (SSIS) run from SERVER B I do get an error stating login failed for user "XXX" this user is a sql server user. And when I run the same package from Server C it does not give any error and runs smoothly. Both the packages uses the same configuration file to connect to the same database with the same user credentials. Also this error is not a frequent error but comes along once or twice in a weeK. Can anyone shed some light on this and let me know the root cause. Both servers have the same sql client version as well. All servers mentioned above are 64 bit windows 2003 servers. Raju

Login failed for WINDOWS Administrator login. (Microsoft SQL Server, Error: 18456)

Hi All, I am using SQL server 2008. While adding SQL user i unknowingly deleted the SQL authentication user from SQL server. Now the problem is i can not login with Windows Authentication neither i can login as "sa" user as this user is disabled. Please suggest me how to get in to SQL server management studio. Database is up and running but i can not access the database any more after doing this blunder. Please suggest me how to recover SQL instance, Thank you.

System DSN created on x64 08 server but not visible - SQL08 x64 to be used by x32 app

Hi all, I am trying to create a SystemDSN on a 64bit Windows 2008 server. The application that will use it is a 32bit app so i go into C:\Windows\SysWOW64 and run as admin odbcad32.exe I then go ahead to create a systemDSN to a SQL2008 database using the SQL native client. All off the steps of the systemdsn creation wizard go thrugh and i get a success at the end. But then i get no new systemDSN listen in the box. The user that is doing the creation is a domain administrator and also in the admin group on the particular server. This is really strange to me. Has anyone seen this behaviour? SQL server 08 is x64 on a x64 machine. The reason i am using the 32bit ODBC is beacause the app is x32 app. Any advice? Cheers Dan

create a sql server 2005 new login for SQL Injection prevention

    Hi All,  Thank you for advance. Our database affected with SQL Injection. so We need to create a sql server 2005 new login for SQL Injection prevention User can perform, access tables with select,update and delete queryaccess views, functions and stored procperform cursor     what are the permissions given for that login account?

SQL Server 2005 "Login failed for user" sa

I have not been able to install SQL Express SP2 (standard or advanced) on Vista Ultimate (RTM). Every time I try to install, I get the following error message: SQL Server Setup could not connect to the database service for server configuration. The error was: [Microsoft][SQL Native Client][SQL Server]Login failed for user 'sa'. Refer to server error logs and setup logs for more information. When I check the logs, the only information I can find that is at all useful is: Doing Action: Do_sqlScriptPerfTime Start: Do_sqlScript : Thu Mar 01 21:35:42 2007Service MSSQL$SQLEXPRESS with parameters '-m SqlSetup -Q -qSQL_Latin1_General_CP1_CI_AS -T4022 -T3659 -T3610 -T4010' is being started at Thu Mar 01 21:35:42 2007SQL service MSSQL$SQLEXPRESS started successfully waiting for SQL service to accept client connectionsService MSSQL$SQLEXPRESS started at Thu Mar 01 21:35:48 2007SQL_ERROR (-1) in OdbcConnection::connectsqlstate=28000, level=-1, state=-1, native_error=18456, msg=[Microsoft][SQL Native Client][SQL Server]Login failed for user 'sa'.         Error Code: 0x80074818 (18456)Windows Error Text:   Source File Name: lib\odbc_connection.cppCompiler Timestamp: Wed Jun 14 16:28:15 2006     Function Name: OdbcConnection::connect@connectSource Line Number: 148 Has anyone else run into this issue and resolved it? I have seen posts for earlier versions of SQL Express that said to run

SharePoint 2010 AD FS 2.0 Integration - login works then fails, looping back to the adfs server

Hello, I setup SharePoint 2010 Claims auth with AD FS 2.0 following this post: http://blogs.technet.com/b/speschka/archive/2010/07/30/configuring-sharepoint-2010-and-adfs-v2-end-to-end.aspx.  I have no access to the ADFS server, but I think they followed the steps as outlined.  If I do an iisreset (or just recycle the app pool of the SharePoint site) I can login successfully using the remote credentials.  Also I can under security in SharePoint search for and find users and roles from the remote ADFS server. If I close my browser, open a new browser and go to the site I am prompted to login again (this is fine).  I do, using the same credentials, and the login fails because I am redirected between the SP and ADFS servers until the ADFS server stops the redirecting.  I have been doing some digging and I found this post: http://blogs.technet.com/b/speschka/archive/2010/08/09/setting-the-login-token-expiration-correctly-for-sharepoint-2010-saml-claims-users.aspx, which describes the situation I have in point # 3 at the bottom.  I have tried setting the token time out as low as 1 second but this hasn't helped. I have also, just to see, tried setting all the other lifetime settings to 1 second - but no luck.  Because the initial login works I think the setup is correct, but something is maintaining some state that is causing the loop

Can not login to SQL Server 2008 R2 Express

I installed Visual Studio Web Developer 2010 express edition in a 64 bit windows 7 version. While installing applications, it showed error like cannot login using username sa which I ignored and continued installation. After installation is over, I tried to login SQL Server Management Studio and both SQL server authentication and Windows authentication failed. Can you please let me know 1. What is the default user name of SQL server express? 2. I also tried to select the configue option and there it is displaying Install SQL server 2008 R2. But I am quite sure I installed it.   Please help since I am very new to windows and dot net. I was basically a LAMP guy and thought to start learning dot net and windows technologies. Regards Anirban

Server failed with error code 0xc0000000 to spawn a thread to process a new login or connection

Hello All, Suddenly, the sql server is down, in the log file, C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG, I found the record as follows, 2007-03-05 15:40:31.59 Logon       Error: 17189, Severity: 16, State: 1.2007-03-05 15:40:31.59 Logon       SQL Server failed with error code 0xc0000000 to spawn a thread to process a new login or connection. Check the SQL Server error log and the Windows event logs for information about possible related problems. [CLIENT:] What else I can do to further investigate? Thanks Spencer

proactive caching, sql server notification problem

I'll explain the problem with this simple example. I have a dimension and a fact table: CREATE TABLE [dbo].[Lead_Dim](   [Id] [int] NOT NULL,   [LeadSource] [nvarchar](50) NULL,   CONSTRAINT [PK_Lead_Dim] PRIMARY KEY ([Id]) ) GO CREATE TABLE [dbo].[Lead_Fact](   [Id] [int] IDENTITY(1,1) NOT NULL,   [LeadAmount] [float] NULL,   [Lead_Id] [int] NULL,   CONSTRAINT [PK_Lead_Fact] PRIMARY KEY ([Id]),   CONSTRAINT [FK_Lead_Fact_Lead_Dim] FOREIGN KEY([Lead_Id]) REFERENCES [dbo].[Lead_Dim] ([Id]) ) GO In the cube, I've enabled proactive caching for dimension and measure group partition. I use SQL Server notification (tracking table is 'Lead_Dim' for dimension and 'Lead_Fact' for measure group partition). Other properties are set to default (silence interval 10s,...). When I insert a record in the dimension and a record in fact like this: DECLARE @LeadId INT SET @LeadId = 1 INSERT INTO [Testing].[dbo].[Lead_Dim] ([Id], [LeadSource]) VALUES (@LeadId, N'Agent') INSERT INTO [Testing].[dbo].[Lead_Fact] ([LeadAmount], [Lead_Id]) VALUES (1.2, @LeadId) GO proactive caching processes both dimension and partition and cube measure is refreshed. But, when I run this: DECLARE @LeadId INT SET @LeadId =2 INSERT INTO [Testing].[dbo].[Lead_Dim] ([Id], [LeadSource]) VALUES (@LeadId, N'Agent') WAITFOR DELAY '00:00:02' INSERT INTO [Testing].[

Login goes to Sql server for users and to sqlExpress for roles

Hi all,I have a site witl forms authentication using te login control. I altered my sql server, I added a connectionstring and used the connectionstring in both, <rolemanager> and <Membership>. That part of the web.config is listed below.The pronlem is that the login control goed to SQLserver to check the users and their passwords, but it goed to the SQLExpress database for the roles..... who can help me because it's driving me crazy!!!!!!<connectionStrings>    <clear/>    <remove name="Conn"/>    <add name="Conn" connectionString="Server=SERVER;Database=DBNAME;User Id =USERNAME;Password=PASSWORD;Integrated Security=False"                       providerName="System.Data.SqlClient"/>    <remove name="LocalSqlServer"/>    <add name="LocalSqlServer" connectionString="Server=SERVER;Database=DBNAME;User Id =USERNAME;Password=PASSWORD;Integrated Security=False" providerName="System.Data.SqlClient"/>  </connectionStrings>  <system.web>    <membership>      <providers>     &nbs

Installing SharePoint 2010 with SQL Server 2008 - SQL Exception - Login Failed

Hello I've been trying to install SharePoint 2010 with SQL Server 2008 in my Windows Server 2008 R2 box. I've got the same error all the times. System Specifications Windows Server 2008 R2 SQL Server 2008 with SP1 SharePoint 2010 Enterprise 6GB RAM, 320GB HDD Installation Steps I followed Installed Windows Server 2008 R2 and joined it to our domain Logged in as domain administrator Installed SQL Server 2008 Selected the Local Service account for all the SQL Server 2008 services during installation Selected Mixed mode authentication Selected 'Add Current User' in all the other installation screens Installed SQL Server 2008 SP1 Installed SharePoint 2010 Selected Farm option Selected Complete Installation Tried to run the configuration wizard and got sqlexception error - login failed But i checked that the current user (domain admin) is having all the permissions. Also added the domain admin as Security Admin and DB Creator in SQL Server instance. Any ideas?  Regards NLV Visit SharePoint User group - India

Purpose of "NT AUTHORITY\SYSTEM" login in SQL Server 2005

Hi All Does anybody know what the "NT AUTHORITY\SYSTEM" login create during a SQL Server 2005 instillation is used for? Does this login pose a security risk, and can it be removed safely?  It seems to me as if it is similar to the "Bultin\Administrator" login which we remove from our production servers? Regards Stevo
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend