Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Server : procedure call, inline concatenation impossible?

Tags:

sql

sql-server

I'm using SQL Server 2008 R2 and was wondering if there is another way of writing something like

EXEC dbo.myProcedure (SELECT columnName FROM TableName)

or

EXEC dbo.myProcedure @myStringVariable + 'other text'

so that these procedure calls actually work, without putting the whole stuff into a variable first.

like image 840
cdbeelala89 Avatar asked Aug 19 '12 13:08

cdbeelala89


1 Answers

Concatenation in inline execution of SP is not allowed..

Assuming that your @myStringVariable compromises of certain text and certain dynamic text you want to concatenate it.

Why don't compute it and assign to @myStringVariable before making the call to proc.

like image 86
mvm_bgm Avatar answered Oct 03 '22 06:10

mvm_bgm