Showing posts with label website. Show all posts
Showing posts with label website. Show all posts

Thursday, March 22, 2012

db trigger to avoid duplication of row ? how please

I'm Maintaining an existing website. Many times user clicked the button
twice, which results in duplication of row. now i cant do any modifications.
but i can write an trigger to check any row with same data,time stamp etc.
if so, then delete existing and insert new row with same data. but i do know
about trigger ? how can i achieve this validation using trigger.
Thnkz ,
Mahesh kumar.RCan't you use a UNIQUE constraint? For maintaining uniqueness that
would usually be the method preferred over a trigger.
David Portas
SQL Server MVP
--|||Why not define a primary key or unique constraint on the table?
Or, prevent the user from clicking the button twice, by disabling the
button, once it is pressed.
--
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"~Maheshkumar.r" <mfcmahesh@.hotmail.com> wrote in message
news:%23CDz0EjJFHA.2772@.TK2MSFTNGP14.phx.gbl...
I'm Maintaining an existing website. Many times user clicked the button
twice, which results in duplication of row. now i cant do any modifications.
but i can write an trigger to check any row with same data,time stamp etc.
if so, then delete existing and insert new row with same data. but i do know
about trigger ? how can i achieve this validation using trigger.
Thnkz ,
Mahesh kumar.R

Wednesday, March 21, 2012

DB security on shared ISP server - Newbie

I have a SQL db on a shared server. The db is for an asp website. To
connect to the remote server I use the 'export data/import data'
wizards in Enterprise Manager, logging in with a user ID and password.
When I connect I get a list of all the databases on the server. Is
there anything to stop another user importing my db via Enterprise
Manager? And once they have downloaded it, can they open it easily?
Will SQL server detect an attempt to download a db by anyone other
than the authorised user?SkyBlue (aajjww@.postmaster.co.uk) writes:
> I have a SQL db on a shared server. The db is for an asp website. To
> connect to the remote server I use the 'export data/import data'
> wizards in Enterprise Manager, logging in with a user ID and password.
> When I connect I get a list of all the databases on the server. Is
> there anything to stop another user importing my db via Enterprise
> Manager? And once they have downloaded it, can they open it easily?
> Will SQL server detect an attempt to download a db by anyone other
> than the authorised user?

If you from Query Analyzer perform "sp_helpuser" you can see which users
you have in your database, and which SQL Server logins they map to.
Those logins are the ones that can access your database. Those, and the
logins that are member of server roles with stronger permissions.

On a shared server like the one you are own, database owners should
not have any server-wide permissions, nor be granted access to someone
else's database. But to verify that this is the case, you would have to
ask the admin of the server.

The fact that you cna see other users' databases is not any indication
that you have too much privleges.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.aspsql