Update the Metadata of a Database Object
You can refresh a database object with the help of the sp_refreshsqlmodule function, as shown below: EXEC sys.sp_refreshsqlmodule ‘ObjectName’
You can refresh a database object with the help of the sp_refreshsqlmodule function, as shown below: EXEC sys.sp_refreshsqlmodule ‘ObjectName’
You can write “not equal to” in two different ways in SQL: !=
You can obtain the oldest Open Transaction in the following way: — Create temporary table for results. CREATE TABLE #OpenTrans ( CurrTrans VARCHAR(25), CurrTransDet SQL_VARIANT ); — Insert info in
You can force a like condition to compare only alphabetic values. Here is how: ORDER BY CASE WHEN LTrim(RTrim(Place.Name)) NOT LIKE ‘%[^0-9]%’ THEN 1 ELSE 2 END, Place.Name
You can fetch records that are common to one or more tables by using INTERSECT. Here is a small example: Select * from EmployeesIntersectSelect * from RetiredEmployees
SQL Server, by design, caches query plans for queries. For reuse of cache, the best practice would be to include the schema name in the query. For example: select *
Setting a default NULL Date in SQL is quite easy, you just need to concentrate. A statement similar to the following will convert any NULL value inside the specific DATE
Dramatically reduce the execution speed of your queries using SET ARITHABORT ON as it saves time by not calculating unnecessary numerical data.
In order to read from an Excel Spreadsheet through SQL you need to install the Office 2010 Database Engine. Afterwards, run statements similar to the following: EXEC sp_configure ‘Show Advanced