Introduction As a developer, the .NET framework and Visual Studio present many choices for choosing the right architecture, from placing the data access code directly in the UI through datasets and data source controls, to creating a data access layer that talks to the database, all the way to creating an n-tier architecture approach that [...]
Archive for the ‘Database’ Category
Introduction to 3-Tier Architecture
Posted: 30 April 2008 in .net 1.1, .net 2.0, .net 3.0, .net 3.5, ASP.net 2, DatabaseTemporary Tables vs. Table Variables and Their Effect on SQL Server Performance
Posted: 14 December 2007 in Database, SQL ServerThere are three major theoretical differences between temporary tables: create table #T (…) And table variables: declare @T table (…) The first difference is that transaction logs are not recorded for the table variables. Hence, they are out of scope of the transaction mechanism, as is clearly visible from this example: create table #T (s [...]
SQL Server: Check Whether All Characters In a String Are in Uppercase or Not
Posted: 5 December 2007 in Database, SQL ServerWhen I was developing a small application, I had to write a Microsoft SQL Server script to check whether all the characters in a given string are uppercase alphabets or not. Here is the Microsoft SQL Server function code which performs the check. This code is compatible with Microsoft SQL Server 2000 and Microsoft SQL [...]
I’ve been asked this question a few times when looking into performance problems on a website, and the short answer is, it’s not. SQL Server is a very efficient database. It’s important to remember that a database is just a runtime for your SQL code. It’s just doing what you ask it to do, nothing [...]
• Use views and stored procedures instead of heavy-duty queries. This can reduce network traffic, because your client will send to server only stored procedure or view name (perhaps with some parameters) instead of large heavy-duty queries text. This can be used to facilitate permission management also, because you can restrict user access to table [...]
How to Run commands for all tables in current dB: EXEC sp_MSforeachtable @command1 = ‘DELETE FROM ? WHERE your_condition’ The ‘?’ will be replaced by the table name ——————————————————————————– How to find Size of all user tables with the number of rows: EXEC sp_MSforeachtable @command1=’sp_spaceuse d “?”‘ ——————————————————————————– How to find Number of rows in [...]