<?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>MS SQL Server &#8211; My Shitty Code</title>
	<atom:link href="https://myshittycode.com/tag/ms-sql-server/feed/" rel="self" type="application/rss+xml" />
	<link>https://myshittycode.com</link>
	<description>Embracing the Messiness in Search of Epic Solutions</description>
	<lastBuildDate>Fri, 06 Jan 2023 16:51:26 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.1</generator>

<image>
	<url>https://myshittycode.com/wp-content/uploads/2022/04/cropped-icon-32x32.png</url>
	<title>MS SQL Server &#8211; My Shitty Code</title>
	<link>https://myshittycode.com</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">205304208</site>	<item>
		<title>MS SQL Server + Hibernate 5: Incorrect syntax near &#8216;@P0&#8217;</title>
		<link>https://myshittycode.com/2017/06/20/ms-sql-server-hibernate-5-incorrect-syntax-near-p0/</link>
					<comments>https://myshittycode.com/2017/06/20/ms-sql-server-hibernate-5-incorrect-syntax-near-p0/#comments</comments>
		
		<dc:creator><![CDATA[Shitty Author]]></dc:creator>
		<pubDate>Tue, 20 Jun 2017 16:07:49 +0000</pubDate>
				<category><![CDATA[Programming Language]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Hibernate]]></category>
		<category><![CDATA[MS SQL Server]]></category>
		<guid isPermaLink="false">http://myshittycode.com/?p=1048</guid>

					<description><![CDATA[<p>PROBLEM When upgrading to Hibernate 5, the following exception is thrown:- SOLUTION Change the MS SQL Server dialect from this&#8230; &#8230; to this &#8230;</p>
<p>The post <a rel="nofollow" href="https://myshittycode.com/2017/06/20/ms-sql-server-hibernate-5-incorrect-syntax-near-p0/">MS SQL Server + Hibernate 5: Incorrect syntax near &#8216;@P0&#8217;</a> appeared first on <a rel="nofollow" href="https://myshittycode.com">My Shitty Code</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">PROBLEM</h2>



<p>When upgrading to Hibernate 5, the following exception is thrown:-</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
Caused by: java.sql.SQLException: Incorrect syntax near &#039;@P0&#039;.
	at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:372) ~&#x5B;jtds-1.3.1.jar:1.3.1]
	at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2988) ~&#x5B;jtds-1.3.1.jar:1.3.1]
	at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2421) ~&#x5B;jtds-1.3.1.jar:1.3.1]
</pre></div>


<h2 class="wp-block-heading">SOLUTION</h2>



<p>Change the MS SQL Server dialect from this&#8230;</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
org.hibernate.dialect.SQLServerDialect
</pre></div>


<p>&#8230; to this &#8230;</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
org.hibernate.dialect.SQLServer2012Dialect
</pre></div><p>The post <a rel="nofollow" href="https://myshittycode.com/2017/06/20/ms-sql-server-hibernate-5-incorrect-syntax-near-p0/">MS SQL Server + Hibernate 5: Incorrect syntax near &#8216;@P0&#8217;</a> appeared first on <a rel="nofollow" href="https://myshittycode.com">My Shitty Code</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://myshittycode.com/2017/06/20/ms-sql-server-hibernate-5-incorrect-syntax-near-p0/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1048</post-id>	</item>
		<item>
		<title>MS SQL Server: Executing SQL Script from Command Line</title>
		<link>https://myshittycode.com/2014/09/17/ms-sql-server-executing-sql-script-from-command-line/</link>
					<comments>https://myshittycode.com/2014/09/17/ms-sql-server-executing-sql-script-from-command-line/#respond</comments>
		
		<dc:creator><![CDATA[Shitty Author]]></dc:creator>
		<pubDate>Wed, 17 Sep 2014 16:31:59 +0000</pubDate>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[MS SQL Server]]></category>
		<guid isPermaLink="false">http://myshittycode.com/?p=585</guid>

					<description><![CDATA[<p>PROBLEM When opening a 150MB SQL script file in Microsoft SQL Server Management Studio, the following error appears:- SOLUTION Instead of opening the large SQL script file and execute it, we can execute it directly from command line. &#8230; where -E uses trusted connection, -d points to the database and -i points to the SQL [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://myshittycode.com/2014/09/17/ms-sql-server-executing-sql-script-from-command-line/">MS SQL Server: Executing SQL Script from Command Line</a> appeared first on <a rel="nofollow" href="https://myshittycode.com">My Shitty Code</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">PROBLEM</h2>



<p>When opening a 150MB SQL script file in Microsoft SQL Server Management Studio, the following error appears:-</p>



<figure class="wp-block-image aligncenter"><img fetchpriority="high" decoding="async" width="419" height="145" src="https://myshittycode.com/wp-content/uploads/2014/09/snap2-1.jpg?x45560" alt="" class="wp-image-586" srcset="https://myshittycode.com/wp-content/uploads/2014/09/snap2-1.jpg 419w, https://myshittycode.com/wp-content/uploads/2014/09/snap2-1-300x104.jpg 300w" sizes="(max-width: 419px) 100vw, 419px" /></figure>



<h2 class="wp-block-heading">SOLUTION</h2>



<p>Instead of opening the large SQL script file and execute it, we can execute it directly from command line.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
sqlcmd -E -d&#x5B;database_name] -i&#x5B;sql_file_path]
</pre></div>


<p>&#8230; where <code>-E</code> uses trusted connection, <code>-d</code> points to the database and <code>-i</code> points to the SQL script file path.</p>



<p>For example,</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
sqlcmd -E -dshittydb -ic:\Users\shittyuser\shittydb.sql
</pre></div><p>The post <a rel="nofollow" href="https://myshittycode.com/2014/09/17/ms-sql-server-executing-sql-script-from-command-line/">MS SQL Server: Executing SQL Script from Command Line</a> appeared first on <a rel="nofollow" href="https://myshittycode.com">My Shitty Code</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://myshittycode.com/2014/09/17/ms-sql-server-executing-sql-script-from-command-line/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">585</post-id>	</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Lazy Loading (feed)
Database Caching using Disk

Served from: myshittycode.com @ 2026-02-20 13:41:45 by W3 Total Cache
-->