Over the past couple of days I have noticed questions that have been flagged as needing to be closed or migrated to Stack Overflow because these questions contain code or not direct questions about a database. I have included a few examples of where I feel a question has been unfairly closed below:
Question 1: How should I write my query for the 'join table'?
This question came up as needing to be reviewed and the poster is asking "How do I perform a
JOIN
based on theLAST_INSERTED_ID()
generated when inserting the tutor table?" (paraphrased).I feel as though the question has been flagged as needing to be closed because it contains some references to Java - and while I accept that this is true, Java is actually coincidental and not particularly relevant to the problem that the poster is having. My reading of the question (and I accept that others may read it differently) is that once the user has inserted into the tutor table, and the query has completed, he then needs to take that ID and insert it into the tutor_subject table.
This could actually be answered by giving an example of how he could take the
LAST_INSERTED_ID()
and use it to perform an insert into another table without needing to write any Java in the answer. For example, saying that he could useLAST_INSERTED_ID()
in the insert of the tutor_subject table as long as the insert of the tutor table happened using the same connection. This is not Java - it is just repeating what the manual says:The ID that was generated is maintained in the server on a per-connection basis. This means that the value returned by the function to a given client is the first AUTO_INCREMENT value generated for most recent statement affecting an AUTO_INCREMENT column by that client. This value cannot be affected by other clients, even if they generate AUTO_INCREMENT values of their own. This behavior ensures that each client can retrieve its own ID without concern for the activity of other clients, and without the need for locks or transactions.
Question 2: query using the where clause if variables are not null
This question is asking about how to dynamically generate a where clause using variables passed into the stored procedure. The question does not contain any code other than T-SQL, contains no reference to an IDE or any other subject that could be deemed as being off-topic, and yet it has still been flagged as so. I cannot understand why this question is not suitable for DBA.SE.
Question 3: Visual Studio Database Deployment Including Tables From Another Project
This question actually did get migrated. While I understand that some may feel that deployment is not the same as development, or support, it is still part of the end to end process. Why do we allow questions about performing a restore, but not automated deployments from a database project within Visual Studio. How is trying to create database this way, so different from running a script or restoring a backup that it warrants being migrated to a different site?
We allow questions about DACPAC's (for example Enable TDE When Publishing DACPAC) which are created within Visual Studio. We allow questions about SQL Plus (for example Calling SQL Loader From SQL Plus) which isn't even asking a language question or a database question, it is asking a tool question.
Our approach is inconsistent; and when we are inconsistent about what should and shouldn't be on our site, how can we expect our users to post better, relevant questions?