|
You can use GROUP BY with the HAVING clause.
SELECT username
FROM your_table
GROUP BY username
HAVING COUNT(*) = 0
|
|
|
|
|
I've tried this also, it does not return records in my case.
|
|
|
|
|
You're right! I've should've seen that. It can't possibly work...
Will something like this work?
SELECT y1.Username
FROM your_table y1
LEFT JOIN your_table y2
ON y1.Username = y2.Username
WHERE y2.date BETWEEN start AND end
GROUP BY y1.Username
HAVING COUNT(y2.Username) = 0
The table alias y1 represent all usernames and y2 represent only the records within the requested range.
|
|
|
|
|
i would like to know the differnce between the fixed server roles and data base roles in sql server 2005 . and in my application i use three types of users called admin,mgr,operator and i want to give privileges to each of them to accss the db and the application.so using the roles how can i do this ,Specially apply privileges to each user...
|
|
|
|
|
|
I am not understanding the permission problem I am having and what the Schema object is for.
My Database has Stored procedures owned by a user, let say corp. If I look at the database there is a Schema also called corp owned by corp.
corp has all roles except db_DenyDatareader and db_DenyDatawriter and is not aliased to dbo.
Now it has been my understanding that since the user corp owns the Stored procedure it should have execute rights to it.
The problem is when my application opens and tries to execute a stored procedure I get denied for lack of Execute permission. If I log into the database using enterprise manager (2005 version) with the corp login I can get into the database but I can not see any of the Stored procedures that the corp user owns.
I can not figure out this issue any ideas are greatly appreciated.
Thanks
|
|
|
|
|
i cant run my program, there's an error:
Type 'BOOK_Locator.Dataset1' is not declared
in codes:
Friend WithEvents DataSet11 As BOOK_LOCATOR.DataSet1
i have connected my database in connection wizard properly but why there's an error in it? how can i fix?
|
|
|
|
|
|
As others have said, don't cross post. That is very rude.
Rharzkie wrote: Type 'BOOK_Locator.Dataset1' is not declared
That pretty much tells you the problem. Is the error occurring within the scope of where you have it declared?
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
i used the data adapter connection wizard, but when i chose my database, there's an error...
it says:
IErrorInfo.GetDescription failed with E_FAIL(0x80004005).
what is the meaning of that? how will i fix it?? i really need to make a connection wizard for my project...
|
|
|
|
|
|
Ok, this will be very hard to explain since I haven't personnally seen this myself.
I have a web site programmed with an Access database as the backend database. All has been working for over 3 years. Recently the employees are saying they are changing things in the database, both through the table itself, and through forms in the database(horrible I know, but my employer will not pay me to write all that code). But they say that SOMETIMES, it doesn't save the changes, which contradicts both computers with the sometimes, and Access since it writes constantly.
Has anyone seen this happen before? Know of a fix? Anything?
I have checked to see that there is enought disk space, and that they have sufficient privilages. ANY help at all, leads, ideas, absolutly anything, will be greatly appriciated.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
Is the MDB file in the folder which is writeable by the process?
|
|
|
|
|
Yes, my code all works as far as C#. Is is when the users are actually in the database using its forms and tables.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
Expert Coming wrote: through forms in the database(horrible I know, but my employer will not pay me to write all that code)
I can relate to that from a few experiences out there.
Expert Coming wrote: say that SOMETIMES, it doesn't save the changes, which contradicts both computers with the sometimes, and Access since it writes constantly.
Is there any kind of record-level locking going on? Access can let you turn such a thing on and off...
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Not sure, it would be the default which I am sure is locked. Do you know what the default is?
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
I think the default is set to No Locking . Or your problem could be something completely different, though.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
hello all,
i am working on a application to get the last updated date for a table. the date is already in the table in the UPDATE_TIMESTAMP column. Now the following code is not getting the result for me. can anyone help? I am getting an insufficient priviliges error
public static string GetLastUpdateTime()
{
StringBuilder sb = new StringBuilder();
sb.Append("SELECT MAX(updated_timestamp) lastUpadateTime FROM TABLEA");
OracleHelper oracleHelper = new OracleHelper();
string sql = sb.ToString();
object obj = oracleHelper.ExecuteScalar(Utility.GetConnectionKey(),CommandType.Text,sql);
if (obj == DBNull.Value)
{
return "";
}
return ((DateTime)obj).ToString("mm/dd/yyyy");
}
|
|
|
|
|
Is this a misspelling or did you do this in the table too?
.NET_Labview wrote: sb.Append("SELECT MAX(updated_timestamp) lastUpadateTime FROM TABLEA");
'lastUpadateTime'
I think it may be spelled as 'lastUpdateTime' in the database.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
Thanks expertcoming!!
this is just an Alias used to represent the result set..though I agree this is a spelling mistake.....
now based on what I have found I need to know if we can have a dataset having a single value as resultset.
Can you tell me if we can have one value as a dataset......
|
|
|
|
|
Does anybody know of a good on-line SQL "cookbook"?
I see that O'Reilly actually publishes a book by this name, but it is a book (perhaps not as googleable as online source). I see the same questions keep popping-up here repeatedly, and it's difficult to locate the "search forums" dialog here at codeproject (it took me a good while to locate it). Perhaps folks could get quicker answers to their specific questions if a searchable cookbook was readily available.
Actually, even having the Search function here at codeproject apply to the forums (instead of just Articles and Authors) would reduce some of the noise. But even then, a well written, easily searchable cookbook would sure be nice.
David
|
|
|
|
|
|
Thanks for the reply.
Actually, I had in mind more of a "cookbook"; simple pre-packaged answers to common issues and questions like the ones that crop-up repeatedly within this forum. Good link anyway. Think I'll download it!
David
|
|
|
|
|
hi.
could someone please help me out.
im tryin to take data from one table, summarize it, and insert it into a new table.
what i have is a current 'daily' stats table for a user. but now what i want to do is take that data and add up 7 days worth of stats for each user. so, in other words, i have the last weeks stats for each user.
basically i need to know how to select data out daily table and then insert into weekly table.
Thanks!
|
|
|
|
|
The INSERT command can contain a SELECT
INSERT INTO Destination
SELECT Column1, Column2, Column3
FROM SourceTable
|
|
|
|