.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Datalength function doesn't act as expected?...

Posted By:      Posted Date: December 04, 2010    Points: 0   Category :Sql Server

We have a large table which contains a varbinbary(max) column.  When I run the "Disk Usage by Top Tables" report, it shows that this table uses about 290 GB of data.  However, when I sum the datalength for each of the columns in that table, I get a total of 251 GB.

Why the difference in totals?  I thought datalength() gave the size of the field in bytes, therefore I should be able to sum those bytes, convert them to gigabytes, then compare to the report...

Any help will be greatly appreciated.  Thanks!


View Complete Post

More Related Resource Links

WSS 3.0 Knowledge Base Template doesn't function properly after SharePoint 2010 migration

I migrated our WSS 3.0 instance to SharePoint 2010 in a dev environment.  So far, everything works with the exception of the most heavily utilized portion of our WSS 3.0 installation – which is a "Knowledge Base" sub-site utilizing the following features:   Knowledge Base List Instances: List Instances for the Knowledge Base Application Template Knowledge Base Modules: Modules for the Knowledge Base Application Template Knowledge Base Provisioning Handler   Link to Knowledge Base Template http://www.microsoft.com/downloads/details.aspx?FamilyId=BC4E5C4E-FBBB-4666-8E32-C4CEE09E1FE6&displaylang=en   Two issues exist with the Knowledge Base after migrating.   1.       The “Write new Article” feature which uses a content type called “Wiki Knowledge Base Article” use to open a “New Wiki Page” that provided the all of the associated fields specified in the List Content type settings.  Upon creating the new Wiki Page (i.e. Knowledge base article) it would associate it with the “Knowledge Base” document library.  The “Write new Article” feature now fails to utilize / recognize the Content Type settings and instead create a blank New Page without any fields except for “New page name:” and also creates a “Site Pages&

Function doesn't get hited after Success Liberty Reserve Deposit

Hei Everyone..Im having a problem in my application . I have a simple link to get redirect to a Liberty Reserve Merchant and the flow is after the success of the deposit in the LR, it supposed to come back in my asp code and save some details in the Database.I dont have a problem with the deposit in the LR but it doesnt continue the flow. I dont understand why. Here is my sample code ( VB.net) code behind in the button Response.Redirect("https://sci.libertyreserve.com/?lr_acc=U4667045&lr_amnt=10.55&lr_currency=LRUSD") SaveIntoDb()my function SaveIntoDB() is working properly but I dont know why after the response.redirect, it doesnt not Hit the function SaveintoDB()Thank you

VWD Express Doesn't step into the Business Layer Function



I have a solution that consists of some web projects and websites (seperate projects in one solution) When I run the main project and debug I want to step into a function that resides in another project as a business layer function and then step into another function in DAL project. I set breakpoints in both projects (DAL and BLL) but am not able to step into those functions!!!

What is the problem with vwd express, It should support such vital thing. 

max() agreate function and having clause not working as expected


I wil try to describe below my issue, starting with the query i use.

SELECT     b.[id_training_MD],
FROM [training_MasterData] as a
inner join [training_Log] as b
    on a.id_training_MD = b.id_training_MD
inner join [training_Q_Log] as c
    on b.id_training_Q_Log = c.id_training_Q_Log
WHERE (a.[Category] = 'Networking')  and  (c.[employeeID] = '123')

group by b.[id_training_Q_Log],b.[id_training_MD],b.[trainingScore]   
having b.[id_training_Q_Log] = (select distinct max(b.[id_training_Q_Log]) FROM [training_Log])

My tables are:

CREATE TABLE [dbo].[Training_MasterData](
    [id_Training_MD] [int] IDENTITY(1,1) NOT NULL,
    [Category] [varchar](50) NOT NULL,
    [TrainingName] [varchar](100) NOT NULL

Example of data from table:
[id_Training_MD]    [Category]         [TrainingName]

Javascript Function Expected Error


I'm using the CustomValidation Function to call my javascript but for some reason I'm not getting the * to indicate the error to the user. I keep getting a Function expected Error, so what is wrong with my javascript that's causing this error and why aren't I receiving the * notification? Thank you in advance for your help.


<script type="text/javascript" language="javascript">
    function checkAGITotal()
        var a = document.getElementById('<%= NumberInHouseholdTxtbox.clientid %>').value;
        var b = document.getElementById('<%= AGITotalTxtbox.clientid %>').value;

        if (a == "1" && b <= "27247" || a == "2" && b <= "35630" || a == "3" && b <= "44014" || a == "4" && b <= "52397" || a == "5" && b <= "60781" || +
        a == "6" && b <= "69164" || a == "7" && b <= "70736" || a == "8" &

Aggregate (count) function that produces a different result to what is expected.

Hi Folks
I have an aggregate transformation, that runs a count on a column.  The  column  has 23 rows  with dates and a further 2 rows that have no date information. When I run a count function on the column, it returns a count of 25.  My hypothesis is that  this is linked to the 2 rows are treated as being  BLANK as opposed to being NULL (I understand the COUNT function will not count rows that have null values).

I have two questions
1) How do test this hypothesis that he difference is due to a blank vs null issue and then more importantly
2) How to I resolve the issue so that the 2 "empty" rows are not counted?

Many thanks


Beginner: this doesn't make sense to me


Do you need and "empty" script tag in the head to run scripts that are in the body?  Also, can you run JQuery scripts if they're in the <head> tag?  The first sample only works if the JQuery script is in the form (and body) tag, not in the head - even if I add $(document).ready(function() { });

This works

<head runat="server">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" />
<script type="text/javascript">
<form id="form1" runat="server">
<a href="">Here is a link</a>
<script type="text/javascript">
$('a').click(function () {
alert("you clicked me!");


This doesn't work.  Notice I removed the second <script> tag from the head

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="serve

Content page control passes as argument to javascript function


Here is the content page:


<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="JavaDynamicCopyValue.aspx.cs" Inherits="JavaDynamicCopyValue" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
 <script type="text/javascript" >
 function copyValue(input, output )
   ouput.value = input.value;
   return true;
 <asp:TextBox ID="txt1" runat="server" onchange="copyValue(this,document.getElementById('<%=txt2.ClientID%>'))"></asp:TextBox>
    <br />
    <br />
    <asp:TextBox ID="txt2" runat="server"></asp:TextBox>


I got a javascript run time error says output is undefined. if I view source of the page, the txt1 markup became:

<input name="ctl00$ContentPlaceHol

connection to SQL Server files (*.mdf) require SQL server express 2005 to function properly.


I dont have the SQL EXPRESS installed instead I have SQL Standard Edition.

 I have two SQL Server instances installed.

 1- UserLT (this is sql 2000)
2- UserLT\SQL2005 (this is SQL 2005 named instance)

But when i try to add a database to my VS website project I get the following error:

Connection to SQL Server files (*.mdf) require SQL server express 2005 to function properly. please verify the installation of the component or download from the URL: go.microsoft.com/fwlink/?linkId=4925

I went in Tools>Opetions>DataBase tools>Data Connection>Sql Server Instance Name (blank for default)

and changed the "SQLEXPRESS" to "USERLT\SQL2005".

But I still get the same error message. Any ideas how i can resolve this issue?

Public Shared function doubt????

I am using VB.net/ASP.NET and SQL Server 2000 for a web application.

For populating the dropdowns, I wrote a Public Shared function LoadDDL(), in which I pass the dataset and dropdown name to set.

I have my doubts that this function will produce unexpected results for concurrent users. And will mix the results among sessions because it is a Shared function.

I am confused here. Is it the right way to go?

Please advice. Thanks in advance.


Trim function in C Sharp

How do i use "trim" function in C Sharp? I have a string and i want to strip off spaces from the end of the string. Any idea how do i do it??


{ End Bracket }: Legal Doesn't Think the Way You Do


If you develop software for a large company, you've undoubtedly experienced the joys of dealing with "Legal. " The meetings, the endless explanations, the long waits. I'm here to report from the other side.

Don McGowan

MSDN Magazine March 2006

Pure C++: Invoking Generic or Function Templates


As I promised last time, in this month's column I'll walk through the process of defining and invoking a generic or template function under C++\CLI. A function template or a generic function begins with the template or generic keyword followed by its parameter list.

Stanley B. Lippman

MSDN Magazine October 2005

Advanced Basics: Building a Progress Bar that Doesn't Progress


In many situations, accurately estimating the length of a certain process (copying a large file, loading data from a server, retrieving files from the Internet) would be both difficult and inefficient.

Duncan Mackenzie

MSDN Magazine October 2004

Cutting Edge: Using an Eval Function in Web Services


Web Services are often presented as the perfect tool for pro-grammers. They're interoperable, based on open standards such as SOAP and WSDL, and are fully integrated with the Microsoft® . NET platform.

Dino Esposito

MSDN Magazine September 2002

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend