|
|
If you have the budget, hire a senior consultant that will explain you in-depth (teach you) the workings of SQL-Server. I had a two day Oracle session not long ago and it gave me some insight into do's/don'ts. It remains difficult to design it still, but it will give you more confidence in what you're about to get yourself into.
V.
|
|
|
|
|
|
I am not very good at Microsoft Access's queries, they seem different than standard SQL.
I have the following query:
SELECT COUNT(*) AS Total
FROM CDCopy
WHERE CatalogueNumber=[Please enter the catalogue number to find out how many copies are available];
If I double click the query it shows an input box and the rest works as intended.
The problem is that I don't know how to use it in a form!
I have tried :
MsgBox([GETCDCopyCount]![Total]![CatalogueNumber])
Where "[CatalogueNumber]" is a textbox as I want to pass the text information from that box into the query.
Keep getting error messages, can someone help me out?
Thanks!
|
|
|
|
|
Hi..
i am using sql server 2008..
if suddenly database crashes then how to recover it?
what about data?
|
|
|
|
|
Restore a backup
Reload the log file
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thanks for reply..
i have an old backup consider for ex on 01-02-2011
after the backup i have added some entries into the table..
now my database is crashed if i restore the old backup only the
old data will be restored .. but how to retrive the new data
that i have entered after the old backup..
help me...
|
|
|
|
|
See if you can backup the transition log and apply that.
Let this be a lesson that you need to back up more often.
|
|
|
|
|
Good advice to the original OP. Depending on how his transaction logging is done, hopefully it is possible.
"Life should not be a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming "Wow! What a Ride!"
— Hunter S. Thompson
|
|
|
|
|
There's an article in CP which could be benefitial for you. Even though the article has some issues there are mechanisms you could try if the problem is still relevant:
Point In Time Restore[^]
|
|
|
|
|
Hi there...i am recently going to start work on databases in which i will have to insert,delete,log,update,match entries.. the language in general i will use c#...my question is..what query lanquage is the easier and convinient way to do these? Ado.net or LINq....which one i should learn first ?? and which one is easy?...please guide!
|
|
|
|
|
I'd learn them in this order:
SQL: Can use on pretty much any modern DB system.
ADO.NET: Relies on SQL at the bottom so a working knowledge if that is important
LINQ: Although it as abstracted away, it uses ADO at the bottom and has many similarities to SQL, and sometimes/often you need to write raw SQL.
But I'd use them in the following order of preference:
LINQ + SQL --> ADO + SQL.
Personally I rarely feel the need for plain ADO any more (DataSets = ), but I do find it useful to know how they all work.
|
|
|
|
|
Linq will only work with Microsoft technologies -- pretty much just .net and SQL Server -- so it may stunt your growth.
SQL is a more general solution and once you know it you can use it with a number of database systems and access methods, e.g. ADO.net, ODBC, embedded.
As to ADO.net, I recommend encapsulating it into a framework that you can easily understand and use.
Of course, you'd be even better off mastering everything.
|
|
|
|
|
yeah i know it has limitations..infact i was asking in short term period working with sql server and c#...so only in that context would first learning Linq be ok?..at the moment just have to work on a simple database.
|
|
|
|
|
I wouldn't use it for a enterprise application, but that's just me.
|
|
|
|
|
PIEBALDconsult wrote: Linq will only work with Microsoft technologies -- pretty much just .net and SQL
Server
Not really, LINQ has three main parts:
1: LINQ to SQL
2: LINQ to Objects
3: LINQ to XML
(yes, there are more 'flavors')
both LINQ to Objects and LINQ to XML can still be used and quite powerful while not connecting to SQL-Server. (it does more or less imply that you stay in .Net though)
V.
|
|
|
|
|
|
|
reza assar wrote: in fact it works for a week and after that it stops establishing connection to server remotely
Did you mean that your database-server doesn't accept any new incoming connections after that week, or that it drops the current existing connection?
reza assar wrote: my application will works about a week and dialing with sql server remotely more than 10000 times per a week and suddenly it stops
That's not much to go on; there's no known bugs in Sql Server that occur after a week. You could;
- Check the Windows EventLog (under Start, Configuration, Administrative Tools) for any errormessages relating to the database and/or the network
- Check your Global Exception Handler (you did implement one?) for relevant exceptions
- Add a lightweight trace to Sql Server - might give a clue on the offending Sql Statement and conditions under which this statement is run
- Did you install all service-packs? Updated Windows?
- Try to replicate it "at home" by pumping a lot of data to your development-server - see if you can reproduce the crash
The EventLog and the trace will be your best bets on hunting down the cause. Good luck
I are Troll
|
|
|
|
|
dear Eddy i am using exception handling the error is the same as when you can`t establish a connection.
good suggestion about eventlog i completely forgot about this.
by the way my application can`t establish a connection but meanwhile another applications "that developed by myself" can connect and dial with sql server remotely from other computers at the same time.
Eddy Vluggen wrote: Did you mean that your database-server doesn't accept any new incoming connections after that week, or that it drops the current existing connection?
yes i think there is no any connection object in the pool " and database-server doesn't accept any new incoming connections" and it does not allow establish a new fresh connection but after restarting the client computer everything working ok!
|
|
|
|
|
reza assar wrote: yes i think there is no any connection object in the pool " and database-server doesn't accept any new incoming connections" and it does not allow establish a new fresh connection but after restarting the client computer everything working ok!
Sounds like you got some connections that don't get closed/disposed properly. Any code that could leak connections/readers?
I are Troll
|
|
|
|
|
thanks Eddy
yes maybe .
i will check it and fix it (if there is any) and get the result back hear.
any other suggestion?
|
|
|
|
|
reza assar wrote: any other suggestion?
It might speed up things if you search (Ctrl-F) the entire solution for "SqlConnection" and add a using-block to each instance found. That would, in theory, dispose of your connection once processing exits the defined scope, and thus, also close it.
I are Troll
|
|
|
|
|
there are a series of time based data, every 15 mins 1 record:
Time Value
00:15 10
00:30 11
00:45 9
01:00 21
01:15 18
01:30 20
01:45 19
02:00 15
02:15 13
02:30 15
02:45 14
03:00 12
03:15 22
03:30 20
03:45 21
04:00 19
...
...
...
how to get the records that maintains over 18 for over 30 mins?
for example, for 01:00 it starts to be over 18, and maintains for over 30 mins, so 01:00 should be chosen, but 01:15,01:30 should not, because the time difference between them and 01:00 is less than 30 mins,and even 01:45 should not be chosen, because no values are over 18 and maintains for 30 mins.
Regards,
unruledboy_at_gmail_dot_com
http://www.xnlab.com
|
|
|
|
|
here is an idea: join the table to itself, and set appropriate conditions.
in pseudo-SQL-code:
SELECT a.time,a.value,b.value,c.value FROM table as a
JOIN table as b ON b.time=a.time+15minutes
JOIN table as c ON c.time=b.time+15minutes
WHERE a.value>=18 AND b.value>=18 AND c.value>=18
You'll have to work out the details yourself.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|