|
Probably belongs in the Design and Architecture[^] forum!
xml is NOT good for large databases, xml is a descriptive platform it is NOT a database. Some have used it for minute data requirements where it may be valid but certainly not for any valume.
This is dependant on winforms/web application (among other things) you do not say.
We use OLEDB (SQL) connections for winforms
The server app is probably a Web Service - there is plenty of articles and samples around for these.
XML vs Binary transport layer is an old and well used argument, you need to do some research to determine which will suit your needs best.
Encryption is dependant on your data sensitivity, general info may not require encryption where authentication almost certainly does.
|
|
|
|
|
Thank you for your anser. I didn't notice that forum, i won't post there that will create double post.
As i have said i think using MySQL .NET connector (Witch clearly says i am using .NET Framework), not OLEDB and i didn't start as web service only as windows service
|
|
|
|
|
Saksida Bojan wrote: Is Xml Good for large databases?
What do you mean by that? Keeping all data in XML format? If yes, it is a bad idea.
Saksida Bojan wrote: Shoud i use XmlDocument or XmlReader and XmlWriter?
I am not sure that these 3 classes can be compared as each of them serves different purpose.
XmlDocument is an in-memory DOM representation of the XML and other two are used for reading and writing. If you want to persist the XML in memory and need to manipulate it(querying with XPath etc..), choose XmlDocument . XmlDocument can also make the data editing and writing easy. If you have a custom data structure that has to be created/persisted to XML, prefer XmlReader and XmlWriter .
Saksida Bojan wrote: If i chose XmlReader and XmlWriter how would i manage to quickly delete data?
Use XmlDocument in such case and call its Save() method for writing to XML file.
Saksida Bojan wrote: Is it good to connect to remote server(MySQL) using .NET Connector?
No - if it is a stand-alone application. Wrap the database access behind a web service/WCF.
Saksida Bojan wrote: I Also thinking of creating server app that will be on server betwen mysql and Client.
Is TCP good protocol or shoud i consider UDP. Currently i am reading about TCP and i am thinking if i should send XML data through TCP.
This is exactly what a WCF or web service layer does. WCF uses TCP communication and web services uses SOAP messages.
|
|
|
|
|
N a v a n e e t h wrote: Saksida Bojan wrote:
Is it good to connect to remote server(MySQL) using .NET Connector?
No - if it is a stand-alone application. Wrap the database access behind a web service/WCF.
It is dll that has connector and uses socket to connect dirrectly to MySQL database. it is OpenSource and it does not require to install unlike it is with ODBC
N a v a n e e t h wrote: This is exactly what a WCF or web service layer does. WCF uses TCP communication and web services uses SOAP messages.
I Don not know what WCF is, but i will look into it.
What is diffrent by Windows Service and Web service? Can Windows Service uses protocol such as TCP or UDP?
Thanks for the information, it realy helps
|
|
|
|
|
Saksida Bojan wrote: What is diffrent by Windows Service and Web service?
Windows services are normal applications that runs all the time and controlled by a service manager. It needs to be installed using installutil utility. On the other hand, web services follow request/response architecture. It resided on a server and serves requests. Communication is done on XML format following SOAP protocol.
Saksida Bojan wrote: Can Windows Service uses protocol such as TCP or UDP?
Yes.
|
|
|
|
|
what is Oracle equalent for Systypes,Syscolumns...?
if Systype - All_Types,Syscolumns -All_Tab_Columns
then what is the eualent for
name,xtype,xusertype in All_types and
xtype,ID,name in All_Tab_columns...
please anybody give me a solution for this?
Thanks in advance...
|
|
|
|
|
Dear All, I am trying to list parent and child tables from sql 2005, but i could not find the solution.
well, How can i list all parent tables first then child tables from sql server 2005 in a single statement?
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
You may want to look into the sys objects. This view seems to have some interesting info for you sys.foreign_key_columns it is in 2008 but I think it may be there in 2005 as well.
|
|
|
|
|
I tried with this query but didnt help
select distinct(tb.[name]) as TableName,tb.[Object_Id] as ObjectId,fk.type_desc,fk.[type] as [type] from sys.tables tb left join sys.foreign_keys fk
on tb.[object_Id] = fk.parent_object_Id
where tb.[type]='U' and tb.is_ms_shipped=0 and tb.[name] not like 'asp%' and tb.[name] not like 'sys%'
order by fk.[type] asc
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
This took me 10 minutes of faffing about with the system tables. Take a look at the last 2 columns
SELECT K.*,'|',O.NAME,p.name
FROM sys.foreign_keys K
INNER JOIN sysobjects O ON O.id = K.referenced_object_id
INNER JOIN sysobjects P ON P.id = K.parent_OBJECT_ID
|
|
|
|
|
well, i have done this which returns the requirement, but only it does not returns parent tables first then child tables.
would u help me to return parent tables first than child tables.
select distinct(t.name),t.[object_id] from sys.tables t left join sys.foreign_keys k
on t.object_id=k.parent_object_id
where t.[type]='U' and t.is_ms_shipped=0 and t.[name] not like 'asp%' and t.[name] not like 'sys%'
order by t.[name] desc
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
Can we store data which is in the form of a list(Bulleted list or Numbered list) to the database as is with out wrapping the text? If we cannot then what is the best way to store a list to database?
-UdayKiran
|
|
|
|
|
Wow, this question is so wrong in so many ways.
Databases store structured data (generally)
A list (complete) is unstructured data
Text wrap is not a concept a database has.
The way to go
Create a table with 3 fields
ID int identity(1,1)
Sequence int
ListText varchar(a number > the possible text length)
Into this you store the bullet number in Sequence and the text in ListText
When you retrieve the data you order it by Sequence and it is up to you to display the text in the control you want.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Yeah you are right thanks for your reply may be I did not frame my question right. Lets say my data is as follows.
Col1
| Col2
| Col3
| 1
| Line1
Line2
Line3
| xxx
| 2
| ABC
| XYZ
|
This is 2 rows of data and since database stores structured data first row would be stored as:
1 Line1Line2Line3 xxx
So my question is what method should I adapt so that when I pull the data from the database I would know that the data in Col2 and Row1 is in the form of:
Line1
Line2
Line3
I hope now I made my self clear.
-UdayKiran
|
|
|
|
|
I have the nasty suspicion you are working with a lousy data structure, I am assuming that Line1,Line2,Line3 should be stored as seperate pieces of data, in a related table. I do not know enough about your structure or what you are trying to acheive to give any useful feedback.
|
|
|
|
|
Alright Thanks for your time. Is there anybody who could help me with my problem.
-UdayKiran
|
|
|
|
|
1、How to know which SQL statement runs faster than the other SQL statement by contrasting the being displayed execution plan?
2、Could you please tell me the meaning of I/O Cost、CPU Cost、Subtree Cost and Cost? and what is the measuring unit of these
costs? and if there is a mathematical expression among the cost,say Cost=I/O Cost+Cpu Cost+subtree cost?
3、Is it possible to compute the accurate time of one SQL statements execution costed by execution plan?
|
|
|
|
|
The analysis of the execution plan is far too much to reply in a forum, the MSDN documentation gives all the information you need.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
I think you may have the wrong handle on what to use the execution plan for, it is not for timing parts of a query, more for identifying high cost points of your query.
Do study the MSDN stuff if you need more detailed information but I look for the highest % nodes and make sure they are for index scans. This is a VERY crude use of the tool but a good first step.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I agree. I typically use the execution plan to make sure I can reduce the number of I/O's; no full table scans ... It has been my experience that if you reduce (or limit) the I/O's your application will respond quickly.
Regarding, timing of SQL: Why don't you build your own timer logic and try various SQL statements out? Keep it simple, something like this:
Begin timer1
Execute SQL1
End timer1
Begin timer2
Execute SQL2
End timer2
Now check which timer is the smallest. You will have to collect these statistics multiple times to ensure that you are not getting skewed results because the data happens to be in cache.
|
|
|
|
|
I have table FEE,There are 9 rows in this Fee table
PK ........ FEE ........... TRANS. ID
11 ........ 5000$ ........ 2222
12 ........ 9000$ ........ 2222
13 ........ 1000$ ........ 2222
14 ........ 2000$ ........ 7777
15 ........ 1000$ ........ 7777
16 ........ 1000$ ........ 7777
17 ........ 2500$ ........ 9999
18 ........ 4100$ ........ 9999
19 ........ 4500$ ........ 9999
I want to fetch the only one primary key of each
duplicate 'trans. id'
For example: The result(PK) should be
11,14,17
OR
13,14,17
OR
14,14,17
......
......
Duplicate Trans. id are 2222,7777,9999.
|
|
|
|
|
try this
select min(PK) from FEE
where Trans.ID in (select distinct Trans.ID from FEE)
group by Trans.ID
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Hi Ashfield
First of all thankz for your reply
It returns only one PK....I want to get
one PK of each duplicate record ....
According to last example I want one PK of 2222(Trans. ID),one PK of 7777(Trans. ID) and one PK of 9999(Trans. ID)
so one possible result is
11,14,17
Other possible result is
12,14,17
One more possible result is
13,14,17
.........
Now I think you understand what I want
waiting your reply
|
|
|
|
|
Thats odd. I used this:
create table #b1(pk int identity, refid int)
insert into #b1 (refid)
select 1
union all
select 2
union all
select 3
union all
select 1
union all
select 2
union all
select 3
select min(PK) from #b1 where refid in (select distinct refid from #b1)group by refid
and it gave me 1, 2 and 3. I'm using sql server 2005, what are you using?
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
I am using SQLServer 2005
|
|
|
|