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: Monday, July 28, 2014 11:47 AM
Points: 1,019, Visits: 1,003
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: Friday, July 18, 2014 12:55 AM
Points: 386, Visits: 363
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:18 AM
Points: 3,266, Visits: 1,957
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, July 10, 2014 3:25 PM
Points: 2,133, Visits: 867
Thanks.
Post #1437169
Posted Monday, April 1, 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: Thursday, June 5, 2014 8:36 AM
Points: 926, Visits: 556
Nice one..

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

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 1:52 AM
Points: 1,714, Visits: 6,257
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: Yesterday @ 9:23 AM
Points: 2,335, Visits: 2,670
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: Saturday, May 31, 2014 9:19 PM
Points: 1,128, Visits: 1,162
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: Monday, July 21, 2014 6:24 AM
Points: 3,537, Visits: 2,647
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