|
|
what's the best way to save duration in mySQL..
with duration I mean 1 hour and 25minu (1:20)
it might be more than 23hours sometime... like (31:17)
|
|
|
|
|
I'd either store it as a number (in seconds), or as two datetimes.
I are Troll
|
|
|
|
|
Hi,
I would like to know what is the DBA tasks? what is he/she doing?
if I wanna be DBA do I need to start with SQL Server or Oracle? cold you please advice me how should I start? what sort of certification do I need?
|
|
|
|
|
Have you tried this? Database Administrator[^]
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
future3839 wrote: start with SQL Server or Oracle?
No. You need a broader understanding of the subject.
future3839 wrote: how should I start?
Go to school. Get a high-level understanding of all types of database.
|
|
|
|
|
I have a question, I hope this has not been asked before
But I have a stored procedure which I have to EXEC in order to get a results set, and then pop the results set into an Excel report.
Problem is, the results set is known to have 100,000's of rows. Now, I've read on Google about SET ROWCOUNT and I did the following as a test...
SET ROWCOUNT 5
EXEC ....
However, doing that gives me nothing back, not the top 5 rows of the results set like I expect. I don't want to put a TOP 5 (or TOP X you get the idea) in my SELECT inside the stored procedure because doing that will break functionality elsewhere.
I just want the top X rows right now just for testing purposes, and then when I am ready to deploy I plan to have it give me the full query (the query runs as a scripted console app on a remote server somewhere at regularly scheduled times).
Thanks for any inputs!
Sincerely Yours,
Brian Hart
|
|
|
|
|
Brian C. Hart, Ph.D. wrote: I don't want to put a TOP 5 (or TOP X you get the idea) in my SELECT inside the stored procedure because doing that will break functionality elsewhere.
Make a second version with a different name?
I are Troll
|
|
|
|
|
I did that and it worked! Thanks [ ]
Sincerely Yours,
Brian Hart
|
|
|
|
|
You're welcome
|
|
|
|
|
How about
create or replace procedure SomeProcedure (
input_select_count integer default null
)
as
...
...
begin
...
if ( input_select_count is NULL )
....
else
....
Even better to have the count applied to your SQL as a parameter so that your code can control the number of rows returned.
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]
|
|
|
|
|
Thanks for the tip!
I'll keep that in mind
Sincerely Yours,
Brian Hart
|
|
|
|
|
I have my database called patients.mdb and I am using the below code to read from it (part of the code):
<br />
<br />
OdbcDataReader reader = command.ExecuteReader(); <br />
<br />
while (reader.Read())<br />
{<br />
rTxtBxMC.Text = Convert.ToString(<br />
reader[0]);<br />
} <br />
<br />
reader.Close();<br />
<br />
How to you write to a database of this type?
|
|
|
|
|
So you discovered one method (ExecuteReader) of the OdbcCommand class, and now you want someone to spoon feed you on another of its methods? too lazy to read a single page on MSDN? Google broke down? What gives?
|
|
|
|
|
Thanks for the answer, however just because something seems simple to you doesn't mean it will be to the next arrogent SB.
|
|
|
|
|
if you want to achieve anything at all at programming, you need to learn and help yourself first of all; only when that fails, ask a specific question here and people will be glad to help out. Laziness is not appreciated around here, so start using Google, look at MSDN, buy and study a book, and read some of those nice articles on CodeProject. It is all there to provide basic information and much more.
|
|
|
|
|
Have to agree with Luc on that one, BUT
look into the different type of execute from the command object.
depending on your database type and how you want to execute the query i.e. SQL or stored procedures you need to read up on ExecuteNonQuery[^]
As barmey as a sack of badgers
Dude, if I knew what I was doing in life, I'd be rich, retired, dating a supermodel and laughing at the rest of you from the sidelines.
|
|
|
|
|
ExecuteReader can execute any SQL statement (and more than one at time in some cases); ExecuteNonQuery and ExecuteScalar call it in the background.
|
|
|
|
|
I always thought ExecuteReader (one or more rows) and ExecuteScalar (single value) return values from the database, where as ExecuteNonQuery only returns the number of rows returned, i.e a write which the Op was asking about
Is the ExecuteReader executing a an insert / update or delete statement something it can do but not by intentional design?
As barmey as a sack of badgers
Dude, if I knew what I was doing in life, I'd be rich, retired, dating a supermodel and laughing at the rest of you from the sidelines.
|
|
|
|
|
Read up more on DataReaders -- they can do anything. The others simply wrap it.
|
|
|
|
|
Cheers will do
As barmey as a sack of badgers
Dude, if I knew what I was doing in life, I'd be rich, retired, dating a supermodel and laughing at the rest of you from the sidelines.
|
|
|
|
|
What Simon said. Also look at INSERT and UPDATE in SQL, both of which use ExecuteNonQuery .
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
DatabaseAccessor[^]
Tichaona J wrote: Convert.ToString(
I suspect that that is completely needless in this case, if the value in the database is already a string then a simple cast is all you need.
Don't use the Convert class!
|
|
|
|
|
hi
i try to backup and restore database using sql-server 2008 and got error.
to backup i done this:
BACKUP DATABASE MyDB TO DISK='d:\MyDB.BAK' (and its work fine)
to restore i done this:
USE MASTER RESTORE DATABASE MyDB FROM DISK='d:\MyDB.BAK
and got this error:
Msg 3159, Level 16, State 1, Line 7
The tail of the log for the database "MyDB " has not been backed up. Use BACKUP LOG WITH NORECOVERY to backup the log if it contains work you do not want to lose. Use the WITH REPLACE or WITH STOPAT clause of the RESTORE statement to just overwrite the contents of the log.
Msg 3013, Level 16, State 1, Line 7
RESTORE DATABASE is terminating abnormally.
Where I'm wrong ? what is missing ?
thank's in advance
|
|
|
|
|
The database MyDB is already exists. Consider using WITH REPLACE to overwrite the database.
Here [^] is more about restore.
|
|
|
|