I am using Entity Framework and occasionally i will get this error. EntityCommandExecutionException {"There
Which one: datetime datetime2 is the recommended way to store date and time in SQL Server 2008+? I'm a
I want to query the name of all columns of a table. I found how to do this in: Oracle MySQL PostgreSQL But I a
I need to remove a highly referenced table in a SQL Server database. How can I get a list of all the foreign
I'll use a concrete, but hypothetical, example. Each Order normally has only one line item: Orders: Or
I have seen SQL that uses both != and <> for not equal. What is the preferred syntax and why? I like !=
We all know that to select all columns from a table, we can use SELECT * FROM tableA Is there a way to excl
I've been learning Functions and Stored Procedure for quite a while but I don't know why and when I
I want to search a text from all my database stored procedures. I use the below SQL: SELECT DISTINCT o.
What is the main purpose of using CROSS APPLY? I have read (vaguely, through posts on the Internet) that cros
I have a database with account numbers and card numbers. I match these to a file to update any card numbers to
How do I parameterize a query containing an IN clause with a variable number of arguments, like this one? SEL
I am trying to insert some text data into a table in SQL Server 9. The text includes a single quote '. Ho
Both these joins will give me the same results: SELECT * FROM table JOIN otherTable ON table.ID = otherTable.
What is the best way to get IDENTITY of inserted row? I know about @@IDENTITY and IDENT_CURRENT and SCOPE_IDE
I need to update this table in SQL Server with data from its 'parent' table, see below: Table: sale
I want to delete using INNER JOIN in SQL Server 2008. But I get this error: Msg 156, Level 15, State 1, L
How do I perform an IF...THEN in an SQL SELECT statement? For example: SELECT IF(Obsolete = 'N' OR
How do I do a SELECT * INTO [temp table] FROM [stored procedure]? Not FROM [Table] and without defining [temp