<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>DML &#8211; SQLpowered.com</title>
	<atom:link href="https://sqlpowered.com/command-category/dml/feed/" rel="self" type="application/rss+xml" />
	<link>https://sqlpowered.com</link>
	<description>SQL Server + BI</description>
	<lastBuildDate>Fri, 31 Dec 2021 20:39:58 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://sqlpowered.com/wp-content/uploads/2020/07/FavIcon-e1594067873682-99x100.png</url>
	<title>DML &#8211; SQLpowered.com</title>
	<link>https://sqlpowered.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>MERGE</title>
		<link>https://sqlpowered.com/t-sql-commands/merge/</link>
		
		<dc:creator><![CDATA[Jan Dvořák]]></dc:creator>
		<pubDate>Fri, 31 Dec 2021 20:20:41 +0000</pubDate>
				<category><![CDATA[T-SQLpowered]]></category>
		<guid isPermaLink="false">https://sqlpowered.com/?post_type=t-sql-commands&#038;p=5298</guid>

					<description><![CDATA[Using OUTPUT clause: MERGE INTO [dbo].[TargetTable] [trg] USING ( SELECT [ID], [Value], [OtherValue] FROM [dbo].[SourceTable] ) AS [src] ON 1 = 0 WHEN NOT MATCHED THEN INSERT ( [ID],[Value] ) VALUES ([src].[ID], [src].[Value]) OUTPUT [Inserted].[ID], [Inserted].[Value], [src].[OtherValue] &#160;]]></description>
										<content:encoded><![CDATA[<p>Using OUTPUT clause:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="sql">MERGE INTO [dbo].[TargetTable] [trg]
USING ( SELECT [ID], [Value], [OtherValue]
		FROM [dbo].[SourceTable]
	  ) AS [src] ON 1 = 0
WHEN NOT MATCHED THEN
	INSERT ( [ID],[Value] )
	VALUES ([src].[ID], [src].[Value])
		OUTPUT [Inserted].[ID], [Inserted].[Value], [src].[OtherValue]</pre>
<p>&nbsp;</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>UPDATE</title>
		<link>https://sqlpowered.com/t-sql-commands/update/</link>
		
		<dc:creator><![CDATA[Jan Dvořák]]></dc:creator>
		<pubDate>Fri, 31 Dec 2021 20:09:38 +0000</pubDate>
				<category><![CDATA[T-SQLpowered]]></category>
		<guid isPermaLink="false">https://sqlpowered.com/?post_type=t-sql-commands&#038;p=5293</guid>

					<description><![CDATA[Update with the expression: UPDATE [dbo].[SampleTable] SET [Col1] = @a + @b + @c Update using the .WRITE() clause: UPDATE [dbo].[SampleTable] SET [Col1].WRITE('New Value, 0, NULL) UPDATE [dbo].[SampleTable] SET [Col1].WRITE(@a + @b + @c, 0, NULL) UPDATE [dbo].[SampleTable] SET [Col1].WRITE(@x, 500, 1000) &#160;]]></description>
										<content:encoded><![CDATA[<p>Update with the expression:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="sql">UPDATE [dbo].[SampleTable] SET [Col1] = @a + @b + @c
</pre>
<p>Update using the .WRITE() clause:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="sql">UPDATE [dbo].[SampleTable] SET [Col1].WRITE('New Value, 0, NULL)
UPDATE [dbo].[SampleTable] SET [Col1].WRITE(@a + @b + @c, 0, NULL)
UPDATE [dbo].[SampleTable] SET [Col1].WRITE(@x, 500, 1000)</pre>
<p>&nbsp;</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>INSERT &#8211; Basic</title>
		<link>https://sqlpowered.com/t-sql-commands/insert-basic/</link>
		
		<dc:creator><![CDATA[Jan Dvořák]]></dc:creator>
		<pubDate>Tue, 28 Dec 2021 19:46:03 +0000</pubDate>
				<category><![CDATA[T-SQLpowered]]></category>
		<guid isPermaLink="false">https://sqlpowered.com/?post_type=t-sql-commands&#038;p=5271</guid>

					<description><![CDATA[Insert one row with default values for all table columns: INSERT INTO [dbo].[SampleTable] DEFAULT VALUES SELECT INTO and specify a filegroup (2016 SP2+): SELECT * INTO [dbo].[SampleTable_Copy] ON [OtherFilegoup] FROM [dbo].[SampleTable] &#160;]]></description>
										<content:encoded><![CDATA[<p>Insert one row with default values for all table columns:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="sql">INSERT INTO [dbo].[SampleTable] DEFAULT VALUES</pre>
<p>SELECT INTO and specify a filegroup (2016 SP2+):</p>
<pre class="EnlighterJSRAW" data-enlighter-language="sql">SELECT * 
    INTO [dbo].[SampleTable_Copy] ON [OtherFilegoup]
FROM [dbo].[SampleTable]</pre>
<p>&nbsp;</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
