Square braces in SQL Server play a major role in T-SQL programming. When an object name contains a space, special character, etc, the only way to express them is to put them aroud squre braces. Consider that you want to create a table user master (with spaces between user and master), you can use [user...
This is just for Fun. The following code is unformatted, unclear and may be confusing. But curious to know the result? Set the result mode of the query window to Text . While you are in Query Window press CONTROL+T and run the following code and see what it returns. set nocount on select case no when...
Ok. Here is some Fun. This is the script that will produce zero without using any number in the code. Post your code if you find any such method select $, $+, $+., -$, $*$, +$-, ($), $., ($.), -+$-, +-$+., -$+.+$., '$,'-$+, '$,.'-$-. Run the code and see the output. Each column produces...
Though it is optional to execute a stored procedure without using EXEC or EXECUTE, it is needed when you use GO(or any other batch seperator) as the stored procedure name. Create this procedure create procedure GO as select 1 as number Execute the procedure by GO It will not execute becuase GO is treated...
The symbol @ is mainly used to identify a variable, parameter and table variable. The usage of @ sometimes make you to have some fun. Here are some methods You can declare a table variable with only @s. Cosider this example declare @@@ table(i int ) insert into @@@(i) select 345 select i from @@@ The...