If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > large storage

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-10-08, 06:30
dsrawat8 dsrawat8 is offline
Registered User
 
Join Date: Apr 2008
Posts: 3
insert folder into sql database

Hi,
how we can insert the folder into the sql 2005 db using asp.net.
Reply With Quote
  #2 (permalink)  
Old 04-10-08, 07:46
Thrasymachus Thrasymachus is offline
SQL Server Street Fighter
 
Join Date: Nov 2004
Location: Down The Rabbit Hole
Posts: 7,979
you need to explain your problem in a little more detail.
__________________
software development is where smart people go to waste their lives
Reply With Quote
  #3 (permalink)  
Old 04-10-08, 10:25
jezemine jezemine is offline
another indirection layer
 
Join Date: May 2004
Location: Seattle
Posts: 1,312
sql server is not a file system.
__________________
elsasoft.org
Reply With Quote
  #4 (permalink)  
Old 04-10-08, 10:29
Thrasymachus Thrasymachus is offline
SQL Server Street Fighter
 
Join Date: Nov 2004
Location: Down The Rabbit Hole
Posts: 7,979
you mean it is not a big electronic filing cabinet. I have to rethink all of my development to date then. Geez, almost 10 years of misconcieved software.
__________________
software development is where smart people go to waste their lives
Reply With Quote
  #5 (permalink)  
Old 04-10-08, 10:33
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
Quote:
Originally Posted by dsrawat8
Hi,
how we can insert the folder into the sql 2005 db using asp.net.
you first have to make sure that you have a table that can actually accept folders

for example...
Code:
CREATE TABLE MyFolders
( MySurrogate INTEGER NOT NULL IDENTITY(937,937)
, MyAlternateSurrogate UNIQUEIDENTIFIER NOT NULL DEFAULT NEWID()
, MyFolder NTEXT NOT NULL
)
unfortunately, this will hold only 1 gig's worth of folder data...
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #6 (permalink)  
Old 04-10-08, 11:17
MCrowley MCrowley is offline
Wage drone 24601
 
Join Date: Jan 2003
Location: Massachusetts
Posts: 4,899
You should probably use binary(MAX) for SQL 2005. You never know if someone wants to put an executable in your folder.
Reply With Quote
  #7 (permalink)  
Old 04-10-08, 11:24
jezemine jezemine is offline
another indirection layer
 
Join Date: May 2004
Location: Seattle
Posts: 1,312
One of my first jobs in the industry was for a company that basically did put a (lame) file system into sql server.

There was a bug that you could login as a folder. that is, create a folder, name it, then use that name to login to the system. awesome! so much more flexible than silly NTFS.
__________________
elsasoft.org
Reply With Quote
  #8 (permalink)  
Old 04-10-08, 11:52
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
the beauty of IDENTITY(937,937) apparently went unrecognized (if not merely unacknowledged)

and having both MySurrogate and MyAlternateSurrogate -- sheer genius, i tell ya!!

__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #9 (permalink)  
Old 04-10-08, 13:33
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,605
I liked it!

You probably ought to include a column for the folder name though.

-PatP
Reply With Quote
  #10 (permalink)  
Old 04-10-08, 14:11
jezemine jezemine is offline
another indirection layer
 
Join Date: May 2004
Location: Seattle
Posts: 1,312
nah, that should be stored in the AttributeValue table.
__________________
elsasoft.org
Reply With Quote
  #11 (permalink)  
Old 04-10-08, 14:17
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
ROFL! and also LMAO!
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #12 (permalink)  
Old 04-10-08, 14:43
jezemine jezemine is offline
another indirection layer
 
Join Date: May 2004
Location: Seattle
Posts: 1,312
AttributeValue is key. because then you can also add a Password attribute and login as a folder. flexibility baby.
__________________
elsasoft.org
Reply With Quote
  #13 (permalink)  
Old 04-10-08, 15:48
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,605
I get it! The AttributeValue table must be what the MyAlternateSurrogate is for. Why didn't I think of that? r937 did good.

-PatP
Reply With Quote
  #14 (permalink)  
Old 04-11-08, 01:22
dsrawat8 dsrawat8 is offline
Registered User
 
Join Date: Apr 2008
Posts: 3
how to insert a folder

we are working on digital repository system in which we are storing desired scan documents as a pdf file in a image data type in sql db.

now, we want to insert all the contents of the any CD in image datatype in the sql database. suppose a cd contains the folder(ABC) and (ABC) folder contains 5 folders and other source code file and backup files. Now, We have to insert ABC folder and its all directories and files. How is it possible?
Reply With Quote
  #15 (permalink)  
Old 04-11-08, 02:42
pootle flump pootle flump is offline
King of Understatement
 
Join Date: Feb 2004
Location: One Flump in One Place
Posts: 14,905
Personally, I would probably drag all the files into a single folder and upload from there. Otherwise, if you want to be flasher or more automated, try using recursive code using the filesystem object in vb or even SQL Server. If you searcvh on google for recursive searches of sub directories using filesystemobject you'll find code.
__________________
Testimonial:
Quote:
pootle flump
ur codings are working excelent.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On