|
Hi Mika,
I never used a XML field in a table. How is the performance of such a XML field?
Is it possible to make indexes or type specific queries (for example values within a date range)?
I have found further information on this topic Entity-attribute-value model[^].
|
|
|
|
|
Jani Giannoudis wrote: How is the performance of such a XML field
This depends on what database you use. For example SQL Server 2008 has: CREATE XML INDEX[^] on the other hand SQL Server 2005 has a bit different approach: Indexes on xml Data Type Columns[^]
But in both cases I think the performance is quite good.
Jani Giannoudis wrote: Is it possible to make indexes or type specific queries
Both would be possible. You could for example store the type in schema or in the xml itself.
The link you found also seems quite good.
|
|
|
|
|
Hi..
I have one table with columns
Id int, Message varchar, QueId int
I store messages in this table. Id is auto generated and that will be the id of message. Message will be message and queid will be the Id of the message for which your reply message is posted.
So I am storing messages as well as their replies in the same table.
The message which is not the answer of any question will have value 0 in the queid field.
One message can have multiple reply messages and these replies again can have multiple replies -- just like discussion forum / blog.
So one message can have hierarchy of messages...
Now my question is that.. I want to delete a message , now if i delete a message then this message's whole hierarchy should be deleted...
I can delete the message and the messages which are replies of this message, but what about the messages which are the replies of these deleted messages ?... i.e I also want to delete the same...
Could you tell me the solution...or how can i create stored procedure which can work recursively , for deleting records...
Awaiting for reply
Thanks
Hemant Thaker
By:
Hemant Thaker
|
|
|
|
|
Am not Sure which is the wise way to do that , i think Colin and the codeProject stuff might help you because their forums is like that. but i have seen that here at codeProject, when a user Deletes a Message, the submessages still remains , you want to get rid of that. I think when you store messages, if you say Queid holds the Parents reference, then you cna use your Primary key and the queid to delete the Message with its submessages in sql you cna do something like this
Your SQL must do two things
Delete the Main Message using the "ID"
and
Delete the Child messages based on the Parent ID and the Parents Queid
The way you have design your table is confusing, this should have been separated into tables , your table is not normalized , you will always have problems working on the table, some info needs to be separated.
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswam@its.co.za
|
|
|
|
|
does anybody know the best way to store case-sensitive passwords in sql server? in mysql its easy to use the varbinary type and i'm wondering if that holds for sql server
thnx
"mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them"
|
|
|
|
|
I only store password hashes in the db. I use the binary type but image should work as well.
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
If you don't ask questions the answers won't stand in your way.
Most of this sig is for Google, not ego.
|
|
|
|
|
thnx for that ... i thought it might be the way to go but when i tried that a few years ago i had a terrible problem with the client md5 code not producing the same result as the server md5 code so nobody could log in ... if i md5 the password on the server when they register will it match the client hash when they try to log in?
using c# & sql server
"mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them"
|
|
|
|
|
MD5 will always have the same results, as will any algorithm. Usually them not matching occur from improper use or poor implementation. Every time my MD5 has not matched it turned out to be programmer error on my part.
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
If you don't ask questions the answers won't stand in your way.
Most of this sig is for Google, not ego.
|
|
|
|
|
ok cool
thnx
"mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them"
|
|
|
|
|
Anyone to modify this code to work please
select* from employee where salary = MAX(salary) ; I want to get all details from the employee with highest salary.
|
|
|
|
|
select * from employee where salary=(select max(salary) from employee)
hope this helps
|
|
|
|
|
Thanks. I have a dream to be like you
|
|
|
|
|
better:
select top 1 * from employees order by salary desc
"mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them"
|
|
|
|
|
i am inserting a data remote database from client macine but problem is connection is not established between clint and remote
|
|
|
|
|
|
Hello,
Which provider should I use for transferring data from as400? I cannot use Microsoft provider as I am using standard edition. As for IBM providers there are three ones for native ole db:
IBM db2 udb for iseries ibmda400 ole db provider
IBM db2 udb for iseries ibmdasql ole db provider
IBM db2 udb for iseries ibmdarla ole db provider
and there are the same three for Ado.Net
Apart from ole db I can use ODBC and use the DNS I have created in data sources.
Which one will be the fastest? I believe using native will be better but which one from the three possibilities?
Also, are there any gotchas to take into consideration? Any tips and tricks?
Thank you.
modified on Saturday, February 7, 2009 6:24 AM
|
|
|
|
|
Have you checked this: http://www.itjungle.com/fhg/fhg050306-story02.html[^]
"IBM offers the OS/400 community three OLE DB providers: IBMDA400, IBMDASQL, and IBMDARLA. As a review, IBMDA400 is a general purpose, all encompassing provider that supports SQL, command and data queue interfaces. IBMDARLA is the record level access provider and is primarily for applications that work with single records instead of sets of records. The IBMDASQL provider was released with iSeries Access V5R3 and is an SQL only provider."
|
|
|
|
|
Thank you Mika. I will only need to issue select statements so I guess IBMDASQL will be most efficient.
|
|
|
|
|
Giorgi Dalakishvili wrote: I will only need to issue select statements so I guess IBMDASQL will be most efficient
Yes, I also think that would be a good choice when using selects only.
Giorgi Dalakishvili wrote: Thank you Mika
You're welcome
|
|
|
|
|
hi all,
i want to execute following on command propmpt
osql -S test\instance -U username -P password -Q"BACKUP DATABASE databaseName TO DISK='C:\My.bak'"
this command require osql tool(client tool) must be installed on client machine. I do not want to install sql server. Sql server is install on test machine .I want to install only minimum tools to use Osql.exe
so i want to ask that which tool must be installed on client machine to execute above command
|
|
|
|
|
Hi,
I tried to clean one of my database table ( having 1.427 billion records) using the delete statement.
But the statement is not completed after 30 hours of execution, so i stopped the query.
now the transaction log file size is 690 GB.
Database is up, but i cant do anything with this table.
I tried this
DBCC OPENTRAN ( dbname ) and it is showing my delete statement as open transaction.
What should i do?
My small attempt...
|
|
|
|
|
Don't know if you still have this case, but if you have explicit transaction, you should rollback it. Note that the rollback may take awhile (even more time than the delete operations).
|
|
|
|
|
Finally i did that.If we have any pending OPEN TRANSACTIONS in the database( SQL Server 2005) , we can ROLLBACK that using the following script.
USE [ dbname ]
Go
BEGIN TRAN
DBCC OPENTRAN
GO
DBCC OPENTRAN
ROLLBACK TRAN
GO
Pending OPEN TRANSACTIONS can be viewed by
DBCC OPENTRAN ( dbname )
My small attempt...
|
|
|
|
|
Hi All
I am writing an sql query for this situation to alalyze my data.
Table: Test
Actual Data
id key task
1 101 Ho
2 101 Dm
3 101 Dm
4 101 Ho
5 101 Ho
6 101 Ho
7 101 Ma
8 101 Ma
9 101 Dm
Required Output
id Key task
1 101 Ho
2 101 Dm
4 101 Ho
7 101 Ma
9 101 Dm
I want to compare the consecutive rows "task" column and want to display only one of those consecutive rows if the "task" column is same.
How can i achieve this in Microsoft SQL Server
I achieved this in Oracle by
SELECT routekey,collectionid,time,speed,heading,culmativedistance,latitude,lathemisns,longitude,longhemisew,satellitesinview,satellitestracked,satellitestatus,hdp,fixquality,snr,checksum,lowsignalenv,nogpssignal,nosatellitesinview,nulldatarpt,gpstrigger
FROM tester
WHERE prev_gpstrigger != gpstrigger
OR prev_gpstrigger IS NULL
ORDER BY collectionid,routekey;
Thanks
|
|
|
|
|
Can you describe more your output result which you want to get?
Or do you need to get only one value from field task.
Example:
Your result want to be like this:
id key task
1 101 Ho
2 101 Dm
7 101 Ma
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|