December 28, 2004 at 9:15 am
The following is an item in my trace. I understand the basics of what it is doing but I don't understand the syntax.
declare @P1 int
set @P1=5
exec sp_prepexec @P1 output, N'@P1 varchar(255)', N'DELETE FROM LOGINS WHERE MACHINE_ID = @P1', '796A676D7982787B878878697B7E7A71'
select @P1
What are the capital N's For?
sp_prepexec is not in BOL and only vaguely discussed in development articles.
Thanks,
Sean Wyatt
seanwyatt.com
December 28, 2004 at 6:39 pm
N is used to cast the string as NVARCHAR instead of VARCHAR.
December 29, 2004 at 8:23 am
Thanks John that helps.
So sp_prepexec takes a command string as input, and generates an execution plan so that it can be quickly executed later??
Sean Wyatt
seanwyatt.com
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply