|
Typically, you would use binary column types. You can use TEXT type fields IF you encode your file (Base64 is common) before putting it in the DB.
I have put 10-20 meg files in a database, but it really wasn't a good design. I can't comment on your requirements, but for me it has always been better to have a predefined path on a server where files are placed and then just put the path to the file in the database.
|
|
|
|
|
Do you put the file name and file name in differnet columns like
FileName | FileExt | FileData |
1 Document1 xls .......
--------------------------------------
2 Document2 | doc | .......
--------------------------------------
3 Document3 | txt | .......
--------------------------------------
Or is there a better way??
regards
Henrik
|
|
|
|
|
Typically I just use on column and insert the file name like
\\NTSRVR01\DBData\SomeDir\SomeFile.someext
|
|
|
|
|
Thank you very much!!!
It's nice with friendly people when you feel stupid
|
|
|
|
|
I have to write a program based on an SQL Database. I'll write it in
VisualC++ with MFC and ATL... I have to use OLEDB... The program at
its root is composed of many dialogs (one for each table) and many
little search engines (one for each table).
Now the problem is: what model of data connection should I use? Should
I keep open a CSession for the entire time the corresponding dialog is
open? Or perhaps I should open the CSession, read the data, close the
CSession, let the user work on the data that I have loaded and then
reopen the CSession, write the modified row and close the CSession?
The COleDBRecordView class keeps the CSession open...
Another question: If I keep the CSession open, will the row a user is
working on be locked by the SQLServer? Does this depends on the
Isolation Level?
Bye
Max
|
|
|
|
|
Assuume I have the following query:
SELECT * FROM Table1
WHERE
field1 = 4 AND field2 IN (SELECT field FROM Table2)
I assume the SQL server begins a row scan. The question is: "Is the order of the fields in the where clause important?" meaning if current row has field1 != 4 will SQL skip it directly and will not scan the second table? And if I arrange the fields the other way will the second table always be scanned?
Best regards,
Alexandru Savescu
|
|
|
|
|
All depend of your indexs.
For example if you have a index in the table2 that starts with field and other index in the table1 that has field1 and field2 in this order, you will not have scans in your tables, but is very important how is the index, you need to do a good index.
Is not the same that the order in the index will be Field2, Field1 and use Where field2 = 1 and Field1 = 4 you need to evaluate if the index must be field1, field2 or field2, field1 and use that order in the query...
I hope to be clever...;)
Best Regards
Carlos Antollini.
www.wanakostudios.com
Sonork ID 100.10529 cantollini
|
|
|
|
|
Turn SHOWPLAN on and EXECUTE off and you can see what the optimizer does when you run the query both ways.
|
|
|
|
|
Hi,
I have been using ADO for a while now in my current project. Everything seemed to be working well (wishful thinking) until I noticed the following sequence of events:
1. use connection.Execute to run a UPDATE/DELETE etc query against the connected database
2. use connection.OpenSchema to get any schema information back
3. result is the '...the application is using argument that are of the wrong type...' error
Has anyone here experienced this bug, whereby using the Execute method, the connection object seems to get tainted against the OpenSchema method working properly.
I tried to disconnect, then reconnect before doing the OpenSchema call, but the same result.
Please help!
Simon
|
|
|
|
|
Hello,
I seem to have fixed this wierd error, though I don't know why it did!
When I do an action query, I use the connection.Execute method as mentioned. I passed it &vtMissing for the records affected parameter as I saw this in a MSDN example somewhere.
However, and this is the noodler, if I pass NULL for the records affected parameter, the problem goes away! No problem, but I don't see why this would fix it.
Simon
|
|
|
|
|
I'm working a database program using ado.In it ,i use Ado data control with DataGrid control.when i release the program,i have to change the a parameter in ado data control(connection string).for example,The path of old .mdb must to be changed to new path.However ,The ado data control has not change at all!After i used ado.setconnectstring().the program work well.But when the program is released to another pc,the error message appear"cannot initialize data bindings". as if It's from DataGrid. but i don't know how to reset Datagrid or ado parameter.who can help me,please?
|
|
|
|
|
With arrival of yet another Jet 4.0 Service pack (SP6), In 4!!! different exes depending on OS version, is it possible to have installshield to install the latest Jet version along with MDAC in my applications MSI file?
(Solutions using Visual Studio Installer would also be helpful... I don't like Installshield much)
Thanks...
Blade[DMS]
|
|
|
|
|
check in the site of the product...
May be Install Shield, developed a new object for that.....
regards
Carlos Antollini.
www.wanakostudios.com
Sonork ID 100.10529 cantollini
|
|
|
|
|
Yes I've found that...
Thanks...
Blade[DMS]
|
|
|
|
|
Dear Codeproject Users,
I want to make a Win application that uses a database, currently I am using ADO and Visual Studio .NET.
I want the user to be able to create an account on a database hosted remotely on a server in the internet, or if the users already has an account he can login. (This is what happens with programs like Napster).
After when a user logins he can edit his profile in the database (he can update only one record in the database, the record associated with his username).
How I accomplish this, there is a good tutorial out there?
Thx
"Nelle cose del mondo non e' il sapere ma il volere che puo'."
|
|
|
|
|
I want to define a custom datatype in SQL. I need it to be a structure that contains multiple fields. There is n't a struct datatype in SQL. How should I do this? Thanks.
Steve
Not all who wander are lost...
|
|
|
|
|
What database are you working with?
SQL Server, Access, DB2 do not support what you are asking for exactly. SQL Server supports custom data types, but they are just simple types with pre-defined defaults and rules.
Typically when working with a DB, you just flatten your strucutre into columns and deal with it like that.
Object oriented databases and XML based databases do support the concept of a struct (or entity), but this only applies if you are working with one of these forms of DB.
|
|
|
|
|
I am working with MS SQL Server 2000.
I am developing a large app that has app based security. I was looking for a way to embed this info in the database. If worst comes to worst I will just have the same fields at the top of each table.
Steve
Not all who wander are lost...
|
|
|
|
|
I don't know how your tables are layed out, but you might be able to have a single table for this info and have a 1:1 relationship between this table and the others. If you're tables aren't layed out easily, you could have an identity column in your strucutures table and add a column to each of your tables pointing to the identity column on the strucutues table.
Another idea (just a thought, I've never done this) would be to use a blob or if possible a char field for the entire structure. If it can be easily represented as text you could just string it together (comma delimited, etc) and stuff it in a single column.
|
|
|
|
|
One other thing...
I would recommend against adding the same columns to a bunch of tables. I've done this exact thing in the past and it can be a nightmare to manage later. What happens when you need a new field in this structure? How many tables do you have to modify?
Out of curisoty, what fields are in your structure?
|
|
|
|
|
What About use, text fields, with any detereminated struct?
Regards
Carlos Antollini.
www.wanakostudios.com
Sonork ID 100.10529 cantollini
|
|
|
|
|
Howdy,
Does anybody know whether the SQL max connections metric is process or thread based?
ie If I have an SQL server with up to 3 connections and am running an app which sporns threads which connect to the database will the app have trouble upon more than 3 concurrent threads executing.
If the connections are process based then this architecture will do fine. If howver SQL connections are measured on a thread basis then I'm going to have to rewrite the app.
Thanks,
Damian Del Campo
|
|
|
|
|
I've just found out that the magical number of '5 connections' isn't a licensing issue as I thought it was but that it is a 'maximum recommended'.
Thus I don't have a problem anymore !!!!!
BTW, this recommendation is apparently due to performance degradation for more than 5 connections. Is this true? I thought the only difference between MSDE and MSSQL was the management tools that come with MSSQL as the install size, structure and location seems to be identical.
Thanks anyway to anybody who would have offered to help with my problem, which is no longer a problem.
Damian
|
|
|
|
|
ived use the sqlconnection class to coonect to sql server 2000 and use its sqlcommand to write query and datareader to retrive data the prob is that when ever i have to refer a databse table i have to make a new coonection useing coonection string...and than acce the table.
is there any class and method so dat just need 1 connection too the datbase and refer too any table...
do guide me
thanx
|
|
|
|
|
Must wrote:
ived use the sqlconnection class to coonect to sql server 2000 and use its sqlcommand
Can you tell me what is your code? Then maybe I can help you.
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|