Showing posts with label delete. Show all posts
Showing posts with label delete. Show all posts

Friday, March 23, 2012

Please Help

We have turned repliaction off our server but we cannot
delete or modify any of our tables. Any hints ?
Thanks
Jhttp://www.nwsu.com/0974973602.html

Friday, March 9, 2012

pk-fk delete problens

Hallo,
table A
x : int, increment, identity, index
relationship: fk_b_a has pk in A:X , fk in B:X
enforce for repl , insert i update-selected
Table B
x : int, index
relationship: fk_b_a has pk in A:X , fk in B:X
enforce for repl , insert i update-selected
relationship name in B is marked with infinity symbol.
Cant remove record from A, bacause
DELETE statement conflicted with COLUMN REFERENCE constraint 'FK_B_A'.
The conflict occurred in database 'xxx''.
Relevant record from B is removed properly.
CREATE procedure deleteAB(@.ser int,@.rv int output)
as
begin
delete from A where x=@.ser
delete from B where x=@.ser
set @.rv=0
end
what is wrong ?
Tia
pluton> delete from A where x=@.ser
> delete from B where x=@.ser
Its ok, order
pluton

Wednesday, March 7, 2012

PK column

I need to make is to my users can not accidentally delete or replace the pK field, how do I do that anyone got any suggestions??Ummmm..huh :confused:

USE Northwind
GO

CREATE TABLE myTable99(Col1 int PRIMARY KEY)
GO

INSERT INTO myTable99(Col1) SELECT 1 UNION ALL SELECT 2
GO

SELECT * FROM myTable99
GO

DELETE FROM myTable99 WHERE Col1 = 1
GO

SELECT * FROM myTable99
GO

UPDATE myTable99 SET Col1 = 1 WHERE Col1 = 2
GO

SELECT * FROM myTable99
GO

DROP TABLE myTable99
GO|||Ummmm..huh :confused:Yeah, what Brett said.

-PatP|||use pubs
go
deny update, delete on authors (au_id) to public
go|||thank you so much guys I appreciate it :). How do you donate to this website anyways??|||I explained that incorrectly what I am trying to say is I dont want my users to delete, or replace the data in the primary key field. Does that Make sense?|||Then this will suffice:

deny update on <your_table>(<your_primary_key>) to <your_users_or_public>