I have a procedure in SQL that I am trying to turn into Linq: SELECT O.Id, O.Name as Organization FROM Organi
I'm having some trouble figuring out how to use more than one left outer join using LINQ to SQL. I under
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
What is the main purpose of using CROSS APPLY? I have read (vaguely, through posts on the Internet) that cros
I am trying to insert some text data into a table in SQL Server 9. The text includes a single quote '. Ho
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
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
SELECT GETDATE() Returns: 2008-09-22 15:24:13.790 I want that date part without the time part: 2008-09-22 0
In SQL Server, it is possible to insert rows into a table with an INSERT.. SELECT statement: INSERT INTO Table