Monthly Archives: October 2010
@@TRANCOUNT is a global system variable that count transaction’s command. Per a BEGIN TRAN or COMMIT|ROLLBACK TRAN it counts once. note! If we COMMIT a transaction it counts back to zero. If it’s not zero means that a transaction block is uncompleted.
SCHEMABINDING is a property that very useful for safety in views. If anyone wanna to change the table column that our view use it, “SCHEMABINDING” do not allow that chang. In some cases such as “Indexed views”, using “SCHEMABINDING” in view creation script is … Continue reading
If we wanna have a primary key or unique index on two or more columns, using CTE and DERIVED TABLE with ROW_NUMBER is very useful to remove dup records. In fact that’s CTE usage is because we cannot use RANKING FUNCTIONS in … Continue reading
I published some posts about dup records. But this is a beautiful logical query. Notice that it’s not optimized query.
We use SELECT INTO instead of create a new table and insert data into it.If we just wanna to create a copy of a table just like bellow query use where clause with false statement.It creates but not populated.
To disable windows authentication in sql server:
Sometimes we can’t use single quote. For example we want to update a column and our data contain single quote.In such cases we can use double quote instead of single quote if we SET QUOTED_IDENTIFIER ON.Below first query fails.
According to MOB, DBCC CHECKDB Checks the allocation, structural, and logical integrity of all the objects in the specified database.
NULL comparison conditions are different from others. Because NULL means UNKNOWN, there are three conditions when using NULL: TRUE FALSE UNKNOWN This is because a value that is unknown cannot be compared logically against any other value. T-SQL supports an extension … Continue reading
because now I’m behind isa server I cannot upload this book photo. But later I upload its photo. And this is photo: Again a very good book from Apress. Robin Dewson in this book introduce sql server in details. He … Continue reading