Current location - Education and Training Encyclopedia - Education and training - Ask Xia a question about the synchronization sequence value of SQLSERVER.
Ask Xia a question about the synchronization sequence value of SQLSERVER.
Alter? proc? Syria

-Like what? exec? sy? 3 This call specifies 3 for the output, but the body uses the value of val+ 1 in the table synseq. It doesn't matter what value you enter, it has nothing to do with your input. That's why you have doubts.

@val? int? Output,

@n? int? =? 2

As?

Update? synseq?

Settings?

-Saves the incremental variable value, but not to the database.

@val? =? val+ 1? ,?

-Add @n and save it in the database.

val=? val+? @ n;

-So if you don't specify @n, the output is a continuous value, such as @val is? 9? , so val? Is it? 10

Choice? @ val? Choice? Val. From where? synseq? ;

-You have to understand, sqlserver? The mysql effect of storing values before and after execution is not implemented. It must remain flexible through intermediate variables.