Viewing 15 posts - 76 through 90 (of 101 total)
Chim Kalunta (10/1/2009)
ALTER TABLE [dbo].[ForeignKeyTable] WITH CHECK ADD CONSTRAINT [FK_ForeignKeyTable_PrimaryKeyTable] FOREIGN KEY([col_fk])
REFERENCES [dbo].[PrimaryKeyTable] ([col_pk])
ON DELETE CASCADE
The key clause in the code above is the ON DELETE CASCADE. ...
October 5, 2009 at 3:37 pm
Chim Kalunta (10/1/2009)
Would a simple Cascade Delete Foreign Key Relationship not work?
would you be so kind to post an example.
October 1, 2009 at 12:54 pm
Steve Jones - Editor (9/29/2009)
September 29, 2009 at 11:00 am
Steve Jones - Editor (9/29/2009)
You are trying to delete rows that have a FK reference. You need to delete the child rows before you can remove the parent.
ok...so i have...
September 29, 2009 at 10:31 am
Steve Jones - Editor (9/29/2009)
September 29, 2009 at 9:58 am
igngua (9/29/2009)
igngua (9/29/2009)
igngua (9/29/2009)
GSquared (9/29/2009)
September 29, 2009 at 7:54 am
igngua (9/29/2009)
igngua (9/29/2009)
GSquared (9/29/2009)
September 29, 2009 at 7:48 am
igngua (9/29/2009)
GSquared (9/29/2009)
September 29, 2009 at 7:46 am
GSquared (9/29/2009)
Before you jump in and try this on a production database, test it first on a copy of the data that you can replace if it gets messed up.
thanks...
September 29, 2009 at 7:38 am
GSquared (9/29/2009)
If so, try this first:
select replace(desprod,left(desprod,PATINDEX('%/%',desprod)),'')
from dbo.MyTable;
You'll need to use the actual table name, where I have "MyTable".
Does that give you a...
September 29, 2009 at 7:30 am
GSquared (9/28/2009)
@result is just a variable being used for the sample code.You'd use your column name instead.
Thanks!
So the procedure looks like ;
PROCEDURE [dbo].[limpiar]
AS
BEGIN
declare @result varchar(20)
select @result = 'desprod'
select PATINDEX('%/%',@result)
select...
September 28, 2009 at 3:29 pm
GSquared (9/28/2009)
September 28, 2009 at 3:11 pm
what should be @result value...that confused me ...
September 28, 2009 at 2:28 pm
arun.sas (9/25/2009)
declare @result varchar(20)select @result = 'testdb/sysdb'
select PATINDEX('%/%',@result)
select left(@result,PATINDEX('%/%',@result))
select replace(@result,left(@result,PATINDEX('%/%',@result)),'')
thanks !! i dont understand de meaning of this one ...
"select @result = 'testdb/sysdb'"
September 28, 2009 at 1:30 pm
Grant Fritchey (9/25/2009)
September 25, 2009 at 4:21 pm
Viewing 15 posts - 76 through 90 (of 101 total)