Collections:
Assigning NULL Values to Variables or Columns in SQL Server
How To Assign NULL Values to Variables or Columns in SQL Server Transact-SQL?
✍: FYIcenter.com
The rule for assigning NULL values to variables or table columns is simple: Use keyword "NULL" directly as normal values.
The tutorial script below gives you some good examples:
USE FyiCenterData; GO -- assign NULL values to variables DECLARE @birth_date DATETIME; SET @birth_date = NULL; SELECT @birth_date; GO ----------------------- NULL -- assign NULL values to columns UPDATE fyi_links SET notes = NULL; GO (8 row(s) affected) -- assign NULL values to parameters EXEC sp_help NULL; GO Name ---------------- fyi_links_dump fyi_links_top fyi_links_view ...
2017-02-05, 833👍, 0💬
Popular Posts:
Where to find answers to frequently asked questions on Managing Security, Login and User in SQL Serv...
How To Count Duplicated Values in a Column in SQL Server? If you have a column with duplicated value...
How To Get Year, Month and Day Out of DATETIME Values in SQL Server Transact-SQL? You can use DATEPA...
How To Create a Stored Program Unit in Oracle? If you want to create a stored program unit, you can ...
How To Define an External Table in a Text File in Oracle? You can use the CREATE TABLE statement to ...