|
Get all user tables with size
|
Total Hit (1557) |
Returns User Tables by SIZE in DESCENDING ORDER
Add TOP n clause in SELECT to get selective results (i.e. TOP 10 TABLES)
|
Rating
|
|
|
|
|
|
|
Working with Computed column in SQL Server 2000
|
Total Hit (1545) |
There are restriction for ALTER COLUMN, documented in Books Online (see end
of this post). Depending on your particular situation, you need to DROP
INDEX, ALTER TABLE... DROP CONSTRAINT etc.
The altered column cannot be:
a) A column with a text, image, ntext, or timestamp data type.
....Read More |
Rating
|
|
|
Introduction to SQL : Sample chapter from Beginning SQL Programming
|
Total Hit (697) |
This introductory chapter covers topics that students usually ask in the first hour of classes; essentially, just what do we mean by SQL? We start by explaining what SQL is and also what it is not, and we provide a brief overview of the history of the language. We'll also clarify some confusing term
....Read More |
Rating
|
|
|
Dynamic ORDER BY Statements in Stored Procedures
|
Total Hit (1651) |
When creating data-driven Web applications, it is ideal to place the actual SQL statements into stored procedures, and to have the Web pages, then, call the appropriate stored procedures rather than executing the SQL statements themselves. (If you are unfamiliar with what stored procedures are, or t
....Read More |
Rating
|
|
|
Summarizing Data with ROLLUP
|
Total Hit (630) |
Oftentimes, when building Web-based reporting tools we need to show totals and sub-totals for information stored in the database. For example, imagine that you worked at an eCommerce site like Amazon.com that sold products from a variety of categories: books, electronics, clothes, etc. Managers woul
....Read More |
Rating
|
|
|
|
|
|
JOIN Fundamentals
|
Total Hit (697) |
Very often we need to pull data from 2 or more sources (tables or views) and combined them into 1 logical unit.
There is often a bit of confusion on when and how to use them.
I will first describe each JOIN type and how it works with the 2 tables involved. The major JOIN types are color cod
....Read More |
Rating
|
|
|
Getting the Wrong Identity in Microsoft SQL Server identity Columns?
|
Total Hit (572) |
An Identity column is used in SQL server to create a surrogate key value for a table. This will be a unique identifier usually in sequential order. Starting at some predefined number, the Identity column increments every time a new record is added to the table. For MS Access users, this is comparabl
....Read More |
Rating
|
|
|
T-SQL Programming Part 5 - Using the CASE Function
|
Total Hit (561) |
The CASE function is a very useful T-SQL function. With this function you can replace a column value with a different value based on the original column value. An example of where this function might come in handy is where you have a table that contains a column named SexCode, where 0 stands for fem
....Read More |
Rating
|
|
|
|
|
T-SQL Programming Part 1 - Defining Variables, and IF...ELSE logic
|
Total Hit (515) |
This is the first of a series of articles discussing various aspects of T-SQL programming. Whether you are building a stored procedure or writing a small Query Analyzer script you will need to know the basics of T-SQL programming. This first article will discuss defining variables, and using the IF.
....Read More |
Rating
|
|
|
Examples of how to Calculate Different SQL Server Dates
|
Total Hit (593) |
Every now and then, you need to take the current date and calculate some other date. For instance, you might have an application that needs to determine what date is the first day of the month, or need to know the last day of the month. Now most of you probably already know how to separate the date
....Read More |
Rating
|
|
|
Using SQL Server's CHARINDEX and PATINDEX
|
Total Hit (1189) |
If you have written many applications then you probably have run across situations where you need to identify if a specific character or set of characters appears in a string. In this article I will discuss using the CHARINDEX and PATINDEX functions to search text columns and character strings. I wi
....Read More |
Rating
|
|
|
Creating a SQL Server User Interface with InfoPath
|
Total Hit (663) |
When Office 2003 is released about a month from now, some of the versions will contain two new applications OneNote and InfoPath. OneNote is a note taking application that may be interesting to those of you with tablet PCs. InfoPath is an XML based forms creation and entry application that looks ver
....Read More |
Rating
|
|
|
Sequential Numbering/Counting of Records with SQL Server
|
Total Hit (672) |
Microsoft SQL server does not support a method of identifying the row numbers for records stored on disk, although there are a number of different techniques to associate a sequential number with a row. You might want to display a set of records where each record is listed with a generated number th
....Read More |
Rating
|
|
|
Dealing with MS SQL Tables that contain Duplicate Rows
|
Total Hit (706) |
Every so often, you might have to deal with tables that contain duplicate rows. In one case, you might only need to identify the duplicate rows. In other cases, you might need to remove the duplicate rows. This article will show you some different techniques for dealing with duplicate rows.
....Read More |
Rating
|
|
|
Padding, Rounding, Truncating and Removing Trailing Zeroes
|
Total Hit (624) |
In this article, I am going to show you a number of tips for displaying numeric fields as strings. I will show you how to pad zeroes on the left side of numeric numbers, so that each number regardless of the size will be the same length. Also along those same lines below you will find out how to pad
....Read More |
Rating
|
|
|
|
|
|
Working with SQL Server Date/Time Variables
|
Total Hit (1912) |
This is the first article in a series of articles that I will discuss various aspects of working with SQL Server date/time columns. SQL Server has two different date/time columns. They are DATETIME and SMALLDATETIME. This article will define the difference between these two SQL Server date/time data
....Read More |
Rating
|
|
|
|