Contolling the SQL Server editor window in SQL Server Management studio.
Goto Tools->Options-> Query execution->General, we are having lot of options.
1. Set Rowcount – This option is used to restrict the result set returned by the text editor.
Considering am having lakhs of records and I need to restrict the number of records returned, we can specify the same. It’s equivalent to the TOP keyword. “0” indicates that, there will be unlimited rows (or) no restrictions in the number of records fetched.
2. Set Textsize – This option is used to restrict the size of the text to be returned in your text editor. Considering, am having a column of type “TEXT”, If I have given 10 as the bytes. The resultset will be restricted with only 10 bytes.
3. Execution time-Out : We can restrict the query execution time. How much time, the query should execute. If we have given 0 as the value, then its unlimited or no restriction. This is very useful in executing a query in production environment.
4. Batch separator: This is used to separate the batch statement. Grouping the queries.
Strange but interesting facts of the GO statement. Before this article, I thought like the go statement will commit the transactions. But after checking this, I got shocked. It’s not committing it. I have tried to rollback the statement. The entire process got roll backed.
begin transaction
go
insert into venkat values(3,700,'10/4/2008')
go
insert into venkat values(3,700,'10/4/2008')
rollback
So, GO statement in SQL Server is used only for separating the SQL statements and it doesn’t have any impact on the transactions handling.
Thanks and Regards,
Venkatesan Prabu .J
No comments:
Post a Comment