|
That depends on your idea of what is first. Strictly speaking the rows in a database have no order although the underlying database software will put the data in a certain order it should always be thought of as unordered because the software may change and the previously implied order with it.
So, given that a database is an unordered set of data, how do you define first? What do you want to put in the ORDER BY clause? Then we can figure out how to get the first of each series.
|
|
|
|
|
infact i want to get just one record against "Prof ID". Order is not necessary here....
Waiting for reply
Do good and have good.
|
|
|
|
|
Use simplest way that is GROUP BY option
Regards
R.Arockiapathinathan
|
|
|
|
|
I have 3 tables with period history field. the Period will be replaced with each end of the month in current year.
so: Period01 = January 31, 2006 and Period12 = December 31, 2006
Here are the fields of each of them:
Vendors (Vendor_ID, Purchase_Period01, Purchase_Period02 , ... , Purchase_Period12,
Payments_Period01, Payments_Period02 , ... , Payments_Period12
)
Items (Item_ID, UnitSold_Period01 , ... , UnitSold_Period12 ,
Sales_Period01 , ... , Sales_Period12 ,
UnitReceived_Period01 , ... , UnitReceived_Period12 ,
Cost_Period01 , ... , Cost_Period12 ,
UnitDamaged_Period01 , ... , UnitDamaged_Period12 ,
Loss_Period01, ... , Loss_Period12
)
Accounts (CoA_ID, Debits_Period01, ... , Debits_Period12 ,
Credits_Period01, ... , Credits_Period12 ,
Activity_Period01, ... , Activity_Period12 ,
Balance_Period01, ... , Balance_Period12
)
My Question is: Do all Tables above is in Normal Form?
If not, can you help me make those Tables in Normal Form?
I would like to compact those Tables' Field design so that those tables consist of as little as possible of Period Fields..?
Thanks for the help..
Dogma: I :am goD
|
|
|
|
|
Tomy1402 wrote: Do all Tables above is in Normal Form?
Which particular normal form are you looking for? There are 7 (if I remember correctly) in total.
It appears to conform to the first normal form - All pieces of data are separated into their own column. (e.g. Name="Colin Mackay" does not conform, FirstName="Colin", Surname="Mackay" does conform)
It appears to conform to the second normal form - All tables have a primary key
It appears to conform to the third normal form - All non-key columns depend on the primary key.
It does not conform to the fourth normal form - The table should not contain repeating columns.
|
|
|
|
|
Which normal form??
moreover, in certain areas normalisation might lead to performance hits, i.e if you are going to have to many reads in your tables, if u have more joins n such stuff, it will impact performance seriously.
PADAYAPPA
|
|
|
|
|
karamchandrabose wrote: Which normal form??
Sorry, I don't understand your question.
karamchandrabose wrote: in certain areas normalisation might lead to performance hits, i.e if you are going to have to many reads in your tables, if u have more joins n such stuff, it will impact performance seriously.
Joins in and of themeselves do not necessarily hurt performance. It is what you are doing with the join that can hurt performance.
As a general rule I'd say that you should normalise a database as much as possible and then once you have that, denormalise as required to get the performance.
|
|
|
|
|
|
Hi,
I need to round the minutes to the nearest quarter of hour. For example if it is 00:07 (hour:minutes) then it would be 00:15, if 00:05 then it would be 00:00.
Any ideas how to go about doing this?
Many thanks for your time.
|
|
|
|
|
Make a function:
CREATE FUNCTION [dbo].[RoundMinutes]
(@dDateTime datetime)
RETURNS DateTime AS
BEGIN
declare @minutes int
set @minutes = datepart(n,@dDateTime)
set @minutes = case when @minutes < 7 then -@minutes
when @minutes < 23 then -@minutes+15
when @minutes < 37 then -@minutes+30
when @minutes < 52 then -@minutes+45
else 60-@minutes
end
return(dateadd(n,@minutes,@dDateTime))
END
Call it like this:
select dbo.roundminutes(datefield) as RoundedDateField from mytesttable
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
Hi
I have to populate some datas from sql server database and display it directly in a CSV Format or CSV file. When i run the project it should provide me an option to whether open or save or cancel the file. when i click open it should be opened and be viewed in a excel sheet in CSV format and when i click save it should ask the destination folder and should be saved there in CSV format and when i click cancel it should be cancelled and the application should be closed. pls note that all these actions should happen in the same browser and should not be redirected to anyother page. Can anybody give me the detailed description and code in Asp.Net using C# .It's very Urgent.
Regards
Vijay.
|
|
|
|
|
Hi
Anyone please tell me that we can work only with Database.MDF file without sql server in asp.net 2.0.
if it is possible please tell me the details...
Regards
RPL
r_palanivel83 10:01 4 Jan '06
|
|
|
|
|
r_palanivel83 wrote: Anyone please tell me that we can work only with Database.MDF file without sql server in asp.net 2.0.
I wouldn't think so. SQL Server is not a file based database - although SQL Server 2005 Express edition does blur that distinction a little. When you access a SQL Server database you access the SQL Server, not the file. Only SQL Server can access the file directly - everything else must go through the server.
|
|
|
|
|
r_palanivel83 wrote: Anyone please tell me that we can work only with Database.MDF file without sql server in asp.net 2.0.
if it is possible please tell me the details...
Nope. You have to have SQL Server/SQL Server 2005 Express if you want to work with .mdf files. If you want to work with a file based database, then Access would be the way to go. You may want to look at Firebird SQL.
You will see a delete button on each of your posts. Press it. - Colin Angus Mackay
|
|
|
|
|
I have installed SQL 2005 Beta 2.It was not working properly so I have uninstall it.Now I am trying to install SQL 2005 Express that comes with Visual Studio.net 2005 but I couldnt install it because not all of the Beta 2 files have been removed (and they dont appear in the Add/Remove Programs in the control panel) so I used msiinv.exe and msiexec.exe in the command prompt to remove it but this way didnt solve my problem.Could any one tell me how could I Remove These Beta 2 files from my computer?.
I think this link will explain my problem for you more clearly:
http://blogs.msdn.com/astebner/archive/2005/07/01/using-msiinv-to-gather-information-about-what-is-installed-on-a-computer.aspx[^]
My problem is similar to Syed Irtaza Ali problem written in the comments in the link above.
I am too late but i will never give up
|
|
|
|
|
Hi ALL,
Is this the right place to ask "SQL Server 2005 - Reporting Services"
related questions? If not, direct me to the right place.
I'm new to MS-SS-Reporting Services.
I'm able to create some reports.
I just wanted to create a report like this with multi-level
columns.
Population Report
C1, C2, C3....Cities
------------------------------------------------------------------
Country-1 | Country-2
------------------------------------------------------------------
State-1 | State-2 | State-3 |
------------------------------------------------------------------
C1 | C2 | C3 |
------------------------------------------------------------------
| | |
| | |
Is it possible in MS-SS-Reporting Services?
If so, kindly let me know how to do.
As of now, I'm able create like this:
----------------------------------------------
Country | State | City | Population
----------------------------------------------
India TamilNadu Chennai ---
Trichy ---
Madurai ---
Coimbatore ---
-----------------------------------
Kerala Trivandrum ---
Cochin ---
Ennore ---
Kottayam ---
----------------------------------------------
SriLanka *** *** ---
Thanks in advance,
Sarvan AL
|
|
|
|
|
Yes it is fairly easy, You have to experiment with Matrix for report1 and use table for report2.
You also have to learn how use the embeded "IIF" statement to get your layout right. It's all trial and errror and plenty of RTFM.
Blog Have I http:\\www.frankkerrigan.com
|
|
|
|
|
Hi Frank,
Thanks for your suggestions.
Since I'm totally new to MS-SS-RS, let me
go through the manuals about "Matrix" report and
embedded IIF statement, and come back.
Thanks once again,
Sarvan AL
|
|
|
|
|
I need proffisionaly ADO.net Databaseconnection string Codingwith Sql server ....Pls help me
Thanking U
somasundaram
|
|
|
|
|
|
I have problem with Pass through queries. The problem is as follows:
The scenario is Pass Through Query (PTQ) has to execute a stored procedure on Sql Server (versions should be a problem in this case). So when PTQ is connecting to the SqlServer 2005 which is local to the application is working fine and returning results. The same is not working fine when PTQ has to execute SP which is on remote SqlServer.
I checked the ODBC connections they are fine.
Please help me.
Intelligence is measured by common sense not by how many scholarly books you read.
|
|
|
|
|
hello frndz,
am creating an application using vb.net and sql server. my table contain eno field as a primary key. when ever i run that appliction and give some no tho that field. if that no is already exist it was shown not allowed duplicate and some error msg. but am n need of such thing in a msg box..(ie "Your entered eno is already exist please try different no"). i think this is done using a trigger for table in sql. But i dont get such things. if any one tell me how to write trigger for that criteria? please help me....
thank you..
|
|
|
|
|
Please don't use SMS speak in the forum.
Right - your primary key, is it meant to be a unique identifier? If so, why not use an identity column and then let the database worry about setting it?
Arthur Dent - "That would explain it. All my life I've had this strange feeling that there's something big and sinister going on in the world."
Slartibartfast - "No. That's perfectly normal paranoia. Everybody in the universe gets that."
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
hello,
am working with that identity function. but it is not helpful to me.cause in my application the user only give value for that primary key field(actually that is a 4 digit no and it is unique by nature) whwenever creating new files there is achance for giving same no. that time only we have to show some message that is a primary key so please try to fill someother no. am developing this application with sqlserver 2000 and vb.net 2005. i couldnt able to create trigger for primary key. please help me....
|
|
|
|
|
No trigger needed use an identity field
<br />
USE CREATE TABLE [dbo].[MyTalve](<br />
[ID] [int] IDENTITY(1,1) NOT NULL<br />
<br />
)<br />
<br />
You get the picture ?
Blog Have I http:\\www.frankkerrigan.com
|
|
|
|