Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Database Schema to represent directory structure

Database Schema to represent directory structure

Scheduled Pinned Locked Moved Database
databasequestiondata-structurescollaborationxml
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    Fadi Yoosuf
    wrote on last edited by
    #1

    Hi I am planning to implement a custom version control system. Is there anyway to represent physical directory structure in database? Or should I represent them using 'tree' data structure? If using tree data structure, how can I save the contents of tree to an external file?? thanks fadi

    B M 2 Replies Last reply
    0
    • F Fadi Yoosuf

      Hi I am planning to implement a custom version control system. Is there anyway to represent physical directory structure in database? Or should I represent them using 'tree' data structure? If using tree data structure, how can I save the contents of tree to an external file?? thanks fadi

      B Offline
      B Offline
      Bassam Saoud
      wrote on last edited by
      #2

      which version of SQL are you using? If SQL Server 2008, you may want to look at the FileStream Datatype[^] I guess you can create a self referencing table [ heirarchical ] and either use the datatype above or file path and have some code to export it out. I dont know exactly what you want to do but it seems dangerous:)

      1 Reply Last reply
      0
      • F Fadi Yoosuf

        Hi I am planning to implement a custom version control system. Is there anyway to represent physical directory structure in database? Or should I represent them using 'tree' data structure? If using tree data structure, how can I save the contents of tree to an external file?? thanks fadi

        M Offline
        M Offline
        Mycroft Holmes
        wrote on last edited by
        #3

        Along with the filestream storage you can use the hierarchicyid you define your tree structure but you are going to have a coordination problem between the physical structure and the hierarchy in the table. The filestream will not allow you to move the files via explorer so that would be one benefit.

        Never underestimate the power of human stupidity RAH

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups