I am using jtds 1.2.2 driver with SQL Server 2008. Below is the query I tried to execute   SELECT * from AM_API  FETCH NEXT 10 ROWS ONLY   Anyway after executing above query I got below error  Caused by: java.sql.SQLException: Invalid usage of the option NEXT in the FETCH statement.     at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:368)     at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2816)     at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2254)     at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:631)     at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:477)     at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:777)     at org.jaggeryjs.hostobjects.db.DatabaseHostObject.executeQuery(DatabaseHostObject.java:510)   Any idea how to solve this issue?  UPDATE  I have read  that saying FETCH is working on SQL Server 2012 onwards only. Then how to limit result in SQL server 2008. The query going to execute is not under my control. I just postfixed FETCH NEXT 10 ROWS ONLY to the query to limit the result. So is there a way to limit the result by adding a limit query as a postfix to the query.
From 2012 onward the SQL Server docs show they support  which I'm trying to use instead of a LIMIT.  The following works fine in PostgreSQL to sample a result set,  SELECT * FROM ( VALUES (1),(2),(3) ) AS t(x) OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY;   However, with SQL Server, I get  Msg 153, Level 15, State 2, Line 4 Invalid usage of the option FIRST in the FETCH statement.   What's going on here? Does SQL Server support the standardized OFFSET .. FETCH?
Bring Debian to second Position in the GRUB Menu at startup Do the same camera settings lead to the same exposure across different sensor sizes? Let's say I have a micro-4/3rd camera and a full frame camera, both set to 1/60 at f/2.8, taking a picture of the same scene in the same lighting. Will the exposure be the same across both cameras despite the different sensor sizes?  The reason why I'm asking is because of the difference in depth of field between micro-4/3 and full frame sensors. I'm finding that, in order to take a picture of certain scenes with the full frame camera at the same depth of field as the micro-4/3rd camera, I have to increase the aperture, which in turn forces me to crank up the ISO. Preview of CAD files in format .dwg I'm looking for a utility or a program for Ubuntu, and possibly even for Windows that is able to convert a CAD file format .DWG to PDF.   My need is to provide a preview of CAD files, and I thought that the easiest way is to convert them into PDF format, but I'm open to suggestions, even if there is only the possibility to convert them to JPG image file type or PNG would be fine.  What interests me is only to find some solution, no matter if it is commercial or free Ubuntu 12.04 on Amilo LA1703 after istalling graphics doesn't start? Why does the following code does'nt work when i am using PDFLaTeX or just LaTeX ? I tried it in different editors as well.  This is the code   $\{f^'_n\}$   Surprisingly it works on Math.SE site Inequality : $\sum_{k=1}^n x_k\cdot \sum_{k=1}^n \frac{1}{x_k} \geq n^2$ I have to show the inequality of $$\left(\sum_{i=1}^n x_i\right)*\left(\sum_{i=1}^n \frac{1}{x_i}\right) \geq n^2.$$For $x_1, ... x_n \in \mathbb{R_{&gt;0}}$ and $ n \geq 1$. I wanted to show this inequality by induction. The basis is clear, but I am not sure how to do the inductive step. Can someone help me with that? The ls -al command shows the following output;  -rwxrw-r--    10    root   root 2048    Jan 13 07:11 afile.exe   What are all the fields in the preceding display? VirtualBox error kernel headers I'm with Ubuntu 15.04 and I'm trying to create an emulator (genymotion), but when run virtualbox, i got the error:     Stopping VirtualBox kernel modules ...done.   Uninstalling old VirtualBox DKMS kernel modules ...done.   Trying to register the VirtualBox kernel modules using DKMSError! Your kernel headers for kernel 3.16.0-30-generic cannot be found.   Please install the linux-headers-3.16.0-30-generic package,   or use the --kernelsourcedir option to tell DKMS where it's located    ...failed!     (Failed, trying without DKMS)   Recompiling VirtualBox kernel modules ...failed!     (Look at /var/log/vbox-install.log to find out what went wrong)   I performed   uname -a   And the result is:     Linux douglas 3.16.0-30-generic #40-Ubuntu SMP Mon Jan 12 22:06:37 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux   Someone help me?Already I uninstalled and installed again. Tagging best practices I am wondering what I should do when tagging a question that fits multiple tags, in the particular case were the question might belong to general as well as more specific tags.  Let me give you an example to illustrate this:  Let's say I have a question about ASP.NET MVC 3.0 and I use C# as my main language.  The following tags could apply:   c# .net .net-4.0 asp.net asp.net-4.0 asp.net-mvc asp.net-mvc-3   Tagging with C# might make .NET redundant (I don't think C# is used anywhere else outside of the .NET scope), and tagging with  certainly makes  and  redundant. However, my question would get a better visibility with tags such as ,  and , as probably no one browses a tag as specific as .  How shall I tag my questions? Using more general or more specific tags, or a mix of the two? What did Dumbledore say his scar on his left knee was? In Philosopher's Stone, we hear Dumbledore replying to McGonagall's query as to whether he could do something about the scar baby Harry has on his forehead:     “Even if I could, I wouldn’t. Scars can come in handy. I have one   myself above my left knee that is a perfect map of the London Underground." - Chapter 1, The Boy Who Lived.   Now, I have no idea what that last sentence means.  It could be because English is not my native tongue. Is it some kind of a joke, or does it really mean something? My intuition tells me it's a trade off between speed and security, but how did the standardisation process select these three seemingly arbitrary key lengths (namely, AES-128, AES-192, AES-256). When can you switch the order of limits? How do I calculate the determinant of the following $n\times n$ matrices  $$\begin {bmatrix} 0 &amp; 1 &amp; \ldots &amp; 1 \\ 1 &amp; 0 &amp; \ldots &amp; 1 \\ \vdots &amp; \vdots &amp; \ddots &amp; \vdots \\ 1 &amp; 1 &amp; ... &amp; 0 \end {bmatrix}$$  and the same matrix but one of columns replaced only with $1$s?  In the  above matrix all off-diagonal elements are $1$ and diagonal elements are $0$. Is there a catchall function somewhere that works well for sanitizing user input for SQL injection and XSS attacks, while still allowing certain types of HTML tags? Give us better search-by-score syntax Is it necessary to use commas in lists before the conjunction? I have seen many sentences like this:     "Capitalism, Socialism, and Anarchism"   and this:     "She was happy, and cheerful"   Do we have to use a comma before "and", or is it incorrect?  If it is not, then why? Already awarded bounty refunded on question migration? In March 2011 I offered a 500 bounty on one of my StackOverflow questions () and awarded it to Filip de Vos.   This question was later migrated to Database Administrators and has the following messages on it.     migrated to dba.stackexchange.com by Will♦ Dec 28 '11 at 12:25      This   question belongs on our site for database professionals who wish to   improve their database skills and learn from others in the community.   .     deleted Dec 31 '11 at 1:01   I appear to have been   on whereas Filip .  Is this a bug? Definitely doesn't seem fair or correct to me. The question still shows up in both our bounty tabs despite the migration. I would have hoped that the previously awarded bounty reputation points could still be honoured in this situation. Bind variable with dotted name not working in dynamic SOQL As mentioned in , it's possible to use bind variables in dynamic SOQL queries.  This seems like a great way to avoid SOQL-injection, and to build a query string once but use it multiple times with different values in the variables.  I'm working on a method that returns a list of objects.  It accepts a class with multiple properties as its only parameter.  The properties of this class are used to filter the results to just the required records.  It will eventually be driven by a Visualforce component, which will be configured by querystring parameters in the URL.  I just ran into an issue where the query fails when I use dotted bind variables.  If I copy the constructed dynamic SOQL into a static query, it works fine.  This may be a bug, because in doing tests I found that :foo.bar would actually try to use local variable bar.  Here's one of my queries, which uses related custom objects.  I've stripped it down to just the part that's failing (wrapped for legibility):  result = Database.query('SELECT Name, Another_Object__r.Name,      Another_Object__r.Custom_Field__c      FROM Custom_Object__c       WHERE Another_Object__r.Custom_Field__c = :filter.deviceType');   The error reported is System.QueryException: Variable does not exist: filter.deviceType.  As mentioned above, the query works fine as static SOQL, just not dynamic:  result = [SELECT Name, Another_Object__r.Name, Another_Object__r.Custom_Field__c FROM Custom_Object__c WHERE Another_Object__r.Custom_Field__c = :filter.deviceType];   It also works in this case:  String deviceType = filter.deviceType; Database.query('SELECT Name, Another_Object__r.Name, Another_Object__r.Custom_Field__c FROM Custom_Object__c WHERE Another_Object__r.Custom_Field__c = :deviceType');   I haven't read about this being a known limitation.  I don't know if I should be using some other syntax/notation in the query -- the dotted notation appears correct.  Time to report a bug?  Thoughts on workarounds other than creating local variables to stand in for each member of the class? When would you use a voltage regulator vs a resistor voltage divider?  Are there any uses for which a resistor divider is particularly bad? As soon as I start SQL Server with no application querying, in the task manager it starts to consume memory very fast till it consumes around 15GB. How can I resolve this issue?