|
If you're only requesting the data you need, there's not much left to play with.
Turn protocol compression on if you don't already and see if that helps. There are also some variables[^] you can set that might give better performance. net_buffer_length is probably the most important.
|
|
|
|
|
I want to join these 2 tables Products_Table & Interest_Table.
When somebody is logged in they get a flag next to the product that they said they where interested in. I request the cookie to get the pwl variable in the Interest_Table.
I’m looking for the sql statement that works in access..
Products_Table
Prod_ID Prod_Name
1 Dog
2 Cat
3 Horse
4 Truck
5 Car
Interest_Table
ID Pwl Flag
1 Bob Flagged
1 Tom Flagged
4 Bob Flagged
5 Tom Flagged
When Tom is logged in he will get this list.
1 Dog Flagged
2 Cat
3 Horse
4 Truck
5 Car Flagged
When Bob is logged in he will get this list.
1 Dog Flagged
2 Cat
3 Horse
4 Truck Flagged
5 Car
When nobody is logged in they get this list.
1 Dog
2 Cat
3 Horse
4 Truck
5 Car
|
|
|
|
|
Why do you insist that the database does something that the UI has the information for! The database does not know what should be flagged, you get it from a cookie. So when you have the datatable back from the database you can then add the column and populate the flagged records.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hy,
i have a requirement in which i have update a coulmn based on date time Cloumn(Column A)..Its like the column(Column B) would get updated after 9 hours of the date time column(A).
Ex if the datetime column value(A) is '3/15/2010 2:32:27 PM'
then i have to check wether the diifeereence between current time and the column time is 9 hours or not.
What query should i write in oreder to do this
Thanks & Regards,
raghvendra panda
|
|
|
|
|
If you are using SQL Server, you can do:
select datediff(hh, ColumnA, getDate()) from TableX
This will give you the date difference in hours.
|
|
|
|
|
Hey for help check the link below......
Link
|
|
|
|
|
I want to read from DB using multiThread, but I do not konw how to prevent from reading data repeatly?
I use vc++ to process this task, can anyone tell me how to realise it?
|
|
|
|
|
I am not quite sure about understanding your post. Are you trying to avoid different threads reading same data again and again?
If yes, then there is not much you should do at the DB end. This should be handled in the code.
|
|
|
|
|
Please read the forum guidelines. Choose one board for your question.
|
|
|
|
|
Hi All,
My database for student installment is like this.
ID StudentID Month Year Amount
1 001 4 2009 1000
2 001 5 2009 1000
3 001 6 2009 1000
4 001 7 2009 1000
5 001 8 2009 1000
6 001 9 2009 1000
7 001 10 2009 1000
Now i want the query to display it like
StudentID Apr2009 May2009 Jun2009 July2009
001 1000 1000 1000 1000
Any IDEA???
Plz share ur experiences.
Thansk
Yogesh Agarwal
|
|
|
|
|
If you using Sql Server 2005/8, have a look at the PIVOT command.
|
|
|
|
|
|
Check out the following link
PIVOT
|
|
|
|
|
hi everyone,
I have 2 tables like StudentDetail and TuitionLevel
StudentDetail
id Name Surname StudentUniqueId Subject
1 sam smith G1234U890 E
2 sam smith G1234U890 M
3 Paul Day R4321B009 E
E as English
M as Maths
TuitionLevel
id PreLevel PostLevel
1 3 4
2 5 4
3 2 2
I want to display result like this
Name MathsPre MathsPost EngPre EngPost
sam 3 4 5 4
Paul 2 2
I have done in the following way but this is not what i need.
SELECT [Name],Surname,StudentUniqueId,
Case when motot.Subject = 'E' Then 'English' Else 'Maths' end AS Subject,
Pre,
IsNull(Post,'') as Post
FROM StudentDetail sd
INNER JOIN TuitionLevel TL on TL.id =sd.id
ORDER BY StudentUniqueId
any help would be much appreciated.
thanks in adv.
modified on Wednesday, April 7, 2010 11:16 AM
|
|
|
|
|
Learner520 wrote: INNER JOIN TuitionLevel TL on TL.id =sd.id
What does the tuitionID have to do with the studentID? Also, what database are you communicating with?
If my answer has helped you, one of my articles may also be a help. Also remember that your best friend's name is google.
|
|
|
|
|
This article may be of use to you, assuming you are using SQL 2005 or later Pivot two or more columns in SQL Server 2005[^]
And yes that join is suspicious. Actually your data structure is screwed, not that you have sma smith stored twice, this is wrong. Suggested restructure:
Student
StudentID
StudentName
Subject
SubjectID
Subject
TuitionLevels
LevelID
Description
LinkTable
StudentID
SubjectID
LevelID
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi Mycroft Holmes,
Thanks for your reply. It was my mistake I didnot normaliz data but I did on purpose but it did not work.
Now I have normalized it and I'm trying to figure out how to display it through pivot.
But still need your help. Any suggestion or hint how to do that would be much appreciated.
thanks
TuitionLevel
tuitionlevelid tuitionleveldesc
1 1a
2 1b
3 1c
4 1
Student
UPN StudentName
A1234 Alan
A1233 Sam
A1232 Carol
Subject
Subjectid SubjectDesc
1 E
2 M
UPN subjid pretui_id posttui_id
A1234 1 1 2
A1234 2 3 4
A1233 1 7 3
A1233 2 1 4
A1232 1 5 6
A1232 2 6 6
output:
UPN StudentName PreMaths postMaths preEng PostEng
A1234 Alan 1a 1b 1c 1
Any help would be much appreciated.
thanks
|
|
|
|
|
If you work through the article I basically do it in 2 steps. Build up the query that will service the pivot.
Get your student details, the course details and your performance information into a normal result set, do not get any extra data like ID information that is not needed.
Get a distinct list of the course names (either from the result set or all the courses), these will be your pivoted columns.
I would do a hard coded mini query to get a feel for it, once you get a result by hard coding the pivot columns you can turn it into dynamic sql. To debug the dynamic sql print the text and try and run that.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hy,
While using pivot in my stored procedure i got the following error
"Incorrect syntax near 'PIVOT'. You may need to set the compatibility level of the current database to a higher value to enable this feature. See help for the stored procedure sp_dbcmptlevel."
To Solve it when i used "EXEC sp_dbcmptlevel database, 90" my sp got execited sucessfully
but the rest of the sp's in the same database and having pivot stared showing me error
After i changed it back to "EXEC sp_dbcmptlevel database, 80" the rest of the sp's havng pivot started working properly except the current sp i am working on.
Kindly help,
|
|
|
|
|
Hy,
I have got 2 servers(sqlserver 2000 and sql server 2005) is there any way so that i can fetch the records of table from ql server 2000 from sql server 2005 database
|
|
|
|
|
You can link the servers[^]. This way you can "attach" a Sql-database that's located on another server.
I are Troll
|
|
|
|
|
If you dont have permision to create a link server, you can extract the data to a file from the table in Server B and then import them in Server A.
if you need help extracting and importing, read about BCP and Bulk Insert or even DTS
|
|
|
|
|
Hi All,
The project in which i am working needs to be multilingual.
I need to insert and retrieve data in these languages :
1. Tamil
2. Telugu.
3. Malyalam.
4. Oriya.
5. Kannada.
Actually we don't know which font to use for which language.
Do I need to install fonts on the server or is there any patch need to install??
Please help me out of this!!
Thx & Rgds
Aman
|
|
|
|
|
Actually I think you need to install the fonts on the client, I'm not sure as we only have to support 2 languages and did not need to install the chinese fonts on the server.
When you create your columns use nvarchar and not varchar. Remember to double the size of the text field when using nvarchar.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I do not think that that is a problem. For text fields, we use "nvarchar" so that we can cope with the German ÄäÖöÜüß.
I copied some text from a web site in Hindi language into some text fields of our application. The data can be retrieved correctly - even with a SQL Server 2000.
|
|
|
|