In terms of SQL terminology, does HEAP stands for a table that has Non-Clustered index? Or there is a nuance or it has completely a different meaning?
SQL query from C#
I am trying to query SQL Server database from C# I have class Class_A { public fetch((string name, string last_name)) { SqlConnection conn = null; double val = 0; string server = “…
Mysql queries giving error after upgrading
why this simple query not working. I know it was OK before I upgraded my mysql version. i know there are some syntax changes in new version that I done. but this is simple query no join, but not working. Please help me. EDIT: Upgraded from mysql4 to mysql5 and error is ‘syntax error’ Answer I thin…
Create a trigger that inserts values into a new table when a column is updated
I’ve been looking at some previous answers on triggers on here but can’t find what I need exactly but I’m sure my question has been asked/answered before. I’m trying to keep track of any changes to …
MS Access – execute a saved query by name in VBA
How do I execute a saved query in MS Access 2007 in VBA? I do not want to copy and paste the SQL into VBA. I rather just execute the name of the query. This doesn’t work … VBA can’t find the query. Answer You can do it the following way: OR
SQL datetime needs to read 00:00:00.000
I have the following piece of SQL: select DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,GETDATE()),0)) which comes through as this format: 2012-02-29 23:59:59.000 I need the exact piece of code with the …
VB.net SQL error Must Declare the Scalar Variable
Hi I have been stuck for a long time on this simple but obtuse message “Must Declare the Scalar Variable” I have a vb.net and SQL code that inserts data into a simple table. It works OK with sample …
SQL select * from column where year = 2010
This is probably a simple where clause but I want to say, from columnX (which is datetime) I want all rows where just the year = 2010. so: Answer Regarding index usage (answering Simon’s comment): if you have an index on Columnx, SQLServer WON’T use it if you use the function “year” (o…
Count records for every month in a year
I have a table with total no of 1000 records in it.It has the following structure: I want to calculate no of records for every month in year-2012 Is there any way that should solve my issue in a single shot? I tried: Answer
Select a column if other column is null
I need to select a field called ProgramID from a table and if the ProgramID is NULL then I need to select the value in the InterimProgramID from the same table and alias it as ProgramID. How can I …