I want to know if its possible to set a declare variable (as table), to null.
like :
DECLARE @TABLE1 AS TABLE (COL1 INT)
SET @TABLE1 = NULL
I searche a way to know if I already try to insert data into my variable
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To complete your question about if you’ve added rows or not you can do:
or you can check the value of
@@ROWCOUNTto know how many rows has been added so:For what i know
@TABLE1have alocal scopeso when the Store Procedure is end, this variable will be deletedand as GSerg said you have many whays to check it as:
or
or