Send A Messege To User Those Who Access A Specified Database In A Server

Oct 12, 2006

/* -------------------------------------------------

The Following Procedure Helps You To

Send a Messge to all Users

those Who Access a Specified Database in a Server

*/

Create Proc Sp_SendMsg

@Msg Varchar(100),
@DbName VarChar(100)
as

if db_id(@DbName) = Null
begin
Print 'DataBase dose not Exist'
end
else

Begin
Declare @spId Varchar(1000)

DECLARE TmpCursor CURSOR FOR
Select 'master..xp_CmdShell ''Net Send ' + rtrim(convert(Varchar(50), HostName))+' "Dear ' + upper(max(rtrim(loginame)))+ space(1) + @Msg + '"''' as spId
from master..SysProcesses
where db_Name(dbID) = @DbName and
spId <> @@SpId
and rtrim(ltrim(HostName)) <> ''
and HostName <> host_Name()
and dbID <> 0
and spId > 50
group by HostName

OPEN TmpCursor

FETCH NEXT FROM TmpCursor
INTO @spId

WHILE @@FETCH_STATUS = 0

BEGIN

Exec (@spId)

FETCH NEXT FROM TmpCursor
INTO @spId

END



CLOSE TmpCursor
DEALLOCATE TmpCursor

end

View 2 Replies


ADVERTISEMENT

Create Database Diagram And Send To User

Aug 11, 2014

I've been tasked to create a database diagram, save it and send that db diagram to the user. Now, I am confused as I don't know where sql server stores the db diagram...what is the path where it stores the diagram. How do I export it in case if I need to provide it to the user. How, am I supposed to grant user permission so he himself can create a database diagram.

View 9 Replies View Related

Unable To Send Database Mail To External User

Jul 13, 2015

I have two domains. forest domain abc which has the exchange infrastructure. forest domain xyz which does not have exchange. There is a two way trust set up.

I have set up database mail which sends internally but not externally on the xyz domain its uses mailrelay address to comunicate with exchange. The receive connector is set up correctly on exchange on domain abc as I have managed to send email from a sql server to external contact in the abc domain.

The IP addresses are correct on the receive connector.

The problem is I am unable to send to an external contact from the sql server in the xyz domain. Not sure if this an exchange issue or database mail.

View 2 Replies View Related

SQL Security :: How To Find Who Alter Database User Access Changes In Server

Oct 6, 2015

someone was alter user  databases owner access.

how to find  who alter evoke  the database user access changes in sql server.

View 5 Replies View Related

How To: Determine If Current Windows User Has Login Access, Database Access And If They Are A Member Of A Specific DB Role.

Mar 25, 2008


I need to determine the following about the current authenticated Windows domain user who is trying to access a SQL Server via a trusted connection.

1 Has the current user been granted login access to the trusted SQL Server?

2 Has the current user been granted access to a specific database?

3 Is the current user a member of a specific database role such as (DB_ROLE_ADMINISTRATORS)?

Thanks,
Sean

View 6 Replies View Related

SQL Server 2012 :: Query To Find User Who Last Modified User Roles / Access?

Dec 6, 2013

I would like to know if there is a way to find out who changed a users roles/access WITHOUT using the audit function. For example, if a user account was created and given SA access then changed to read only, how can I find out who made that change? I tried searching for an answer, but kept getting no results. I'm thinking this may tie into the sys.sysusers view?

View 3 Replies View Related

Multi-user Access Through A Data-access Layer/remoting Server

Oct 30, 2007

Hi guys,

I've been developing desktop client-server and web apps and have used Access and SQL Server Standard most of the time.
I'm looking into using SQL CE, and had a few questions that I can't seem to get a clear picture on:

- The documentation for CE says that it supports 256 simultaneous connections and offers the Isolation levels, Transactions, Locking, etc with a 4GB DB. But most people say that CE is strictly a single-user DB and should not be used as a DB Server.
Could CE be extended for use as a multi-user DB Server by creating a custom server such as a .NET Remoting Server hosted through a Windows Service (or any other custom host) on a machine whereby the CE DB would run in-process with this server on the machine which would then be accessed by multiple users from multiple machines??
Clients PCs -> Server PC hosting Remoting Service -> ADO.NET -> SQL CE

- and further more can we use Enterprise Services (Serviced Components) to connect to SQL CE and further extend this model to offer a pure high-quality DB Server?
Clients PCs -> Server PC hosting Remoting Service -> Enterprise Services -> ADO.NET -> SQL CE

Seems quite doable to me, but I may be wrong..please let me know either ways

Thanks,
CP

View 3 Replies View Related

User Database Access

Jul 7, 2000

When I try to give a login access to a database I get the message:
Error 21002: [SQL-DMO] users already exist in the database.
I checked sysusers for the database and the users name is in there, even if the user has no login.
Is it okay to just delete the record that has the users name from sysusers?
Thanks

View 1 Replies View Related

Cannot Access User Database

Jun 11, 2007

Downloaded and install SQL 2005 on 2003 member server. Downloaded and ran SQLServerSamples.msi, AdventureWorksBI.msi, AdventureWorksDB.msi, and AdventureWorksLT.msi.



When I go into Sql Server Management Studio I cannot find the Adventure Works database under databases. How do I access it?



Thank you.

View 3 Replies View Related

Integration Services :: Send Mail Task Error - Attempt Was Made To Access Socket In A Way Forbidden By Its Access Permissions

Aug 18, 2015

I have trying to execute the Sendmail task in my development envinorment i face this error..I have given the clear details error message below,Please have a look.

[Send Mail Task] Error: An error occurred with the following error message: "Failure sending mail.  System.Net.WebException: Unable to connect to the remote server  System.Net.Sockets.SocketException: An attempt was made to access a socket in a way forbidden by its access permissions ".Alternatively  i use the  SMTP connection to create the subscription as well,its working properly.

Here we are accessing SMTP connection manager as Virtually.Here in my client network we are using Macafee Anti virus ,We have excluded the Rsconfigration file in the excluded list.I dont know why this problem occures again using Sendmailtask in ssis?

View 2 Replies View Related

Exclusive User Access To Database

Sep 29, 2007

Hi All,

My question is regarding SQL Server database security. I want to create a login using SQL Server Authentication and assign it db_owner rights for my database. So far so good. But the critical part is that I want to give exclusive rights for my database to this user only i.e. no other users (dbo, guest etc) should be allowed to access my database.

It will be good to present here the scenario which I need to implement. I am running an ASP.NET application that uses SQL server 2005 db at back end. The database server might have other databases as well but I don't want the administrator (either SQL server admin or the server administrator) to be able to get access to my database or even view the schema. I don't want any other user except my own user to be able to detach the database or perform backup or restore operations.

I hope I was able to deliver the requirement.

View 6 Replies View Related

Multi-User Access Of SQL Database

Sep 11, 2007

Please help....
I have designed an application that uses sql server 2005 express database. This application was intended to be installed and used on a local desktop machine. However, now this application needs to be also installed on several computers and still needs to use only 1 database. Part of the database saves local user settings, so what I have done thus far is use two connection strings: one for local database (because the application may be used as origionally intended) and one for remote database that everyone should be able to connect to.

When I remotely connect to the database, it works fine. However, it seems to be locked so when I chose the same database for another user I get the error message "This File Is In Use." I need to know how to unlock it and make it usable for several users at the same time.

Thank you for your help! Please let me know if you need more information or if something is unclear in my description.

View 6 Replies View Related

Access To Database By Local Admin User

Feb 10, 2014

I am newbie to SQL.I need to create an application will run on server, and of course will be installed by using admin user. I can use the install user to access to database on that server?

View 1 Replies View Related

How To Assign Database Access Privilege To User?

May 26, 2008

Hi friends,
I have created a database DB1 using CREATE DATABASE DB1 command. Then i created login name using CREATE LOGIN login1 WITH PASSWORD = 'password1' command and created user name using CREATE USER user1 FOR LOGIN login1 command. Now i have to assign the user1 to the database DB1.
Any one please tell me how to assign DB1 access privilege to user1?


Thanks in Advance


Sathish kumar D

View 1 Replies View Related

Creating A User That Has Full Access To A Database

Mar 17, 2008

Hi,

How do I create a user that has full access to a database using only SQL statements?

I've create very basic database called "sampledb".

Then I've done:

CREATE LOGIN sampleuser WITH PASSWORD = '123sampleuser', DEFAULT_DATABASE = sampledb;
USE sampledb;
CREATE sampleuser FOR LOGIN sampleuser WITH DEFAULT_SCHEMA = 'db_owner';

Then I logon to SQL server express 2005 management studio using this user, first of all I do not see the sampledb database listed under "databases" even though it is selected in the "available databases" toolbar (how do I list it there? Because going through "attach..." tells me I do not have the privileges to browse for the database to attach).

I then open up a new query (sampledb is selected), and type (products is one of the table in sampledb):
select * from products;

And I get:


Msg 229, Level 14, State 5, Line 1

The SELECT permission was denied on the object 'Products', database 'sampledb', schema 'dbo'.

Shouldn't the chosen schema (db_owner) give me the right to do this? And how do I fix this from the query window (without going through the GUI, just using SQL statements)? And how do I list sampledb under the databases when I log in as this user?

Thank you!
-Yannick


View 1 Replies View Related

Logging With Another System User Cannot Access My Database

Mar 3, 2008

Hi,

I am using SQL Server Express Edition 2005 as a backend database working with Visual Basic 2005.

I am using Vista and having two users to access to my computer. User-1 and User-2.

I created a database in User-1 and works fine Visual Basic 2005.

Now the problem is when i login to my computer system with User-2. I cannot able to access the database with encountering error like "User-1/SQLExpress". I know that i cannot able to access to database which was created in User-1.

Do you any solution to this problem. when i login with user-1 and user-2 it should able to access database.

Thanks.

Regards
Kashif Chotu

View 1 Replies View Related

How To Access Database In Single User Mode All Time

Aug 23, 2004

Dear All,
I want my SQL database to be accessed always in a single user mode through my application. How can I do this ?

Thanks in advance.

Sushma

View 5 Replies View Related

SQL 2012 :: Efficient Way To Monitor User Access To Database

Apr 22, 2014

Currently there are various teams accessing the database. For costing reasons, we need to track usage.Is there an efficient way to monitor User access to the database.Can we track which user has executed which query(SELECT,insert etc),the login time and such parammeters?

View 5 Replies View Related

Returning Success Message To User - Access Database

Apr 26, 2008



Hi all,

I have a SSIS package that copies data from one database, into another, makes a backup, and then FTP's up the backup to a web server. In Sql Server I've made a job to run the package and a Stored procedure to activate the job from an Access database front-end.

Can anyone tell me how I might return a success/failure message to my access user?

Thanks
Melt

View 2 Replies View Related

Grant User Group Select Access To All Views In Database

Sep 24, 2013

I'm trying to grant a user group select access to all the views in a database. I already made a query which creates a result set whit the SQL Syntax I (displayed below) need but it seems to be impossible to get this result set executed after creation.

use [AdventureWorksDW2008R2]
SELECT
'GRANT SELECT ON [' + SCHEMA_NAME(Schema_id) + '].[' + name + '] TO [DOMAINGROUP]'
FROM sys.views;

View 5 Replies View Related

Data Access :: Grant A User Permissions To Only One Table In A Database?

Jul 28, 2015

How do I grant a user permissions to only one table in a database.  How would it affect him using our Main App which is NAV with regards to his user's permission in NAV

View 2 Replies View Related

User Is Not Able To Access The Database Model Under The Current Security Context

Feb 7, 2008

I have a restriced user on SQL Server that is only permitted to creat a new database and manage it only. All other database are hidden to that user.

when that user login to SQL Server and create a database and try to change the default folder path for data and log files, gets an error,

The Server principal "User" is not able to access the database "model" under the current security context. (MSSQL Server, Error: 916)

Any idea???

Thanks,

View 7 Replies View Related

SQL Database User Account Access Remotely Via SQL Management Studio Express

Aug 20, 2007

Hi, I hope you can help.I have configured a Windows 2003 web server and SQL 2005 Server (on same box) to successfully allow remote connections and to allow access via SQL Server Management Studio Express 2005.The problem I have is that I want to restrict access to the databases on the server via the Management Studio to specific databases e.g. 1 database user "sees" only 1 database.I can configure it so that the user's remote  access permissions do not allow access to other databases but they can still "see" the database listed in the Management Studio explorer.I can also configure it so that the users cannot see all the databases (by disabling View All Databases on SQL Server), but this means that they cannot not see their own database which they have permissions for.Is it impossible to have the desired behaviour of only displaying the database which the remote user accessing has permissions for and hiding all other databases?I have MSN'd,Googled and Yahoo'd this one to no avail :(Many thanksFergus 

View 6 Replies View Related

Restricting Data Access To System Database And Visibility To All Other User Databases...!

Jan 31, 2008

Hi,

How would I set permission for SQL Server 2005 "User A" to prevent access to System and other user databases, also How to hide the databases that "User A" has no rights to. I mean, when User A logs in, All other user databases are not visible to him/her.

Thanks,

View 6 Replies View Related

User Is Rejected To Access Database From Crystal Report Client And Services...!

Dec 18, 2007

We are using Crystal Report Services XI to generate reports from SQL Server 2000 database running on server within the same domain (LAN).

for some reason, SQL Server is rejecting the Credentials that is provided to CR Services, the user has right to that database. When We run the report manual, it works fine, but when we run Automatic on schedule , it fails.

The Authentication mode is set to Mixed.

The Startup Service accoutn is set to "This Account"

Any idea, why would this failure on User is encoutered.

Thanks,

View 1 Replies View Related

Send A File From Database Without Saving It To Server First!

Jan 2, 2007

hi
I have binary files inside my database. and user should have the opportunity to download them from database to his computer. I don't want to retrive and save the file into the server first and then let him to download. is it posible???
thank you in advance
regards

View 3 Replies View Related

SQL Server Admin 2014 :: Send Database Mail Only Once

Apr 14, 2015

I have a job under the SQL Server Agent, which is configured to send an email notification on failure.

The job is scheduled to run every 30 minutes.

Is it somehow possible to configure it so that it only sends one email in case of subsequent failures instead of "spamming" my inbox every half hour?

View 4 Replies View Related

Sp To Send A Message To A User ?

Sep 23, 2006

Do you know a stored procedure ( or a query) to send a message to a SQLServer user ?

Something like NET SEND but with a spid user

Thanks

View 4 Replies View Related

Trying To Send Message To User

Jan 14, 2004

I am having a problem getting informational type messages to display for my end users.

I have a SQL2000 db with a Delfi front end. When I issue either the raiserror or print nothing is displayed inside the app. With raiserror I can get it to display if I make the severity higher than 10. The problem with this is that it stops the app from processing the transaction. This is ok in one case but not with just informational type stuff. Any suggestions? Thanks.

Jim

View 1 Replies View Related

DB Engine :: Send Multiple Attachments With Database Mail In Server

Aug 20, 2015

I am sending multiple attachments with database mail for that i have created script to generate file names and send it to mail. Below are my script

DECLARE @MailFile VARCHAR(100)
SET @MailFile = 'Detail_Reimbursement_1_15_'
+ LEFT(CONVERT(VARCHAR, Getdate()), 3)
+ Substring(CONVERT(VARCHAR, Getdate(), 100), 8, 4)
+ '.csv'

[Code] ....

The script is working fine if i manually provided file path to @file_attachments. it is showing error i passes the variable @Loc3 to @file_attachments. Below is the error if i passes the variable to @file_attachments parameter.

(1 row(s) affected)
(1 row(s) affected)
(1 row(s) affected)
Msg 22051, Level 16, State 1, Line 0
Attachment file 'E:DatabaseTannaFinanceReportDetail_Reimbursement_1_15_Aug2015.csv is invalid.

View 2 Replies View Related

SQL Server 2008 :: 2 Emails Being Send From Job When Only 1 Should Send?

Apr 18, 2012

I have a job that emails out shipment notifications at the end of the day to our customers. The problem I have is I don't understand why the same email is sending out twice within a minute of each other when the job is only scheduled to run once. If I take the code out of the step and run it in management studio it only emails once. I attached the code for one customer for reference. We are running SQL 2008 on a VM sending to an exchange 2010 server.

DECLARE @tableHTML NVARCHAR(MAX) ;
SET @tableHTML =N'<H1>XYZ Company ASN For ' + CONVERT(VARCHAR(10), GETDATE(), 101) + ' </H1>' +
N'<table border="1">' +
N'<tr><th>Vendor</th><th>Delivery Date</th>' +
N'<th>Purchase Order Number</th><th>Item Number</th><th>Item Description</th>' +
N'<th>Quantity Shipped</th><th>UOM</th><th>BOL Number</th>'

[code]....

View 9 Replies View Related

SQL Server 2008 :: Monitor Database Growth And If Any DB Grown By 20% Send Mail Alerts

Apr 30, 2015

Is there any automated script available to - "Monitor Database Growth and if any DB is grown by 20%, sending mail alerts"? If not, what is the approach to write the T SQL script ?

View 5 Replies View Related

Aspnet User Can Not Access Sql Server

Sep 13, 2005

We have an ASP.net application that currently sits on a server that runs IIS and sql server. We are spliting IIS and SQL server into 2 seperate machines. I believe I have the connection string okay as I can see the entries in the security log on the sql server machine however it keeps saying aspnet user invalid user or invalid password.  What gives with this.  We put .net on the sql server however this just added the aspnet user to the machine. Do I need to create an aspnet user inside the sql server and give it control of the dbases as well?  I am running this using the personal web server not IIS on a server.  I have a project on my desktop and am using the "local" IIS or personal web server that comes with visual studio out of the box.  What kills me is that when I put the project on a real IIS server that has sql server on the same machine I have no issues.  However when I split the dbase and the IIS apart onto 2 servers I get this aspnet invalid user or invalid password.  HELP

View 5 Replies View Related







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