In Oracle, we can write anonymous blocks for quick testing of logic without having to store the object on the database.
Does SQL Server support anonymous blocks? I tried google, but it mostly returns links for oracle.
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.
You use SSMS to test any “block” of T-SQL without creating any sort of object (stored procedure or function). Just declare your variables, if you need any, and wirte your code.
For example if this is the stored you want to test
You should instead write: