 




<?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>IT Answers &#187; SQL Server Variables</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/tag/sql-server-variables/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers</link>
	<description></description>
	<lastBuildDate>Sat, 18 May 2013 21:33:01 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Error in SQL Server 2005 with passing a variable</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/error-in-sql-server-2005-with-passing-a-variable/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/error-in-sql-server-2005-with-passing-a-variable/#comments</comments>
		<pubDate>Fri, 12 Dec 2008 16:23:54 +0000</pubDate>
		<dc:creator>SQL Server Ask the Experts</dc:creator>
				<category><![CDATA[SQL Server 2005]]></category>
		<category><![CDATA[SQL Server errors]]></category>
		<category><![CDATA[SQL Server Variables]]></category>
		<category><![CDATA[T-SQL]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[In T-SQL code on SQL Server 2005, the variable :t_id is being passed from other pages and works in other statements, but it is not parsing within this statement: define(&#8220;TF_T_INFO_INSERET&#8221;, &#8221; insert into TFT (WG_ID,task_id,tf_id) SELECT (select WGID from LU_T where TID= :t_id ), :t_id , (select max(TF_ID) from LU_TF); &#8220;); If I replace :t_id [...]]]></description>
				<content:encoded><![CDATA[<p>In T-SQL code on SQL Server 2005, the variable :t_id is being passed from other pages and works in other statements, but it is not parsing within this statement:</p>
<p><i>define(&#8220;TF_T_INFO_INSERET&#8221;, &#8221;<br />
insert into TFT (WG_ID,task_id,tf_id)<br />
SELECT (select WGID from LU_T where TID= :t_id ), :t_id , (select max(TF_ID) from LU_TF); &#8220;);</i></p>
<p>If I replace :t_id with a number, it works fine. I tried declaring a new variable and passing it to the statement, and I get this same error:</p>
<p><i>An error was encountered while saving: &#91;Microsoft&#93;&#91;ODBC SQL Server Driver&#93;COUNT field incorrect or syntax error (SQLExecute&#91;0&#93; at extpdo_odbcodbc_stmt.c:133)</i></p>
<p>Any idea what is going on?</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/error-in-sql-server-2005-with-passing-a-variable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>insert into with select and passing variables</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/insert-into-with-select-and-passing-variables/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/insert-into-with-select-and-passing-variables/#comments</comments>
		<pubDate>Wed, 10 Dec 2008 14:21:51 +0000</pubDate>
		<dc:creator>Bu33ing</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[SQL Server 2005]]></category>
		<category><![CDATA[SQL Server errors]]></category>
		<category><![CDATA[SQL Server Variables]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[This is driving me NUTZ &#8212;- SQL Server 2005 and PHP the variable :t_id is being passed from other pages and works in other statements, but is not parsing within this statement. If I replace :t_id with say 30, it works just fine. I tried declaring a new variable and passing it to the statement, [...]]]></description>
				<content:encoded><![CDATA[<p>This is driving me NUTZ  &#8212;-</p>
<p>SQL Server 2005 and PHP</p>
<p>the variable :t_id is being passed from other pages and works in other statements, but is not parsing within this  statement.  If I replace :t_id with say 30, it works just fine.  I tried declaring a new variable and passing it to the statement, and get the same error.</p>
<p>define(&#8220;TF_T_INFO_INSERET&#8221;, &#8221;<br />
insert into TFT (WG_ID,task_id,tf_id)<br />
SELECT (select WGID from LU_T where TID= :t_id ), :t_id , (select max(TF_ID) from LU_TF);<br />
&#8220;);</p>
<p>&#8212;&#8212;&#8212;&#8212;output &#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>Performing an upload: insert into TFT (WG_ID,task_id,tf_id) SELECT (select WGID from LU_T where TID= :t_id ),:t_id ,(select max(TF_ID) from LU_T); </p>
<p>Binding value :t_id to 30</p>
<p>&#8212;&#8212; ERROR &#8212;<br />
An error was encountered while saving: [Microsoft][ODBC SQL Server Driver]COUNT field incorrect or syntax error (SQLExecute[0] at ext\pdo_odbc\odbc_stmt.c:133)<br />
&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>Thanks<br />
B</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/insert-into-with-select-and-passing-variables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 3/14 queries in 0.018 seconds using memcached
Object Caching 388/413 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-18 23:15:55 -->