In SQL Server we can find the maximum or minimum value from different columns of the same data type using different methods. Performance and compact code are essential. As we can see the first solution in our article is the best in performance and it also has relatively compact code. Please...
Question: I want to find SQL Server table columns which are using user-defined types . I also want to find SQL Server columns in which the nulability at the column level is different from the nullability set at the user-defined type level. ...
To retrieve all Users in SQL Server using the SQL Server 2000 system tables, you can execute the following SQL statement:SELECT * FROM master.sys.syslogins;The sys.syslogins system table (SQL Server 2000) contains the following columns:
SQL Server Find out whether a table has some unique columnsHere's an approach that is basically ...
a given name in SQL Server Management Studio?This approach will gatherINFORMATION_SCHEMA.COLUMNSfor ...
Aging Report SQL Query Alias all columns in a given table Alias column with variable value in SQL Script All MonthNames and Month numbers in sql server All queries combined using a UNION, INTERSECT or EXCEPT operator must have an equal number of expressions in their target lists. all the ev...
FROM sys.tables STAB LEFT OUTER JOIN sys.columns SCOL ON STAB.object_id = SCOL.object_id AND SCOL.NAME LIKE N'%M%DATE%' FOR XML PATH(''),TYPE).value('(./text())[1]','NVARCHAR(MAX)'),1,11,N'') ); EXEC (@SQL_STR);...
-> from tables -> where table_schema='INVOICE'; +---+ | DB Size | +---+ | 6430.26MB | +---+ 1 row in set, 1 warning (0.00 sec) mysql> 查看索引所占的空间大小 mysql> select concat(round(sum(index_length)/(1024*1024),2),'MB') as 'DB Size' -> from tables -> where ...
While we were discussing the various possibilities to reduce the database size, client brought up a very interesting point in front of me. He said “My database has many huge tables (with size beyond 500 GB’s). Most of them have multiple columns which has null values ...
To retrieve all Users in SQL Server using the SQL Server 2000 system tables, you can execute the following SQL statement:SELECT * FROM master.sys.sysusers;The sys.sysusers system table (SQL Server 2000) contains the following columns:ColumnExplanation uid Unique numeric value status Not used ...