
How to select unique records by SQL - Stack Overflow
How to select unique records by SQL Asked 16 years ago Modified 1 year, 10 months ago Viewed 746k times
sql - Must declare the scalar variable - Stack Overflow
@MyVariable and @myvariable are the same variables in SQL Server Man. Studio and will work. However, these variables will result in a "Must declare the scalar variable "@MyVariable" in …
sql - Find all tables containing column with specified name - Stack ...
@Revious INFORMATION_SCHEMA views included in SQL Server comply with the ISO standard definition for the INFORMATION_SCHEMA., sys.columns, sys.tables is Microsoft Sql Server …
SQL Server String or binary data would be truncated
SQL Server 2017 CU12 also supports this feature. Improvement: Optional replacement for "String or binary data would be truncated" message with extended information in SQL Server 2017 …
How to fix Recovery Pending State in SQL Server Database?
Sep 14, 2018 · Rename the DB and the Log files (Database Properties -> Files) In the Object Explorer window in SQL Management Studio, refresh the 'Databases Folder', if you see that …
SQL: IF clause within WHERE clause - Stack Overflow
Sep 18, 2008 · Is it possible to use an IF clause within a WHERE clause in MS SQL? Example: WHERE IF IsNumeric(@OrderNumber) = 1 OrderNumber = @OrderNumber ELSE …
How can I select the first day of a month in SQL?
I used GETDATE () as a date to work with, you can replace it with the date which you need. Here's how this works: First we format the date in YYYYMMDD... format truncating to keep …
Search all tables, all columns for a specific value SQL Server
Search all tables, all columns for a specific value SQL Server [duplicate] Asked 15 years, 11 months ago Modified 7 years, 8 months ago Viewed 843k times
sql - Exclude a column using SELECT * [except columnA] FROM …
We all know that to select all columns from a table, we can use SELECT * FROM tableA Is there a way to exclude column(s) from a table without specifying all the columns? SELECT * [except …
sql - How to find out what is locking my tables? - Stack Overflow
I have a SQL table that all of a sudden cannot return data unless I include with (nolock) on the end, which indicates some kind of lock left on my table. I've experimented a bit with …