| |
|
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.
|
 |
|

04-10-08, 06:30
|
|
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.
|
|

04-10-08, 07:46
|
|
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
|
|

04-10-08, 10:25
|
|
another indirection layer
|
|
Join Date: May 2004
Location: Seattle
Posts: 1,312
|
|
|
|
sql server is not a file system.
|
|

04-10-08, 10:29
|
|
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
|
|

04-10-08, 10:33
|
|
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...
|
|

04-10-08, 11:17
|
|
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.
|
|

04-10-08, 11:24
|
|
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.
|
|

04-10-08, 11:52
|
|
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!!

|
|

04-10-08, 13:33
|
|
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
|
|

04-10-08, 14:11
|
|
another indirection layer
|
|
Join Date: May 2004
Location: Seattle
Posts: 1,312
|
|
nah, that should be stored in the AttributeValue table.
|
|

04-10-08, 14:17
|
|
SQL Consultant
|
|
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
|
|
|
|

04-10-08, 14:43
|
|
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.
|
|

04-10-08, 15:48
|
|
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
|
|

04-11-08, 01:22
|
|
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?
|
|

04-11-08, 02:42
|
|
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.
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|