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


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Today @ 7:53 AM
Points: 1,282, Visits: 1,315
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


SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Today @ 2:36 AM
Points: 426, Visits: 384
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: Today @ 12:22 PM
Points: 3,663, Visits: 2,138
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


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Thursday, June 25, 2015 3:43 PM
Points: 2,262, Visits: 917
Thanks.
Post #1437169
Posted Monday, April 1, 2013 1:53 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, February 5, 2015 4:29 AM
Points: 1,028, Visits: 569
Nice one..

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

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 10:28 AM
Points: 2,005, Visits: 7,283
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 2, 2013 11:16 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 9:44 AM
Points: 2,599, Visits: 3,108
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 8, 2013 6:22 AM


SSC-Enthusiastic

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

Group: General Forum Members
Last Login: Tuesday, August 6, 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 9, 2013 12:55 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, April 21, 2015 11:20 AM
Points: 1,129, Visits: 1,167
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: Friday, July 24, 2015 8:43 AM
Points: 3,600, Visits: 2,723
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