Category Archives: SQL Server



Count Total Rows For All Tables In MS SQL Server Posted by in SQL Server | 1 Comment

This SQL script below will count and display list of table name along with total rows for all tables in a specified MS SQL Server Database. Continue reading

Encrypt With MD5, SHA Or SHA1 In MS SQL Server Posted by in SQL Server | Leave a comment

This article shows SQL statements that encrypt an input string by using MD5/SHA/SHA1 algorithm. And you should play with these SQL statements in the Microsoft SQL Server Management Studio (New Query) to see the results. Continue reading

SQL SERVER How to import Text/CSV file into table Posted by in SQL Server | Leave a comment

Import data from Text File or CSV file into table is a popular task in software development area.The usual way to solve this is to use programming languague. For example, we can use CSharp, Java or anything else to read CSV file into many lines, parse string data of each lines, then insert this row into table… Continue reading

SQL Server Get number of working days and business hours between start date and end date Posted by in SQL Server | 1 Comment

This tutorial demonstrates 2 ways for you how to obtain the number of working days and business hours in SQL Server based on between date start and end date parameters.This function is more popular in doing business related to human resource, particularly in calculating salary of employee… Continue reading

SQL Server Get list of dates between start date and end date Posted by in SQL Server | Leave a comment

This tutorial demonstrates 2 ways for you how to obtain the date range in SQL Server based on between date start and end date parameters… Continue reading

Save Table Structure Changes When Remote Access To SQL Server Posted by in SQL Server | Leave a comment

When remotely connect to SQL Server and edit structure/design of a particular table, it doesn’t allow you to save the changes although it works fine if connect directly to the database server. Continue reading

MS SQL How to get all database names Posted by in SQL Server | Leave a comment

This article describes How to get information of all databases by using stored procedures or SQL statement which SQL Server supports. This information includes : name, size, owner, created date, full path file name… Continue reading

ASP.NET Store Session In MS SQL Server Database Posted by in SQL Server | Leave a comment

When websites and applications execute in a clustered environment or require heavy state management functionality, you should use database to store session state information. Continue reading

Where Are ASPStateTempApplications and ASPStateTempSessions Tables? Posted by in SQL Server | Leave a comment

ASPStateTempApplications and ASPStateTempSessions tables are in the TempDB database and are created when you configure SQL Server to Store ASP.NET Session State by running the InstallSqlState.sql script. Continue reading

SQL Server get first/last day of previous/current/next month Posted by in SQL Server | 1 Comment

This tutorial demonstrates 2 ways for you how to obtain the first/last day of previous/current/next month in SQL Server by making UDF(User Defined Function)… Continue reading