Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase «««1234»»

Truncate Table Expand / Collapse
Author
Message
Posted Thursday, March 28, 2013 2:00 PM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Today @ 2:02 PM
Points: 979, Visits: 972
Thank you for the posting.
We have many different ways to approach it. Is it a good idea or a bad idea?


--------------------------------------
"Stay Hungry, Stay Foolish." ― Jobs
“Everything has beauty, but not everyone sees it.” ― Confucius

Post #1436718
Posted Friday, March 29, 2013 3:52 AM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Tuesday, April 08, 2014 12:30 AM
Points: 382, Visits: 344
gmby (3/28/2013)
good question. but for the life of me, i cannot come up with a reason to use this (nor anyone else where I work)- anybody?

jg


This scenario is often used for hierarchy. Stewart provided an example above.


--------------------------------------------------------------------------------------
Hai Ton
My Db4Breakfast blog.
Post #1436853
Posted Friday, March 29, 2013 10:00 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Wednesday, April 16, 2014 9:46 AM
Points: 3,150, Visits: 1,900
Outside of a hierarchy example, I can't think of when you would have a table foreign key reference to itself.
Post #1436999
Posted Friday, March 29, 2013 7:07 PM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Tuesday, April 01, 2014 1:34 AM
Points: 1,950, Visits: 817
Thanks.
Post #1437169
Posted Monday, April 01, 2013 1:53 AM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Wednesday, April 16, 2014 5:16 AM
Points: 905, Visits: 553
Nice one..

--
Dineshbabu
Desire to learn new things..
Post #1437372
Posted Tuesday, April 02, 2013 2:55 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: 2 days ago @ 7:26 AM
Points: 1,658, Visits: 6,002
KWymore (3/29/2013)
Outside of a hierarchy example, I can't think of when you would have a table foreign key reference to itself.


A piece of machinery that is no longer available because it has been superseded by a different piece of machinery, something like

create table MachineryParts(
PartID int identity not null primary key,
PartDescription nvarchar(100) not null,
IsAvailable bit not null,
ReplacedByPartID int constraint fkMachineryPartsReplacement foreign key references MachineryParts
)

Post #1437755
Posted Tuesday, April 02, 2013 11:16 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Yesterday @ 12:38 PM
Points: 2,290, Visits: 2,545
Strange situation, but informative.

Thanks for the question.

- webrunner


-------------------
"Operator! Give me the number for 911!" - Homer Simpson

"A SQL query walks into a bar and sees two tables. He walks up to them and says 'Can I join you?'"
Ref.: http://tkyte.blogspot.com/2009/02/sql-joke.html
Post #1438017
Posted Monday, April 08, 2013 6:22 AM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Tuesday, August 06, 2013 4:34 AM
Points: 136, Visits: 79
+1 :)

Angad


--Angad Singh
If I Stop Learning, I Cease to Be A SIKH !
Post #1439781
Posted Tuesday, April 09, 2013 12:55 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Wednesday, April 09, 2014 9:03 PM
Points: 1,128, Visits: 1,161
nice and straightforwad - instinct worked for me ..

~ demonfox
___________________________________________________________________
Wondering what I would do next , when I am done with this one
Post #1440174
Posted Monday, April 22, 2013 1:55 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Wednesday, April 16, 2014 6:04 AM
Points: 3,517, Visits: 2,606
I got it correct. However assuming some other logic but anyways got corrected by the explanation and got one point (to my bonus)
Post #1444887
« Prev Topic | Next Topic »

Add to briefcase «««1234»»

Permissions Expand / Collapse