<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: SQL SERVER &#8211; Difference Between EXEC and EXECUTE vs EXEC() &#8211; Use EXEC/EXECUTE for SP always</title>
	<atom:link href="http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/</link>
	<description>Personal Notes of Pinal Dave</description>
	<lastBuildDate>Mon, 13 Feb 2012 15:11:24 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: sunny</title>
		<link>http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/#comment-242946</link>
		<dc:creator><![CDATA[sunny]]></dc:creator>
		<pubDate>Tue, 24 Jan 2012 09:22:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/#comment-242946</guid>
		<description><![CDATA[Hi guys,
can anybody hepl me what is exact stored procedure? differnce between procedure and SP,and can I use SP on DB2.


Thanks &amp; Regards
Sunny V]]></description>
		<content:encoded><![CDATA[<p>Hi guys,<br />
can anybody hepl me what is exact stored procedure? differnce between procedure and SP,and can I use SP on DB2.</p>
<p>Thanks &amp; Regards<br />
Sunny V</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nitish</title>
		<link>http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/#comment-242458</link>
		<dc:creator><![CDATA[Nitish]]></dc:creator>
		<pubDate>Mon, 23 Jan 2012 04:12:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/#comment-242458</guid>
		<description><![CDATA[Can i Use a Exec Function  through Stored procedure Parameters???]]></description>
		<content:encoded><![CDATA[<p>Can i Use a Exec Function  through Stored procedure Parameters???</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: BanRBAR</title>
		<link>http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/#comment-178155</link>
		<dc:creator><![CDATA[BanRBAR]]></dc:creator>
		<pubDate>Thu, 13 Oct 2011 00:58:56 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/#comment-178155</guid>
		<description><![CDATA[Go the RBAR (Row By Agonizing Row). Do you have sufficient access to create views on the fly? You could create a view for the destination table and eliminate the cursor as well...

-- Create some test data
set nocount on
if object_id(&#039;[dbo].[srcTable]&#039;, N&#039;U&#039;) is not null
	drop table [dbo].[srcTable]
create table [dbo].[srcTable] (
	[id] int not null primary key identity
	, [name] nvarchar(50) not null
	, [value] int not null
)
declare @counter int = 0
while (@counter &lt; 1000)
begin
	insert [dbo].[srcTable] ([name], [value]) select newid(), floor(rand() * 1000)
	set @counter = 1 + @counter
end

if object_id(&#039;[dbo].[dstTable]&#039;, N&#039;U&#039;) is not null
	drop table [dbo].[dstTable]
create table [dbo].[dstTable] (
	[id] int not null primary key --NO: identity
	, [name] nvarchar(100) not null
	, [value] decimal(18,2) not null
)
-- This could be a stored proc parameter...
declare @tableName nvarchar(255) = &#039;[dbo].[dstTable]&#039;
-- Separate the DROP and CREATE statements because sp_executesql can&#039;t handle batches.
declare @sql nvarchar(max) =
&#039;if object_id(&#039;&#039;[dbo].[targetView]&#039;&#039;, N&#039;&#039;V&#039;&#039;) is not null
drop view [dbo].[targetView]&#039;
exec sp_executesql @sql

set @sql =
&#039;create view [dbo].[targetView] as
select id, name, value from &#039;+@tableName
exec sp_executesql @sql
-- Now do your conversions on the view...
set nocount off
insert [dbo].[targetView] (id, name, value)
	select [id], [name], 33.3 * [value]
	from	[dbo].[srcTable]

select * from [dbo].[srcTable]
select * from [dbo].[dstTable]
select * from [dbo].[targetView]
/*
-- Clean up
drop view [dbo].[targetView]
drop table [dbo].[dstTable]
drop table [dbo].[srcTable]
*/]]></description>
		<content:encoded><![CDATA[<p>Go the RBAR (Row By Agonizing Row). Do you have sufficient access to create views on the fly? You could create a view for the destination table and eliminate the cursor as well&#8230;</p>
<p>&#8211; Create some test data<br />
set nocount on<br />
if object_id(&#8216;[dbo].[srcTable]&#8216;, N&#8217;U') is not null<br />
	drop table [dbo].[srcTable]<br />
create table [dbo].[srcTable] (<br />
	[id] int not null primary key identity<br />
	, [name] nvarchar(50) not null<br />
	, [value] int not null<br />
)<br />
declare @counter int = 0<br />
while (@counter &lt; 1000)<br />
begin<br />
	insert [dbo].[srcTable] ([name], [value]) select newid(), floor(rand() * 1000)<br />
	set @counter = 1 + @counter<br />
end</p>
<p>if object_id(&#039;[dbo].[dstTable]&#039;, N&#039;U&#039;) is not null<br />
	drop table [dbo].[dstTable]<br />
create table [dbo].[dstTable] (<br />
	[id] int not null primary key &#8211;NO: identity<br />
	, [name] nvarchar(100) not null<br />
	, [value] decimal(18,2) not null<br />
)<br />
&#8211; This could be a stored proc parameter&#8230;<br />
declare @tableName nvarchar(255) = &#039;[dbo].[dstTable]&#039;<br />
&#8211; Separate the DROP and CREATE statements because sp_executesql can&#039;t handle batches.<br />
declare @sql nvarchar(max) =<br />
&#039;if object_id(&#039;&#039;[dbo].[targetView]&#039;&#039;, N&#039;&#039;V&#039;&#039;) is not null<br />
drop view [dbo].[targetView]&#039;<br />
exec sp_executesql @sql</p>
<p>set @sql =<br />
&#039;create view [dbo].[targetView] as<br />
select id, name, value from &#039;+@tableName<br />
exec sp_executesql @sql<br />
&#8211; Now do your conversions on the view&#8230;<br />
set nocount off<br />
insert [dbo].[targetView] (id, name, value)<br />
	select [id], [name], 33.3 * [value]<br />
	from	[dbo].[srcTable]</p>
<p>select * from [dbo].[srcTable]<br />
select * from [dbo].[dstTable]<br />
select * from [dbo].[targetView]<br />
/*<br />
&#8211; Clean up<br />
drop view [dbo].[targetView]<br />
drop table [dbo].[dstTable]<br />
drop table [dbo].[srcTable]<br />
*/</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dhiraj</title>
		<link>http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/#comment-177826</link>
		<dc:creator><![CDATA[dhiraj]]></dc:creator>
		<pubDate>Wed, 12 Oct 2011 06:34:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/#comment-177826</guid>
		<description><![CDATA[thanks brdr 
its really helps me for my .NET app]]></description>
		<content:encoded><![CDATA[<p>thanks brdr<br />
its really helps me for my .NET app</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: BillS</title>
		<link>http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/#comment-148110</link>
		<dc:creator><![CDATA[BillS]]></dc:creator>
		<pubDate>Wed, 13 Jul 2011 22:28:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/#comment-148110</guid>
		<description><![CDATA[While doing a conversion, I&#039;m using a cursor to move data into an intermediate table (that&#039;s a given).  That tablename is NOW required to be variable, for sending to different receivers.  Since that isn&#039;t possible in a direct sense, I&#039;m considering building the insert dynamically, but I&#039;m not sure how to get the variables into the EXEC clause.
Basically, my starting point is:
ALTER PROCEDURE [dbo].x AS
DECLARE @i1 INT, @i2 INT, @c1 CHAR, @c2 CHAR, @v1 VARCHAR(20),....
Declare @xcursor CURSOR
Set @xcursor = cursor for 
    SELECT yada FROM wada
Open @xcursor 
WHILE @@FETCH_STATUS = 0
BEGIN 
    FETCH NEXT FROM @policy_cursor INTO @c1,@i1,@v1,@i2,@c2,...
    IF @@FETCH_STATUS = 0
    BEGIN 
        {yadayada operations on data}
        INSERT INTO @VARIABLE-TABLE-NAME --actually just the database
            VALUES (dozens of variables and constants)
END END

So, while I can&#039;t use @VARIABLE-TABLE-NAME directly, I know I can create an INSERT statement dynamically and EXECUTE it.  The problem is passing in all the variables.  Is there a way to do it within the query?  Even if I created another external procedure, I&#039;d be back to the same problem of making the tablename variable.
Thanks]]></description>
		<content:encoded><![CDATA[<p>While doing a conversion, I&#8217;m using a cursor to move data into an intermediate table (that&#8217;s a given).  That tablename is NOW required to be variable, for sending to different receivers.  Since that isn&#8217;t possible in a direct sense, I&#8217;m considering building the insert dynamically, but I&#8217;m not sure how to get the variables into the EXEC clause.<br />
Basically, my starting point is:<br />
ALTER PROCEDURE [dbo].x AS<br />
DECLARE @i1 INT, @i2 INT, @c1 CHAR, @c2 CHAR, @v1 VARCHAR(20),&#8230;.<br />
Declare @xcursor CURSOR<br />
Set @xcursor = cursor for<br />
    SELECT yada FROM wada<br />
Open @xcursor<br />
WHILE @@FETCH_STATUS = 0<br />
BEGIN<br />
    FETCH NEXT FROM @policy_cursor INTO @c1,@i1,@v1,@i2,@c2,&#8230;<br />
    IF @@FETCH_STATUS = 0<br />
    BEGIN<br />
        {yadayada operations on data}<br />
        INSERT INTO @VARIABLE-TABLE-NAME &#8211;actually just the database<br />
            VALUES (dozens of variables and constants)<br />
END END</p>
<p>So, while I can&#8217;t use @VARIABLE-TABLE-NAME directly, I know I can create an INSERT statement dynamically and EXECUTE it.  The problem is passing in all the variables.  Is there a way to do it within the query?  Even if I created another external procedure, I&#8217;d be back to the same problem of making the tablename variable.<br />
Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AlwaysLearning</title>
		<link>http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/#comment-128745</link>
		<dc:creator><![CDATA[AlwaysLearning]]></dc:creator>
		<pubDate>Thu, 14 Apr 2011 00:15:02 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/#comment-128745</guid>
		<description><![CDATA[Have you considered using sp_executesql?

declare @Column nvarchar(max) = &#039;CombineConnectTime&#039;
declare @Table nvarchar(max) = &#039;Foo&#039;
declare @Exists int

declare @SQLString nvarchar(max) = N&#039;select @e=1 from sys.columns where name=@c and object_id=object_id(@t)&#039;
declare @ParmDefinition nvarchar(max) = N&#039;@e int output, @c nvarchar(max), @t nvarchar(max)&#039;

-- Test existance
create table dbo.Foo (
	CombineConnectTime datetime
)
set @Exists = 0
execute sp_executesql @SQLString, @ParmDefinition, @e=@Exists output, @c=@Column, @t=@Table
if (@Exists = 1)
begin
	print &#039;Exists&#039;
end
else
begin
	print &#039;Doesn&#039;&#039;t exist&#039;
end

-- Test nonexistance
drop table dbo.Foo
set @Exists = 0
execute sp_executesql @SQLString, @ParmDefinition, @e=@Exists output, @c=@Column, @t=@Table
if (@Exists = 1)
begin
	print &#039;Exists&#039;
end
else
begin
	print &#039;Doesn&#039;&#039;t exist&#039;
end]]></description>
		<content:encoded><![CDATA[<p>Have you considered using sp_executesql?</p>
<p>declare @Column nvarchar(max) = &#8216;CombineConnectTime&#8217;<br />
declare @Table nvarchar(max) = &#8216;Foo&#8217;<br />
declare @Exists int</p>
<p>declare @SQLString nvarchar(max) = N&#8217;select @e=1 from sys.columns where name=@c and object_id=object_id(@t)&#8217;<br />
declare @ParmDefinition nvarchar(max) = N&#8217;@e int output, @c nvarchar(max), @t nvarchar(max)&#8217;</p>
<p>&#8211; Test existance<br />
create table dbo.Foo (<br />
	CombineConnectTime datetime<br />
)<br />
set @Exists = 0<br />
execute sp_executesql @SQLString, @ParmDefinition, @e=@Exists output, @c=@Column, @t=@Table<br />
if (@Exists = 1)<br />
begin<br />
	print &#8216;Exists&#8217;<br />
end<br />
else<br />
begin<br />
	print &#8216;Doesn&#8221;t exist&#8217;<br />
end</p>
<p>&#8211; Test nonexistance<br />
drop table dbo.Foo<br />
set @Exists = 0<br />
execute sp_executesql @SQLString, @ParmDefinition, @e=@Exists output, @c=@Column, @t=@Table<br />
if (@Exists = 1)<br />
begin<br />
	print &#8216;Exists&#8217;<br />
end<br />
else<br />
begin<br />
	print &#8216;Doesn&#8221;t exist&#8217;<br />
end</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Avida</title>
		<link>http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/#comment-128668</link>
		<dc:creator><![CDATA[Avida]]></dc:creator>
		<pubDate>Wed, 13 Apr 2011 12:00:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/#comment-128668</guid>
		<description><![CDATA[How can i, write a &quot;IF&quot; statment and inside of it run &quot;EXEC&quot;?

SET @Query = &#039;SELECT * FROM sys.columns WHERE Name = &#039;&#039;CombineConnectTime&#039;&#039; AND Object_ID = Object_ID(&#039;&#039;&#039;+@OurTableMirorName+&#039;&#039;&#039;)&#039;
    
 IF EXISTS(EXEC(@Query))
BEGIN
....
END

thanks]]></description>
		<content:encoded><![CDATA[<p>How can i, write a &#8220;IF&#8221; statment and inside of it run &#8220;EXEC&#8221;?</p>
<p>SET @Query = &#8216;SELECT * FROM sys.columns WHERE Name = &#8221;CombineConnectTime&#8221; AND Object_ID = Object_ID(&#8221;&#8217;+@OurTableMirorName+&#8221;&#8217;)&#8217;</p>
<p> IF EXISTS(EXEC(@Query))<br />
BEGIN<br />
&#8230;.<br />
END</p>
<p>thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/#comment-116021</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Fri, 04 Feb 2011 11:14:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/#comment-116021</guid>
		<description><![CDATA[Move the dynamic result to a temp table and join with that table]]></description>
		<content:encoded><![CDATA[<p>Move the dynamic result to a temp table and join with that table</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ankur Patel</title>
		<link>http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/#comment-115733</link>
		<dc:creator><![CDATA[Ankur Patel]]></dc:creator>
		<pubDate>Wed, 02 Feb 2011 23:42:16 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/#comment-115733</guid>
		<description><![CDATA[Is it possible to use the dynamic sql statement as a data set to be joined with other tables
i.e.

declare @vvSQL as varchar(max)
set @vvSQL = &#039;select * from table_name&#039;
select * from (exec (@vvSQL)) a, table_name_b b
where a.id = b.id

I want something similar to the above and do not want to create a temp table as the number of column would be different everytime.

Can You suggest some solution??]]></description>
		<content:encoded><![CDATA[<p>Is it possible to use the dynamic sql statement as a data set to be joined with other tables<br />
i.e.</p>
<p>declare @vvSQL as varchar(max)<br />
set @vvSQL = &#8216;select * from table_name&#8217;<br />
select * from (exec (@vvSQL)) a, table_name_b b<br />
where a.id = b.id</p>
<p>I want something similar to the above and do not want to create a temp table as the number of column would be different everytime.</p>
<p>Can You suggest some solution??</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Puneet</title>
		<link>http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/#comment-114677</link>
		<dc:creator><![CDATA[Puneet]]></dc:creator>
		<pubDate>Thu, 27 Jan 2011 12:04:15 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/#comment-114677</guid>
		<description><![CDATA[Hi All, 
I have a situation - 
I have a program which extracts correspondence data of approx 7500 clients. It takes id of first 750 client and calls a stored procedure passing those 750 ids. 
In that Stored Proc data is extracted from 2 tables using Union All. 
Now I have a task to speed up the process.
One thing that I have in my mind is to store all the 7500 ids in a table and then call stored proc and extracting the data  based on ids stored in that table.
Any other work around or suggestion is highly appreciated. 
Thanks
Puneet]]></description>
		<content:encoded><![CDATA[<p>Hi All,<br />
I have a situation &#8211;<br />
I have a program which extracts correspondence data of approx 7500 clients. It takes id of first 750 client and calls a stored procedure passing those 750 ids.<br />
In that Stored Proc data is extracted from 2 tables using Union All.<br />
Now I have a task to speed up the process.<br />
One thing that I have in my mind is to store all the 7500 ids in a table and then call stored proc and extracting the data  based on ids stored in that table.<br />
Any other work around or suggestion is highly appreciated.<br />
Thanks<br />
Puneet</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/#comment-100534</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Wed, 17 Nov 2010 11:27:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/#comment-100534</guid>
		<description><![CDATA[What was the error?]]></description>
		<content:encoded><![CDATA[<p>What was the error?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AlwaysLearning</title>
		<link>http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/#comment-100433</link>
		<dc:creator><![CDATA[AlwaysLearning]]></dc:creator>
		<pubDate>Tue, 16 Nov 2010 22:37:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/#comment-100433</guid>
		<description><![CDATA[Hi Lata,

You&#039;re concatenating a string with NULL and getting a NULL result. i.e.: @qry is NULL.

Instead of:
set @qry = &#039;update &#039; + @str1 + &#039; set dob= &#039; + NULL + &#039; where dob like &#039;&#039;%XX/XX/%&#039;&#039; or dob like &#039;&#039;%xx/xx/%&#039;&#039;&#039;;

You probably want:
set @qry = &#039;update &#039; + @str1 + &#039; set dob=NULL where dob like &#039;&#039;%XX/XX/%&#039;&#039; or dob like &#039;&#039;%xx/xx/%&#039;&#039;&#039;;

Also, unless your database is running with a case-sensitive collation, you could probably shorten it to this:
set @qry = &#039;update &#039; + @str1 + &#039; set dob=NULL where dob like &#039;&#039;%XX/XX/%&#039;&#039;&#039;;

Good luck,
AlwaysLearning]]></description>
		<content:encoded><![CDATA[<p>Hi Lata,</p>
<p>You&#8217;re concatenating a string with NULL and getting a NULL result. i.e.: @qry is NULL.</p>
<p>Instead of:<br />
set @qry = &#8216;update &#8216; + @str1 + &#8216; set dob= &#8216; + NULL + &#8216; where dob like &#8221;%XX/XX/%&#8221; or dob like &#8221;%xx/xx/%&#8221;&#8217;;</p>
<p>You probably want:<br />
set @qry = &#8216;update &#8216; + @str1 + &#8216; set dob=NULL where dob like &#8221;%XX/XX/%&#8221; or dob like &#8221;%xx/xx/%&#8221;&#8217;;</p>
<p>Also, unless your database is running with a case-sensitive collation, you could probably shorten it to this:<br />
set @qry = &#8216;update &#8216; + @str1 + &#8216; set dob=NULL where dob like &#8221;%XX/XX/%&#8221;&#8217;;</p>
<p>Good luck,<br />
AlwaysLearning</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: LATA</title>
		<link>http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/#comment-100325</link>
		<dc:creator><![CDATA[LATA]]></dc:creator>
		<pubDate>Tue, 16 Nov 2010 11:30:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/#comment-100325</guid>
		<description><![CDATA[I WANT TO EXECUTE THIS QUERY:
--update ac001part001 set dob=null where dob like --&#039;%xx/xx/%&#039; or dob like &#039;%XX/XX%&#039;
THERE ARE 100 TABLES WHICH IS NAMED AS AC001PART001,AC001PART002....AND AC001PART093

- I CAN ABLE TO EXECUTE ABOVE QUERY IF I CHANGED THE TABLE NAME ONE BY ONE...BUT I WANT TO MAKE POSSIBLE THIS QUERIES FOR 1 TO 100 TABLES WITHIN ONE SQL SYNTAX..
--========================================
DECLARE @intFlag INT;
declare @str1 nvarchar(100);
DECLARE @qry nvarchar(2000);
SET @intFlag = 5;
set @str1=&#039;&#039;;
WHILE (@intFlag &lt;=93)
BEGIN
	PRINT @intFlag;
    select @str1 = &#039;ac001part&#039; + convert(nvarchar(10),CAST(REPLICATE(0,3-LEN(@intflag)) AS VARCHAR(3)) + CAST(@intflag AS VARCHAR(3)));
	print @str1;
	
	set @qry = &#039;update &#039; + @str1 + &#039; set dob= &#039; + NULL + &#039; where dob like &#039;&#039;%XX/XX/%&#039;&#039; or dob like &#039;&#039;%xx/xx/%&#039;&#039;&#039;;	
	execute sp_executesql @qry	;
	print  @qry;
	SET @intFlag = @intFlag + 1;
END
GO
--========================================
PLEASE HELP ME IMMEDIATELY AS SOON AS POSSIBLE...AS I SPOILED MY HALF OF THE DAY TO SOLVE THIS..ABOVE SQL SYNTAX IS CORRECT..NO ERROR..BUT IT&#039;S OUTPUT NOT AFFECTS THE ROW...]]></description>
		<content:encoded><![CDATA[<p>I WANT TO EXECUTE THIS QUERY:<br />
&#8211;update ac001part001 set dob=null where dob like &#8211;&#8217;%xx/xx/%&#8217; or dob like &#8216;%XX/XX%&#8217;<br />
THERE ARE 100 TABLES WHICH IS NAMED AS AC001PART001,AC001PART002&#8230;.AND AC001PART093</p>
<p>- I CAN ABLE TO EXECUTE ABOVE QUERY IF I CHANGED THE TABLE NAME ONE BY ONE&#8230;BUT I WANT TO MAKE POSSIBLE THIS QUERIES FOR 1 TO 100 TABLES WITHIN ONE SQL SYNTAX..<br />
&#8211;========================================<br />
DECLARE @intFlag INT;<br />
declare @str1 nvarchar(100);<br />
DECLARE @qry nvarchar(2000);<br />
SET @intFlag = 5;<br />
set @str1=&#8221;;<br />
WHILE (@intFlag &lt;=93)<br />
BEGIN<br />
	PRINT @intFlag;<br />
    select @str1 = &#039;ac001part&#039; + convert(nvarchar(10),CAST(REPLICATE(0,3-LEN(@intflag)) AS VARCHAR(3)) + CAST(@intflag AS VARCHAR(3)));<br />
	print @str1;</p>
<p>	set @qry = &#039;update &#039; + @str1 + &#039; set dob= &#039; + NULL + &#039; where dob like &#039;&#039;%XX/XX/%&#039;&#039; or dob like &#039;&#039;%xx/xx/%&#039;&#039;&#039;;<br />
	execute sp_executesql @qry	;<br />
	print  @qry;<br />
	SET @intFlag = @intFlag + 1;<br />
END<br />
GO<br />
&#8211;========================================<br />
PLEASE HELP ME IMMEDIATELY AS SOON AS POSSIBLE&#8230;AS I SPOILED MY HALF OF THE DAY TO SOLVE THIS..ABOVE SQL SYNTAX IS CORRECT..NO ERROR..BUT IT&#039;S OUTPUT NOT AFFECTS THE ROW&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fulgore</title>
		<link>http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/#comment-79322</link>
		<dc:creator><![CDATA[fulgore]]></dc:creator>
		<pubDate>Thu, 08 Jul 2010 23:43:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/#comment-79322</guid>
		<description><![CDATA[hello AlwaysLearning 

if you&#039;re right if I delete the use [] there is no problem, but actually want to do that view in all databases on the server, I have unprivileged SA but still does not work: (I try the solution &#039;CREATE VIEW [Database ]. [dbo]. [vPersona_Relacion] sends me an error but&#039;&#039;CREATE / ALTER VIEW can not specify the name of the database prefix the name of the object.&#039;ll try the recommended solutions &#039;OPENQUERY, OPENROWSET&#039; thanks for the help

good day
Fulgore2099
pd: sorry my English is not very good XD]]></description>
		<content:encoded><![CDATA[<p>hello AlwaysLearning </p>
<p>if you&#8217;re right if I delete the use [] there is no problem, but actually want to do that view in all databases on the server, I have unprivileged SA but still does not work: (I try the solution &#8216;CREATE VIEW [Database ]. [dbo]. [vPersona_Relacion] sends me an error but&#8221;CREATE / ALTER VIEW can not specify the name of the database prefix the name of the object.&#8217;ll try the recommended solutions &#8216;OPENQUERY, OPENROWSET&#8217; thanks for the help</p>
<p>good day<br />
Fulgore2099<br />
pd: sorry my English is not very good XD</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AlwaysLearning</title>
		<link>http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/#comment-79319</link>
		<dc:creator><![CDATA[AlwaysLearning]]></dc:creator>
		<pubDate>Thu, 08 Jul 2010 23:35:25 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/#comment-79319</guid>
		<description><![CDATA[Fulgore,

I have a better answer for this now. In Microsoft SQL land the create function/procedure/view statements are all limited to the current database - create table is the only exception and this is considered to be a hack for temp tables. Even using OPENROWSET is unable to work around this.

To create views in other databases you&#039;re going to be stuck with two options: (1) create a .NET assembly that does the work for you using input parameters such as the remote database name and the create view SQL, or (2) use xp_cmdshell to launch and external process that does the same.

xp_cmdshell has security issues, and needs to be specifically enabled on the SQL server, but here is an example to do what you need...

use tempdb
go
declare @Database nvarchar(4000) = &#039;TargetDatabase&#039;
declare @SQL nvarchar(4000)
set @SQL = &#039;CREATE VIEW [dbo].[vPersona_Relacion] as select [Foo]=1, [Bar]=2&#039;
declare @Cmd nvarchar(4000)
set @Cmd =
	&#039;sqlcmd.exe&#039;
	+&#039; -S(local) -E&#039; -- Local server (may need an CLICONFG alias)
	+&#039; -E&#039; -- Trusted connection (SQL Service account in this case)
	+&#039; -d&quot;&#039; + @Database + &#039;&quot;&#039;
	+&#039; -Q&quot;&#039; + @SQL + &#039;&quot;&#039; -- Note: -Q exits, -q does not, use -Q
print @Cmd
exec xp_cmdshell @Cmd, no_output
go
select * from [TargetDatabase].[dbo].[vPersona_Relacion]
go
/*
use TargetDatabase
drop view [dbo].[vPersona_Relacion]
go
*/

Good luck,
AlwaysLearning]]></description>
		<content:encoded><![CDATA[<p>Fulgore,</p>
<p>I have a better answer for this now. In Microsoft SQL land the create function/procedure/view statements are all limited to the current database &#8211; create table is the only exception and this is considered to be a hack for temp tables. Even using OPENROWSET is unable to work around this.</p>
<p>To create views in other databases you&#8217;re going to be stuck with two options: (1) create a .NET assembly that does the work for you using input parameters such as the remote database name and the create view SQL, or (2) use xp_cmdshell to launch and external process that does the same.</p>
<p>xp_cmdshell has security issues, and needs to be specifically enabled on the SQL server, but here is an example to do what you need&#8230;</p>
<p>use tempdb<br />
go<br />
declare @Database nvarchar(4000) = &#8216;TargetDatabase&#8217;<br />
declare @SQL nvarchar(4000)<br />
set @SQL = &#8216;CREATE VIEW [dbo].[vPersona_Relacion] as select [Foo]=1, [Bar]=2&#8242;<br />
declare @Cmd nvarchar(4000)<br />
set @Cmd =<br />
	&#8216;sqlcmd.exe&#8217;<br />
	+&#8217; -S(local) -E&#8217; &#8212; Local server (may need an CLICONFG alias)<br />
	+&#8217; -E&#8217; &#8212; Trusted connection (SQL Service account in this case)<br />
	+&#8217; -d&#8221;&#8216; + @Database + &#8216;&#8221;&#8216;<br />
	+&#8217; -Q&#8221;&#8216; + @SQL + &#8216;&#8221;&#8216; &#8212; Note: -Q exits, -q does not, use -Q<br />
print @Cmd<br />
exec xp_cmdshell @Cmd, no_output<br />
go<br />
select * from [TargetDatabase].[dbo].[vPersona_Relacion]<br />
go<br />
/*<br />
use TargetDatabase<br />
drop view [dbo].[vPersona_Relacion]<br />
go<br />
*/</p>
<p>Good luck,<br />
AlwaysLearning</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AlwaysLearning</title>
		<link>http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/#comment-79307</link>
		<dc:creator><![CDATA[AlwaysLearning]]></dc:creator>
		<pubDate>Thu, 08 Jul 2010 22:21:05 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/#comment-79307</guid>
		<description><![CDATA[Fulgore,

The error message says it all, &quot;CREATE VIEW must be the first statement in a batch...&quot; If you remove the &quot;USE [database] GO&quot; from the start of your statement it should work fine.

However, in this case, it looks as though you&#039;re trying to create these views in other databases, which probably isn&#039;t going to work (unless the currently executing user is SA-equivalent). Changing the create statement to &#039;CREATE VIEW [Database].[dbo].[vPersona_Relacion]&#039; may work. Otherwise, you may need to look into other solutions such as OPENQUERY, OPENROWSET or perhaps even a .NET Assembly.

Good luck,
AlwaysLearning]]></description>
		<content:encoded><![CDATA[<p>Fulgore,</p>
<p>The error message says it all, &#8220;CREATE VIEW must be the first statement in a batch&#8230;&#8221; If you remove the &#8220;USE [database] GO&#8221; from the start of your statement it should work fine.</p>
<p>However, in this case, it looks as though you&#8217;re trying to create these views in other databases, which probably isn&#8217;t going to work (unless the currently executing user is SA-equivalent). Changing the create statement to &#8216;CREATE VIEW [Database].[dbo].[vPersona_Relacion]&#8216; may work. Otherwise, you may need to look into other solutions such as OPENQUERY, OPENROWSET or perhaps even a .NET Assembly.</p>
<p>Good luck,<br />
AlwaysLearning</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fulgore</title>
		<link>http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/#comment-79131</link>
		<dc:creator><![CDATA[fulgore]]></dc:creator>
		<pubDate>Wed, 07 Jul 2010 21:30:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/#comment-79131</guid>
		<description><![CDATA[hello mates, I need help with this code can not get to run this code in the database has no problems with a select, but when put on a wiew create, get the error &quot;&#039;CREATE VIEW&#039; must be the first statement in a batch of queries. &quot;Could help me please



DECLARE @Nom_Cliente VARCHAR (50)
DECLARE @Execu nVARCHAR (4000)

DECLARE Cursor_Cambios CURSOR FOR

SELECT name
FROM master..sysdatabases
where name like ‘INTEG_%’

OPEN Cursor_Cambios
FETCH NEXT FROM Cursor_Cambios
INTO @Nom_Cliente

WHILE @@FETCH_STATUS = 0
BEGIN

SET @Execu= ‘CREATE VIEW [dbo].[vPersona_Relacion]
AS
SELECT DISTINCT
dbo.Persona.Numero_Empresa, dbo.Persona.Numero, dbo.Persona.General, dbo.Persona.Nombre_Completo, dbo.Persona.Paterno,
dbo.Persona.Materno, dbo.Persona.Nombre, dbo.Persona.Nombre_Corto, dbo.Persona.RFC, dbo.Persona.CURP, dbo.Persona.Personalidad_juridica,
dbo.Persona.Telefono, dbo.Persona.Fax, dbo.Persona.Celular, dbo.Persona.correo_electronico, dbo.Persona.Numero_Confia, dbo.Persona.Fecha_Alta,
dbo.Persona.Fecha_Cambio, dbo.vDomicilio.Desc_Tipo, dbo.vDomicilio.Domicilio, dbo.vDomicilio.Colonia, dbo.vDomicilio.Delegacion_municipio,
dbo.vDomicilio.Estado, dbo.vDomicilio.Codigo_postal, dbo.vDomicilio.Telefono AS Telefono_Domicilio, dbo.vDomicilio.Fax AS Fax_Domicilio,
dbo.fn_Obten_Tipos_Persona(dbo.Persona.Numero_Empresa, dbo.Persona.Numero) AS ucaseDes_Tipos_Persona
FROM dbo.vDomicilio RIGHT OUTER JOIN
dbo.Persona ON dbo.vDomicilio.Numero_Persona = dbo.Persona.Numero’

set @Execu= ‘USE [&#039;+ @Nom_Cliente +&#039;]‘+ char(13)+’go’ + char(13)+@Execu
–print @Execu

exec ( @Execu)

FETCH NEXT FROM Cursor_Cambios INTO @Nom_Cliente
END
CLOSE Cursor_Cambios
DEALLOCATE Cursor_Cambios]]></description>
		<content:encoded><![CDATA[<p>hello mates, I need help with this code can not get to run this code in the database has no problems with a select, but when put on a wiew create, get the error &#8220;&#8216;CREATE VIEW&#8217; must be the first statement in a batch of queries. &#8220;Could help me please</p>
<p>DECLARE @Nom_Cliente VARCHAR (50)<br />
DECLARE @Execu nVARCHAR (4000)</p>
<p>DECLARE Cursor_Cambios CURSOR FOR</p>
<p>SELECT name<br />
FROM master..sysdatabases<br />
where name like ‘INTEG_%’</p>
<p>OPEN Cursor_Cambios<br />
FETCH NEXT FROM Cursor_Cambios<br />
INTO @Nom_Cliente</p>
<p>WHILE @@FETCH_STATUS = 0<br />
BEGIN</p>
<p>SET @Execu= ‘CREATE VIEW [dbo].[vPersona_Relacion]<br />
AS<br />
SELECT DISTINCT<br />
dbo.Persona.Numero_Empresa, dbo.Persona.Numero, dbo.Persona.General, dbo.Persona.Nombre_Completo, dbo.Persona.Paterno,<br />
dbo.Persona.Materno, dbo.Persona.Nombre, dbo.Persona.Nombre_Corto, dbo.Persona.RFC, dbo.Persona.CURP, dbo.Persona.Personalidad_juridica,<br />
dbo.Persona.Telefono, dbo.Persona.Fax, dbo.Persona.Celular, dbo.Persona.correo_electronico, dbo.Persona.Numero_Confia, dbo.Persona.Fecha_Alta,<br />
dbo.Persona.Fecha_Cambio, dbo.vDomicilio.Desc_Tipo, dbo.vDomicilio.Domicilio, dbo.vDomicilio.Colonia, dbo.vDomicilio.Delegacion_municipio,<br />
dbo.vDomicilio.Estado, dbo.vDomicilio.Codigo_postal, dbo.vDomicilio.Telefono AS Telefono_Domicilio, dbo.vDomicilio.Fax AS Fax_Domicilio,<br />
dbo.fn_Obten_Tipos_Persona(dbo.Persona.Numero_Empresa, dbo.Persona.Numero) AS ucaseDes_Tipos_Persona<br />
FROM dbo.vDomicilio RIGHT OUTER JOIN<br />
dbo.Persona ON dbo.vDomicilio.Numero_Persona = dbo.Persona.Numero’</p>
<p>set @Execu= ‘USE ['+ @Nom_Cliente +']‘+ char(13)+’go’ + char(13)+@Execu<br />
–print @Execu</p>
<p>exec ( @Execu)</p>
<p>FETCH NEXT FROM Cursor_Cambios INTO @Nom_Cliente<br />
END<br />
CLOSE Cursor_Cambios<br />
DEALLOCATE Cursor_Cambios</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AlwaysLearning</title>
		<link>http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/#comment-62567</link>
		<dc:creator><![CDATA[AlwaysLearning]]></dc:creator>
		<pubDate>Wed, 10 Mar 2010 01:19:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/#comment-62567</guid>
		<description><![CDATA[sp_executesql doesn&#039;t have access to any @variables in the current scope.]]></description>
		<content:encoded><![CDATA[<p>sp_executesql doesn&#8217;t have access to any @variables in the current scope.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AlwaysLearning</title>
		<link>http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/#comment-62566</link>
		<dc:creator><![CDATA[AlwaysLearning]]></dc:creator>
		<pubDate>Wed, 10 Mar 2010 01:16:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/#comment-62566</guid>
		<description><![CDATA[@Madhivanan:
It is possible as long as you have access to the network drive

There&#039;s more to it than that. Specifically:

1. The Windows account that the SQL Server service is running under needs access to the remote server and share (and the file system the share provides access to). You can check which account this is via the Services snap-in (services.msc). By default it is the LOCAL SYSTEM user but more secure installations should have a least-privileged local user account instead.

2. Using (built-in) SQL Backup over a network connection is unreliable, at best. Far better to continue backing-up to your local file system followed by an XCOPY (or better, NCOPY, SCP, etc.) to copy or move the .BAK files when the backups have completed.

3. Test your backups occasionally by restoring them to an offline/staging server. You should be doing this anyway, but its even more important after moving your backup files across a network.]]></description>
		<content:encoded><![CDATA[<p>@Madhivanan:<br />
It is possible as long as you have access to the network drive</p>
<p>There&#8217;s more to it than that. Specifically:</p>
<p>1. The Windows account that the SQL Server service is running under needs access to the remote server and share (and the file system the share provides access to). You can check which account this is via the Services snap-in (services.msc). By default it is the LOCAL SYSTEM user but more secure installations should have a least-privileged local user account instead.</p>
<p>2. Using (built-in) SQL Backup over a network connection is unreliable, at best. Far better to continue backing-up to your local file system followed by an XCOPY (or better, NCOPY, SCP, etc.) to copy or move the .BAK files when the backups have completed.</p>
<p>3. Test your backups occasionally by restoring them to an offline/staging server. You should be doing this anyway, but its even more important after moving your backup files across a network.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Madhivanan</title>
		<link>http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/#comment-62496</link>
		<dc:creator><![CDATA[Madhivanan]]></dc:creator>
		<pubDate>Tue, 09 Mar 2010 10:03:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/#comment-62496</guid>
		<description><![CDATA[The main purpose of EXECUTE is to execute the procedure and dynamic SQL]]></description>
		<content:encoded><![CDATA[<p>The main purpose of EXECUTE is to execute the procedure and dynamic SQL</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Madhivanan</title>
		<link>http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/#comment-62493</link>
		<dc:creator><![CDATA[Madhivanan]]></dc:creator>
		<pubDate>Tue, 09 Mar 2010 09:59:55 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/#comment-62493</guid>
		<description><![CDATA[Read about sp_executesql in SQL Server help file. It has example code]]></description>
		<content:encoded><![CDATA[<p>Read about sp_executesql in SQL Server help file. It has example code</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Madhivanan</title>
		<link>http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/#comment-62491</link>
		<dc:creator><![CDATA[Madhivanan]]></dc:creator>
		<pubDate>Tue, 09 Mar 2010 09:57:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/#comment-62491</guid>
		<description><![CDATA[It is possible as long as you have access to the network drive]]></description>
		<content:encoded><![CDATA[<p>It is possible as long as you have access to the network drive</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Madhivanan</title>
		<link>http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/#comment-62489</link>
		<dc:creator><![CDATA[Madhivanan]]></dc:creator>
		<pubDate>Tue, 09 Mar 2010 09:55:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/#comment-62489</guid>
		<description><![CDATA[Using a sp_executesql, move the data to a variable and use isnull function over it]]></description>
		<content:encoded><![CDATA[<p>Using a sp_executesql, move the data to a variable and use isnull function over it</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Madhivanan</title>
		<link>http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/#comment-62486</link>
		<dc:creator><![CDATA[Madhivanan]]></dc:creator>
		<pubDate>Tue, 09 Mar 2010 09:51:07 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/#comment-62486</guid>
		<description><![CDATA[Also in dynamic sql, it can be more single quotes

http://beyondrelational.com/blogs/madhivanan/archive/2008/02/19/understanding-single-quotes.aspx]]></description>
		<content:encoded><![CDATA[<p>Also in dynamic sql, it can be more single quotes</p>
<p><a href="http://beyondrelational.com/blogs/madhivanan/archive/2008/02/19/understanding-single-quotes.aspx" rel="nofollow">http://beyondrelational.com/blogs/madhivanan/archive/2008/02/19/understanding-single-quotes.aspx</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Madhivanan</title>
		<link>http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/#comment-62483</link>
		<dc:creator><![CDATA[Madhivanan]]></dc:creator>
		<pubDate>Tue, 09 Mar 2010 09:44:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/#comment-62483</guid>
		<description><![CDATA[Read about sp_executesql in SQL Server help file]]></description>
		<content:encoded><![CDATA[<p>Read about sp_executesql in SQL Server help file</p>
]]></content:encoded>
	</item>
</channel>
</rss>

