|
David Skelly wrote: Just do it, you know you
Shaddup shaddup - I recently listened to that lying bastard and did not use a separate primary key for a minute dimension table (2 records) bastard came back and bit me AGAIN, I hate that little voice.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Holmes I think I will want the beer for myself, though you were right. I won't take much just five bottles. I initially had in mind of making that column a primary key but I think I need to be careful with that. I need to find another approach. Thanks all, and I'm really enjoying your discussions too.
|
|
|
|
|
Thats easily fixed, create a PK column using IDENTITY() and another column calculating the structure you want as your key field, the key field is for user consumption only and must NEVER be used to identify a record internally, only from the user. The key field should have a unique constraint.
If you want to make the key field calculation transparent you can put it in a trigger (I loathe triggers) but I would put it into the insert procedure (I ALWAYS use stored procedures, my preference)
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
In the Identity versus GUID arena, if you are or will be using replication, avoid the use of Identity fields - it can causes huge headaches.
Tim
|
|
|
|
|
Hear hear!
But it's not really a matter of Identity versus GUID, it's a problem with the keys being auto-generated by the engine rather than the application. You can use either an integer or a GUID and set it yourself; there's nothing magical about GUIDs here.
|
|
|
|
|
hello friends.,
here I have an query which needs to pick up the complaint number which was not solved within the time frame like 6hours from the time that complaint was registered, and here i have 4coloumns saying compdate,comptime,forwardeddate,forwardedtime which are of nvarchar data type in the table urbrur means urban rural.
So for this from the net i found one query i.e,
"select compno from urbrur where forwardedtime>DATEADD(hour,6,@time)";
for that @time they used some fixed date time like
Set @Time='09/16/2011 10:00:00'
but here i can't use it because as in my table the date and time are in separate columns having datatype i.e, nvarchar and I don't want this type of fixed values, it should take the values from the date n time columns in the database . .
So friends i think i gave an complete descrption to my query so kindly do concerned to my problem and give favorable reply . .
I'm very thankful to u all,
praveen
|
|
|
|
|
I'm not sure I understand the question, but perhaps you want to select rows where the comptime IS NULL and the forwardedtime is less than six hours ago (from the current time)?
praveengb wrote: in my table the date and time are in separate columns having datatype i.e, nvarchar
That is not a good design. You should probably have just a single DateTime field for each.
|
|
|
|
|
sir this project is running from past 1 year where we can fetch date and time wise report through crystal report but now the task is to fetch using time frame like 6hrs or 24hrs...
|
|
|
|
|
As PBC has already pointed out your database is not designed to support the query you want to run. There is no easy fix, either you will need to change the table design, or in your query you will need to concatenate the date and time values together and then convert to DATETIME datatype so that you can do the DATEADD function. That will work, but it will be quite slow if you have a large table to query so the best solution is to change the table design if you can.
|
|
|
|
|
Can anyone help me to convert a table(s) in database Sybase or Access to Mysql Blank Database "using free tools or way"?
|
|
|
|
|
You can download the MySQL Migration Toolkit[^]. It says there that it has reached EOL status and that you should use MySQL Workbench, but I have found the Migration Toolkit to be much better for converting from other db's to MySQL.
Hope this helps
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
Thanks for your help , but i need a little detailed answer with steps Preferred for SYBASE. Iam new to both SYBASE and MYSQL
|
|
|
|
|
Hi, I would like to know if it is possible to determine sql role to which a user belongs. I would want my client application to enable and disable some menu items if it is able to determine the sql role to which that user belongs. I'm using Sql Server 2005. Thanks.
|
|
|
|
|
Are you talking about the server roles withing sql server or the active directory roles. It would be weird to use server roles to manage your UI and AD roles should be retrieved via the UI.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Some users will be administrators, and I will create my own roles as well. That means I will check both the server roles and user-defined roles for a database.
|
|
|
|
|
Check this[^] and it depend how you plan to manage rights on application.
I Love T-SQL
"VB.NET is developed with C#.NET"
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
Blue-Boy you took me to Google. Well I have already googled and didn't find a clear solution. But I will keep trying.
|
|
|
|
|
|
Hi everyone, I would like to know how an administrator can change the password of a user who has forgotten his or her password. Using sp_password requires the old password before the change can be made. I would be happy to know how to solve this problem. But if it is possible to retrieve the password for a user, that will solve the problem and I will be glad to know how to retrieve a user's password if I am an administrator. Thanks in advance.
|
|
|
|
|
|
Thanks. I got it. That was about changing the password. But is there also a way to view users' password? Looks like that was not described there.
|
|
|
|
|
I don't know off-hand, but I doubt it. Any system worth its salt will never allow passwords to be displayed, only reset. If you allow the administrator to view a user's password then it is open to hackers; not a good thing.
|
|
|
|
|
Thanks again Richard. Then I will stick to resetting passwords. That will greatly help.
|
|
|
|
|
Richard MacCutchan wrote: Any system worth its salt will never allow passwords to be displayed
I see what you did there
|
|
|
|
|
Funnily enough this is a perfectly normal English expression (but I guess you know that), and it was only after posting that I noticed the significance of that word.
|
|
|
|