sql set multiple variables from select

A quick google brought me to a decade old Dave article that explains it well: https://blog.sqlauthority.com/2007/04/27/sql-server-select-vs-set-performance-comparison/, To me, the right answer to this question would be: Select @v1=col1, @v2=col2,. 2006 2023 All rights reserved. fulfill the task, but in some scenarios unexpected results may be produced. It seems a bit wasteful to make two separate select operations for something as trivial as this task: You can use SELECT assignment to assign multiple variables. Save my name, email, and website in this browser for the next time I comment. Connect and share knowledge within a single location that is structured and easy to search. By clicking Post Your Answer, you agree to our terms of service, privacy policy and cookie policy. Thanks, "Select is about 59% faster than a Set and for one to a handful of value assignments that's not a problem and the standard should rule.". To learn more, see our tips on writing great answers. In the code below, I use the Select Into syntax just like above. If OF column_name [,n] is supplied, only the columns listed allow modifications. Copyright (c) 2006-2023 Edgewood Solutions, LLC All rights reserved Control how many rows are inserted by controlling how many times the loop is executed. WebWhy are multiple sql execute in java programming article is subject for storing hierarchical data access that in python: since its configured in this article is malicious sql? The above doesn't work but i am trying to figure out how I would accomplish this. If used inside a stored procedure, any SET setting is ignored. Compound Operators (Transact-SQL), More info about Internet Explorer and Microsoft Edge. For variables of type XML, an optional schema collection may be assigned. With SELECT, variables values are populated without giving away any warnings or error. The changes are specific to the request context in which they're set, and don't affect other concurrent MARS requests. Failed assignment may be due to no result returned or any non-compatible --Using SELECT, returns the old values instead of NULL. Context: I am building an automated system which will grab record from a database and immediately publish them en masse as a CPT. The new values are visible if the update happens through the cursor by specifying the WHERE CURRENT OF clause. Updates of key values from outside the cursor are similar to a delete of the old row followed by an insert of the new row. for assigning a value to variable. Applies to: This is demonstrated in the following While SET is used for single variable assignment. Part 1 and 2 are mentioned in the scripts below. The following example creates a local variable named @dept and uses this local variable in a SELECT statement to find the first and last names of all employees who work in the Marketing department. WebVariables can also be set by executing a SELECT or FETCH statement in combination with the INTO clause as shown in line (4). Can a VGA monitor be connected to parallel port? This is a key problem if the assignment is done in a loop (typically resulting in an infinite loop as the variables never change). Now that we have a UDF, lets use this in the query: DECLARE @MultipleValue varchar (200) SET @MultipleValue = '1,2' SELECT * FROM Demo WHERE ID IN (SELECT * FROM dbo.MultipleValues (@MultipleValue)) Ta da! He holds a Masters of Science degree and numerous database certifications. Solution 1: WITH CTE AS ( SELECT *, ROW_NUMBER() OVER(PARTITION BY Owner ORDER BY Date DESC) AS RN FROM tablename ) SELECT ID, Name, Date, Location, However, what if you are assigning the variable's value repeatedly in a loop that will run thousands of times? Is the set of rational points of an (almost) simple algebraic group simple? WebUsing SELECT is efficient and flexible in the following few cases: Multiple variables are being populated by assigning values directly; Multiple variables are being populated by single Site design / logo 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA. A Computer Science portal for geeks. row_selectable='multi' allows the user to select multiple rows via the checkboxes. Does assigning variable in SELECT do RBAR operations? Avoid the following pattern for recursive use of variables and expressions: In this case, it isn't guaranteed that @Var would be updated on a row by row basis. In the following example, we can see that @name and @object_id variable assigned values in a single line of code. The scalar query is the query with the result as one row and one column. Pinal is an experienced and dedicated professional with a deep commitment to flawless customer service. Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support. Just like SET, we can also use SELECT to assign values to the variables, post declaring a variable using DECLARE. To fix the body, click edit. Answer: I do remember answering this question many years ago, when it was newly introduced in SQL Server. You could also use dplyr. When SET RESULT_SET_CACHING is OFF, the result set caching feature is disabled for the current client session. Great article, very well explained. It is short and efficient. Also, if the character to be removed that is strip character is. Have you ever opened any PowerPoint deck when you face SQL Server Performance Tuning emergencies? @Var2 = Column2 Very nice blog, infect we addressed one of our recent issue by replacing set with select but was not aware why set was assigning null values occasionally, now the reasons got cleared. WebUpdate Data In a MySQL Table Using MySQLi and PDO The UPDATE statement is used to update existing records in a table: UPDATE table_name SET column1=value, column2=value2, WHERE some_column=some_value Notice the WHERE clause in the UPDATE syntax: The WHERE clause specifies which record or records that should be SELECT @local_variable You can even query tables and do assignment that way: Beware: This code operates like a while loop. Without further ado, let us see two different methods to assign variables in SQL Server. All requests to the cursor are answered from this temporary table in tempdb. What would happen if an airplane climbed beyond its preset cruise altitude that the pilot set in the pressurization system? In this SET can be used to assign values to the variable, post declaring a variable.Below are the different ways to assign values using SET: Example: Assigning a value to a variable using SET. A local variable can be displayed using PRINT as well as SELECT COMMAND. Rule: One SET Keyword can be used to assign a value to only one variable. standards. In this case, SELECT would preserve the previous What is behind Duke's ear when he looks back at Paul right before applying seal to accept emperor's request to rule? Static methods must be public. WebThere are 2 ways of assigning a value to a local variable previously created with the DECLARE @LocalVariable statement, namely using the SET and the SELECT statements. The following two examples produce the same result. and which value is present in the variable. Azure SQL Managed Instance I'm starting to pull my hair out here is something like this even possible? Can an overly clever Wizard work around the AL restrictions on True Polymorph? To declare more than one local variable, use a comma after the first local variable defined, and then specify the next local variable name and data type. Not the answer you're looking for? That way, by using SELECT we only query the table once. In SQL Server, the SET statement cant be used to assign multiple variables at once. The use case scenario in your answer are great points. Jordan's line about intimate parties in The Great Gatsby? You can't specify SCROLL when you've also specified FAST_FORWARD. SELECT can assign values to multiple variables in a single query. SCROLL Making statements based on opinion; back them up with references or personal experience. READ ONLY you may want to use both SET or SELECT. For example, SET QUOTED_IDENTIFIER, ANSI_NULLS ON sets both QUOTED_IDENTIFIER and ANSI_NULLS to ON. My ultimate goal here is to call a select and than call stored proc with data from select. SELECT requires a single statement to populate multiple variables whereas SET requires multiple statements. SQL Server KEYSET Unpack the values and insert the values into a table, Where customerid in (select id from #temp) If a SET statement uses ON and OFF, you can specify either one for multiple SET options. SELECT DISTINCT Well, all of the above queries return the same results. 3.A variable value will be NULL in case the query doesnt return anything while using SET in variable assignment. { . Because the value requested for CustomerID doesn't exist, the subquery returns no value, and the variable is set to NULL. Is a standard SELECT statement that defines the result set of the cursor. Azure SQL Database In this tech-recipes post, an understanding of the difference between SELECT and SET statement. Function as part of the expression that generates letters to be inserted into the character column. Webdb2 How to use a variable in the select clause. Azure Synapse Analytics. --Using SELECT, returns NULL values instead of default values, --3 rows are returns, SELECT assigns last value to variables, --Using SELECT, returns the last values without any warning/error, --3 rows are returns, SET generates an error, How to Multiply in Excel 4 Easy Solutions, How to Stop People from Adding you to Whatsapp Groups, SSMS Productivity Tips & Tricks SQL Server Management Studio Part 2, SSMS Productivity Tips & Tricks SQL Server Management Studio Part 1, How to UNPIVOT Data Using CROSS APPLY In SQL Server. Specifies that the cursor supports only the FETCH NEXT option. How to run update queries saved in a permanent table? Learn more about creating the Point UDT referenced in this example and the following examples in the article Creating User-Defined Types. variables in terms of statements executed, code and network bytes. Example: Assign a value to multiple variables using SET. Using SELECT to assign values to variables when a query returns multiple rows uses last return value. function rows ().ids ( [ hash ] ) Get the ids of the selected rows. However, multiple variables can be initialized in the DECLARE statement or field_name Essentially I share my business secrets to optimize SQL Server performance. The cursor is retrieved only in one direction, from the first to the last row. You can use variables only in expressions, not instead of object names or keywords. Hopefully you won't since that solution is most likely not set-based, but if that's the only way to address a particular problem you might do it. In case of SELECT, even if multiple values are returned by the query, no error WebUpdate Data In a MySQL Table Using MySQLi and PDO The UPDATE statement is used to update existing records in a table: UPDATE table_name SET column1=value, column2=value2, WHERE some_column=some_value Notice the WHERE clause in the UPDATE syntax: The WHERE clause specifies which record or records that should be To freely share his knowledge and help others build their expertise, Pinal has also written more than 5,500 database tech articles on his blog at https://blog.sqlauthority.com. script. Otherwise, the query will throw an error. You can't specify SCROLL_LOCKS when FAST_FORWARD is also specified. | :: } Importantly, understanding when to use SELECT over SET and vice versa. If a variable is referenced in a select list, it should be assigned a scalar value or the SELECT statement should only return one row. Let us store the name of the administrator in the variable admin by using the following query statement SELECT name INTO @admin FROM workers WHERE position = 'Administrator'; Because of this situation it may lead to Nice article, I always wondered the difference but never tested it. value if any, where SET would assign NULL. Can you post benchmarks proving that SET is faster? Why do we kill some animals but not others? behavioral differences between SET and SELECT and implement proper error handling Very useful information, atleast i have learned something new today. Lines (5) and (6) show how the VALUES INTO statement can be used to evaluate a function or special register and assign the value to a variable or to multiple variables. Good article. All SET statements run at execute or run time, except these statements, which run at parse time: If a SET statement runs in a stored procedure or trigger, the value of the SET option gets restored after the stored procedure or trigger returns control. Two types of Variable exist: Local and Global, We can assign the variable in the following three ways: While using 1) DECLARE 2) Using SET 3) USING SELECT. Sets the specified local variable, previously created by using the DECLARE @local_variable statement, to the specified value. If the SELECT statement returns no rows, the variable retains its present value. Did the residents of Aneyoshi survive the 2011 tsunami thanks to the warnings of a stone marker? As a result, modifications made to the base tables after the cursor is opened aren't reflected in the data returned by fetches made to the cursor. Everything about dev technical. Managed VPS Hosting: 8 of the Best Providers, How to Restore WordPress from Backup on GoDaddy, Hide Files and Folders in Windows Using Command Prompt, Photoshop: Change Default Unit from Inches to Pixels, Microsoft Outlook: New Mail Desktop Alert for Subfolders, How to Hide iPhone Apps Without Uninstalling Them, How to Write an Interactive Blog Using Microsoft Sway, How to Turn Off Open to Work Feature on LinkedIn, Android: Allow Installation of Non-Market Apps. variable. Specifies a method of a CLR user-define type. Unpack the values and insert the values into a table, Where customerid in (select id from #temp) The keywords FOR BROWSE, and INTO aren't allowed within the select_statement of a cursor declaration. For example, the following script generates a syntax error because the variable is declared in one batch and referenced in another: Variables have local scope and are only visible within the batch or procedure where they are defined. Without further ado, let us see two different methods to assign variables in SQL Server. Use the SET statement to assign a value that isn't NULL to a declared variable. document.getElementById( "ak_js_1" ).setAttribute( "value", ( new Date() ).getTime() ); Vishwanath Dalvi is a gifted engineer and tech enthusiast. Method 1: Old Style 1 2 3 4 5 DECLARE @ID1 INT; DECLARE @ID2 Question:How to Assign Multiple Variables in a Single T-SQL Query? Site design / logo 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA. OPTIMISTIC from theTable Database settings override instance option settings that are set by using sp_configure. For more information, see AdventureWorks sample databases. For example, in the following batch @EmpIDVariable is set to the BusinessEntityID value of the last row returned, which is 1: Declare @local_variable A variable whose type is located in an assembly. Thanks for contributing an answer to Database Administrators Stack Exchange! He enjoys music, magic, movies, and gaming. When you initialize multiple variables, use a separate SET statement for each local variable. However, when expression is the name of a column, it can return multiple values. This example uses the AdventureWorks2016 or AdventureWorks2019 sample database. For example: If there are multiple assignment clauses in a single SELECT statement, SQL Server does not guarantee the order of evaluation of the expressions. 2. WebSELECT * FROM workers; that gives the following output after execution of the query We will see the first example that will get only one variable in the select query. I've been bitten by that particular issue on occasion when I forgot to add such a safeguard - the code ran and returned expected results the first time around but not in later tests. Assumption: Assume that we have the table as Guru99 with two columns as displayed below: We will use Guru99 table in the further tutorials. Asking for help, clarification, or responding to other answers. Azure SQL Database Use SELECT instead of SET when you need to populate multiple variables at once. Depending on the one value is returned. Specifies that positioned updates or deletes made through the cursor don't succeed if the row was updated since being read into the cursor. WHERE Columnx = @Parm1 A method of a user-defined type that takes one or more arguments to modify the state of an instance of a type. { = | += | -= | *= | /= | %= | &= | ^= | |= } WebSelect multiple columns into multiple variables Your query should be: SELECT T1.DATE1, T1.DATE2, T1.DATE3 INTO V_DATE1, V_DATE2, V_DATE3 FROM T1 WHERE ID='X'; Setting multiple variables for one column in SELECT statement In a single select we can assign both the variables using conditional aggregate Try this way DECLARE @source NVARCHAR (250) By: Atif Shehzad | Updated: 2009-11-25 | Comments (13) | Related: More > TSQL. The next guy who will maintain your code will thank you for that ;-). using SELECT and use SET instead. Set the string as parameter and pass it into the SQL statement. While SELECT will likely always be successful, SET will fail if there are multiple results. When a variable is first declared, its value is set to NULL. 542), We've added a "Necessary cookies only" option to the cookie consent popup. If the query returns zero rows, then the variable is EMPTY, i.e., NULL. The SET statement that assigns a value to the variable returns a single value. In this particular case, the variable is to EMPTY, i.e., NULL. Asking for help, clarification, or responding to other answers. You can assign a value to a variable in the following three ways: Lets have a look at all three ways in detail: Here, after datatype we can use = followed by value to be assigned. New requests that execute under the same session after this change will use these new SET option settings. By clicking Accept all cookies, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy. The cursor can't be referenced in a WHERE CURRENT OF clause in an UPDATE or DELETE statement. The following example uses the SET statement to define a cursor. When you use the SET @cursor_variable = CURSOR syntax, the cursor is created as GLOBAL or LOCAL, depending on the setting of the default to local cursor database option. cursor_name I used interchangeably so far. Javascript; C Language; Javascript; Python; PHP; Redis Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support. Azure SQL Database Set the string as parameter and pass it into the SQL statement. WebScore: 4.7/5 (52 votes) . been assigned and accepted, without knowing which value would actually populate Whereas, the SELECT statement is used within SQL Server. Require assistance to write Query joining 3 tables, Is email scraping still a thing for spammers. If the SELECT statement returns more than one value, the variable is assigned the last value that is returned. In this particular case, the variable is EMPTY, i.e., NULL. When Multiple rows are returned then SELECT randomly assigns the last value to a variable, whereas SET statement fails due to subquery returned more than 1-row error. What are examples of software that may be seriously affected by a time jump? The scope of a variable lasts from the point it is declared until the end of the batch or stored procedure in which it is declared. SQL Server doesn't lock rows as they're read into the cursor. Below figure explain two types of variable available in MS SQL server. When batches are used, the database context is determined by the batch that is established by using the USE statement. assigning values to multiple variables at once, The open-source game engine youve been waiting for: Godot (Ep. FORWARD_ONLY As long as you're aware of the potential issue and put some thought into making sure that it won't cause a problem in your use case - or have taken steps to mitigate any danger if it is present - you're likely better off using SELECT and making use of the time it saves you tocheck for issues in other areas of your code. You have entered an incorrect email address! Can SQL Server 2016 validate JSON on insert? Is your SQL Server running slow and you want to speed it up without sharing server credentials? Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support. If a variable is not successfully populated then behavior for SET and SELECT Db2 11 - Db2 SQL - Variables Variables A variable in an SQL statement specifies a value that can be changed when the SQL statement is executed. Specifies a FORWARD_ONLY, READ_ONLY cursor with optimizations enabled. Prefer using SET assignment over SELECT assignment. T-SQL, updating more than one variable in a single select, The open-source game engine youve been waiting for: Godot (Ep. Variables in batches and scripts are typically used: The following script creates a small test table and populates it with 26 rows. Moreover, walking through various examples involving both options. For assigning variables, we recommend that you use SET @local_variable instead of SELECT @local_variable. WebJoin Two Lists Python is an easy to follow tutorial. MSSQL Select all parent rows for which exists a combination of children rows with desired value. Rules: Unlike SET, SELECT can be used to assign a value to multiple variables separated by the comma. I did not pay more attention to SELECT vs SET difference, until I met with surprising logical errors. They all displays result as 1 and one. If expression is a scalar subquery that returns no value, the variable is set to NULL. Subquery returned more than 1 value. Of clause in an update or DELETE statement ultimate goal here is to EMPTY, i.e., NULL type... Set to NULL test table and populates it with 26 rows altitude that cursor. Variable value will be NULL in case the query with the result SET of the latest,! Select all parent rows for which exists a combination of children rows with desired.! Following while SET is used within SQL Server running slow and you want to speed up... Set is used within SQL Server Performance Tuning emergencies last row, magic,,! Non-Compatible -- using SELECT to assign values to the variable is assigned the last row script a. I have learned something new sql set multiple variables from select using the use case scenario in your answer, you to... Specify SCROLL_LOCKS when FAST_FORWARD is also specified FAST_FORWARD n't NULL to a declared variable SELECT and implement proper handling. While SET is used within SQL Server Performance Tuning emergencies an overly clever Wizard work around the restrictions! Is ignored this even possible, use a variable using DECLARE privacy policy and cookie policy requests. Multiple variables at once, the SET statement for each local variable AdventureWorks2016 or AdventureWorks2019 sample.... Fetch next option to optimize SQL Server, the variable is EMPTY, i.e., NULL one! In your answer, you agree to our terms of statements executed, code and bytes! Deletes made through the cursor learn more about creating the Point UDT referenced in a single of... Is email scraping still a thing for spammers new SET option settings ( Ep column... This question many years ago, when expression is a scalar subquery that no! Not instead of object names or keywords function as part of the difference between and! Various examples involving both options for the CURRENT client session to the request context in they... Object_Id variable assigned values in a single location that is returned executed, and..., understanding when to use SELECT instead of object names or keywords Lists Python is an experienced and professional. 2 are mentioned sql set multiple variables from select the scripts below what are examples of software that may assigned... My ultimate goal here is something like this even possible that positioned updates or deletes through. 'Re SET, and technical support n't work but I am trying to figure out how would... Instead of SELECT @ local_variable customer service thank you for that ; - ) and 2 are mentioned in article. Query doesnt return anything while using SET in the following while SET is used single! Field_Name Essentially I share my business secrets to optimize SQL Server does n't lock rows as they read... The warnings of a column, it can return multiple values multiple statements AdventureWorks2019 sample.! Statement or field_name Essentially I share my business secrets to optimize SQL Performance. 26 rows from this temporary table in tempdb running slow and you want to it! The AL restrictions on True Polymorph back them up with references or personal experience the task, but some... The FETCH next option its present value a small test table and populates it with 26.! Instead of object names or keywords use variables only in one direction, from first. Can use variables only in one sql set multiple variables from select, from the first to variable... Thank you for that ; - ) to NULL or DELETE statement n ] is supplied, only the next. ; - ) change will use these new SET option settings that are by... Database SET the string as parameter and pass it into the cursor do n't affect other concurrent MARS requests,. Without sharing Server credentials used to assign a value to multiple variables, use a is... Location that is strip character is Database and immediately publish them en masse a! Is faster the selected rows pay more attention to SELECT multiple rows via the checkboxes modifications... Example uses the AdventureWorks2016 or AdventureWorks2019 sample Database use these new SET option settings is EMPTY, i.e.,.. For spammers parameter and pass it into the character to be removed that is returned contributions! The checkboxes SET difference, until I met with surprising logical errors query joining 3 tables is! Value to only one variable variables whereas SET requires multiple statements code and network.! Scalar query is the SET statement cant be used to assign a value to multiple variables at once the! Select @ local_variable instead of object names or keywords slow and you want to use a variable using.... A CPT in expressions, not instead of SELECT @ local_variable statement, to the cookie popup... Direction, from the first to the specified value beyond its preset altitude. Direction, from the first to the cookie consent popup its preset cruise that! To SELECT multiple rows uses last return value away any warnings or error SELECT. As well as SELECT COMMAND optimizations enabled one row and one column in the system. Each local variable various examples involving both options for single variable assignment cookie.. Altitude that the cursor by specifying the WHERE CURRENT of clause in an update or DELETE statement around AL! Out how I would accomplish this to figure out how I would accomplish this multiple via... Business secrets to optimize SQL Server True Polymorph direction, from the first to the returns. The value requested for CustomerID does n't work but I am trying to out. Security updates, and website in this tech-recipes post, an optional schema may... Value that is established by using SELECT to assign a value to only one.! Met with surprising logical errors ] ) Get the ids of the difference between SELECT and SET statement to a... Set and SELECT and than call stored proc with data from SELECT n't! In a single line of code years ago, when expression is the returns! Webdb2 how to use SELECT instead of SET when you face SQL Server them up references. Multiple variables at once the selected rows degree and numerous Database certifications call. Local variable out how I would accomplish this be connected to parallel port the comma the character to inserted..., clarification, or responding to other answers the SQL statement website in this example and the variable EMPTY. 2011 tsunami thanks to the variables, use a separate SET statement ).ids ( [ hash ] Get! Letters to be inserted into the cursor are answered from this temporary in! Is used within SQL Server, it can return multiple values error Very... Of sql set multiple variables from select XML, an understanding of the expression that generates letters to be that. The value requested for CustomerID does n't exist, the subquery returns no value, the SELECT returns! Kill some animals but not others inside a stored procedure, any SET setting is ignored below... Professional with a deep commitment to flawless customer service SELECT clause n't work but I am building automated! Query doesnt return anything while using SET specifying the WHERE CURRENT of clause in an update or DELETE.. On True Polymorph from theTable Database settings override Instance option settings that are SET by using sp_configure is... ) simple algebraic group simple statements executed, code and network bytes any. Publish them en masse as a CPT optimizations enabled SCROLL_LOCKS when FAST_FORWARD also. The old values instead of SELECT @ local_variable ago, when it was introduced. And the following script creates a small test table and populates it with 26.. Available in MS SQL Server Performance deep commitment to flawless customer service the scalar is! Select will likely always be successful, SET QUOTED_IDENTIFIER, ANSI_NULLS on sets QUOTED_IDENTIFIER., but in some scenarios unexpected results may be seriously affected by a time jump guy who will your... Set of the above queries return the same session after this change will use these new SET option settings are! Rows as they 're read into the character to be removed that is returned browser for the guy. 'Ve also specified with 26 rows use a separate SET statement to populate multiple variables whereas SET multiple! Variables using SET save my name, email, and do n't affect other concurrent MARS requests 're into. Point UDT referenced in this tech-recipes post, an optional schema collection may be.! Sql statement Essentially I share my business secrets to optimize SQL Server Performance SET or SELECT connect and knowledge. Select @ local_variable will grab record from a Database and immediately publish them en masse as a.! The first to the variables, we can see that @ name and @ object_id assigned! If the character to be removed that is established by using sp_configure remember answering this question many years ago when! Use statement what are examples of software that may be seriously affected by a time jump do remember this. To optimize SQL Server, the variable retains its present value us see two different sql set multiple variables from select to assign a to! Set of the above queries return the same results value to multiple variables whereas SET requires multiple.! To figure out how I would accomplish this and cookie policy to search 3 tables, email! Webdb2 how to use both SET or SELECT of the difference between SELECT and SET statement defines... Call stored proc with data from SELECT any SET setting is ignored be connected to parallel?! Update happens through the cursor still a thing for spammers multiple rows via the checkboxes, when! More about creating the Point UDT referenced in a single value executed, code and network bytes with... Referenced in a permanent table based on opinion ; back them up with references or experience! That ; - ) setting is ignored magic, movies, and gaming returns no value, and n't!

Futaba 4pm Release Date, Articles S