If you’re getting an error that reads something like “Cannot schema bind view ‘vEmployees’ because name ‘Employees’ is invalid for schema binding. Names must be in two-part format and an object cannot reference itself” it could be that you’re trying to create a schema bound view, but you’re not using a two-part format for names (such as the table names within the view).
Continue readingCategory: DBMS
Database Management Systems
2 Ways of Creating a Composite Type in PostgreSQL
In PostgreSQL, a composite type is a data type that represents the structure of a row or record. It’s basically a list of field names and their data types.
We can use composite types in many of the same ways we can use simple types, such as in table columns.
Below are two ways of creating composite types in PostgreSQL.
Continue readingFix Error 1505 “The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name” in SQL Server
If you’re getting an error that reads something like “The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name” it’s probably because you’re trying to create a UNIQUE
constraint on a column that already contains duplicate values.
List of Array Functions in PostgreSQL
Below is an alphabetical list of functions that we can use when working with arrays in PostgreSQL.
Continue readingHow to Create an Array Column in PostgreSQL
PostgreSQL allows us to create arrays and store them in a database column. When we do this, we can use various array related tools to retrieve data from such arrays, as well as manipulate the data within them.
We do need to define the column as an array column though. If we don’t do this, we will likely run into trouble when we want to retrieve data from the array. For example, we can’t just store an array as the text type and then expect to be able to use subscripts to refer to its individual elements.
Continue readingFix Error “Drop table operation failed on table … because it is not a supported operation on system-versioned temporal tables” in SQL Server
If you’re getting an error that reads something like “Drop table operation failed on table ‘db.dbo.TableName’ because it is not a supported operation on system-versioned temporal tables” in SQL Server, it’s probably because you’re trying to drop a temporal table that still uses system-versioning.
In SQL Server, if a table is defined as a temporal table, we can’t drop it while it’s using system-versioning.
If you really want to drop the table, turn off system-versioning first, then try again.
Continue readingHow to DROP a Temporal Table in SQL Server
Temporal tables, introduced in SQL Server 2016, provide a powerful way to track historical data changes. However, there may come a time when you need to remove a temporal table from your database.
This article will guide you through the process of dropping a temporal table in SQL Server.
Continue readingCheck Whether a Unicode String is Normalized in PostgreSQL
In PostgreSQL, we can use the ... IS NORMALIZED
expression to check whether or not a given Unicode string is in a specified Unicode normalization form.
By default, it checks whether it’s in the NFC
form, but we also have the option of specifying NFD
, NFKC
, or NFKD
.
Fix Error 2788 “Synonyms are invalid in a schemabound object or a constraint expression” in SQL Server
If you’re getting SQL Server error 2788 that reads “Synonyms are invalid in a schemabound object or a constraint expression” it seems that you’re trying (whether intentionally or not) to create a schemabound object that includes a synonym in its definition, or a constraint with a synonym in its expression.
Continue readingA Quick Look at the FACTORIAL() Function in PostgreSQL
In PostgreSQL, factorial()
is a mathematical function that returns the factorial of a given integer. We pass the integer (it accepts bigint
), and it returns the factorial as a numeric value.
In mathematics, the factorial is the product of all positive integers less than or equal to a given positive integer. It’s denoted by that integer and an exclamation point.
Continue reading