ExtraDRM : Design Ressource Management

Web content and data design solutions

Browsing Posts in SQL Server

==================== Calcul d’ un max d’ un champs ==================== Unicode = 2 caractères SQL Server also has a DATALENGTH() function.  This function can be used on all data types (Text, NText or Image data types) in your table. SELECT a020, DATALENGTH(a020) FROM dbo.notices Ordre décroissant : SELECT a020, DATALENGTH(a020) FROM dbo.notices ORDER BY 2 DESC [...]

Constraints Constraint specifications add additional restrictions on the contents of the table. They are automatically enforced by the DBMS. The columnconstraints are: NOT NULL — specifies that the column can’t be set to null. If this constraint is not specified, the column is nullable, that is, it can be set to null. Normally, primary key [...]

Execute the following Microsoft T-SQL example scripts in SQL Server Management Studio Query Editor to list all or specific CHECK constraints in AdventureWorks database. ———— – Microsoft SQL Server T-SQL list all check constraints in database ———— – MSSQL information_schema views USE AdventureWorks; SELECT   TABLE_NAME, COLUMN_NAME, CHECK_CLAUSE, cc.CONSTRAINT_SCHEMA, cc.CONSTRAINT_NAME FROM     INFORMATION_SCHEMA.CHECK_CONSTRAINTS cc INNER JOIN INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE [...]