SQLTeam.com | Weblogs | Forums

Exec (@strSQL)


In SQL 2014.
Is there a maximum of time we can exec a dynamic SQL command inside a stored procedure?
In my stored procedure, I have 12. It runs the firts 11 ones and then it seems to hang at the 12th.
Manually I run the 12th query and it works fine. So it is not a syntax error in the string.
SET @strSQL = 'bla bla bla'
If (@@Rowcount > 0)
'Do something


Not that I know of. The more important question is why do you have so many?

Again the same old

It could be a million things out of which you have to narrow it down to yours

Dynamic SQL .. please google search .. lots of articles


what i mean is

its a Pa@^^ in the A@#$%%

Another Thing

How to debug to find out the problem ?

is it a issue only with that particular statement ? put some other statement and see ?

Thinking on Paper ...
Break it down .. Terms .. Connecting ..

Hi all,

I thank you all for trying to help me.
For some unknow reason, it ran successfully to the end finally.

things like

FALSE positive ... FALSE negative