Friday, June 15, 2007

Showing an alert using Javascript

This is the Javascript code to show an alert if users keep the web page open & unattended for more than 10 minutes.

----------------------------------------------------------------------------------------------------------------------------------

<BODY onload="pageload();">

----------------------------------------------------------------------------------------------------------------------------------

function pageload()

{

window.setInterval("SetAlert()",480000);

}

----------------------------------------------------------------------------------------------------------------------------------

function SetAlert()

{

//In my example alert is on the same page. You can embed another .html page also here.

document.getElementById('divSession').style.display='';

document.getElementById('divSession').style.posTop=200;

document.getElementById('divSession').style.posLeft=250;

document.getElementById('divSession').style.width=430;

document.getElementById('divSession').style.height=130;

window.setInterval("document.getElementById('divSession').style.display='none'",115000);

}

----------------------------------------------------------------------------------------------------------------------------------

<div id="divSession" runat="server" style="DISPLAY: none; Z-INDEX: 101; BORDER-LEFT-COLOR: whitesmoke; LEFT: 600px; BORDER-BOTTOM-COLOR: whitesmoke; WIDTH: 248px; BORDER-TOP-STYLE: ridge; BORDER-TOP-COLOR: whitesmoke; FONT-FAMILY: 'Times New Roman'; BORDER-RIGHT-STYLE: ridge; BORDER-LEFT-STYLE: ridge; POSITION: absolute; TOP: 25px; HEIGHT: 198px; BACKGROUND-COLOR: lightgrey; BORDER-RIGHT-COLOR: whitesmoke; BORDER-BOTTOM-STYLE: ridge">

<table border="0" cellpadding="0" cellspacing="0">

<tr>

<td valign="middle">

<p align="center"><br>

You are not browing this site from 10 minutes. <!--Anything can go here-->

 <br>

<INPUT type='submit' value='OK' onClick='CloseWin()' style="WIDTH: 103px" ID="Submit1"

NAME="Submit1">

</p>

</td>

</tr>

</table>

</div>

----------------------------------------------------------------------------------------------------------------------------------

function CloseWin()

{

 //Anything you can write here.

document.getElementById('divSession').style.display='none';

}

Sorting a ListBox using Javascript

Javascript code for sorting a listbox:

<hr>

function SortList()

{

var last = document.getElementById("listBox1").options.length - 2;

var isChanged = 1;

var TempText,TempVal;

while ( last >= 0 && isChanged )

{

isChanged = 0;

for ( var k = 0; k <= last; k++ )

if ( document.getElementById("listBox1")(k).text.toUpperCase() > document.getElementById("listBox1")(k+1).text.toUpperCase() )

{

TempText = document.getElementById("listBox1")(k).text;

TempVal = document.getElementById("listBox1")(k).value;

document.getElementById("listBox1")(k).text = document.getElementById("listBox1")(k+1).text;

document.getElementById("listBox1")(k).value = document.getElementById("listBox1")(k+1).value;

document.getElementById("listBox1")(k+1).text = TempText;

document.getElementById("listBox1")(k+1).value = TempVal;

isChanged = 1;

}

last--;

}

return;

}

 

 

Bharathi Kambhampati

 

 

Tuesday, June 12, 2007

Freeze Table Columns & Non-Scroll Headers (HTML & CSS)

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0052)http://www.romanm.ch/ascii-animation/ascii-tiger.htm -->
<html>
 
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>1aaa</title>
<style type="text/css">
div#tbl-container {
width: 700px;
height: 252px;
overflow: auto;
scrollbar-base-color:#ffeaff;
}
 
table {
table-layout: fixed;
border-collapse: collapse;
background-color: WhiteSmoke;
}
 
div#tbl-container table th {
width: 100px;
}
 
thead th, thead th.locked {
font-size: 14px;
font-weight: bold;
text-align: center;
background-color: navy;
color: white;
border-right: 1px solid silver;
position:relative;
cursor: default;
}
 
thead th {
top: expression(document.getElementById("tbl-container").scrollTop-2); /* IE5+ only */
z-index: 20;
}
 
thead th.locked {z-index: 30;}
 
td.locked,  th.locked{
background-color: white;
font-weight: bold;
border-right: 1px solid silver;
left: expression(parentNode.parentNode.parentNode.parentNode.scrollLeft); /* IE5+ only */
position: relative;
z-index: 10;
}
 

</style>
</head>
 
<body>
<div id="tbl-container">
<table id="tbl">
<thead>
<tr>
<th class="locked">col1</th>
<th>col2</th>
<th>col3</th>
<th>col4</th>
<th>col5</th>
<th>col6</th>
<th>col7</th>
</tr>
</thead>
 
<tbody>
 
  <tr>
    <td class="locked">Student01</td>
    <td>Languages</td>
    <td>male</td>
    <td>80</td>
    <td>70</td>
    <td>75</td>
    <td>80</td>
 
  </tr>
  <tr>
    <td class="locked">Student02</td>
    <td>Mathematics</td>
    <td>male</td>
    <td>90</td>
    <td>88</td>
    <td>100</td>
    <td>90</td>
 
  </tr>
  <tr>
    <td class="locked">Student03</td>
    <td>Languages</td>
    <td>female</td>
    <td>85</td>
    <td>95</td>
    <td>80</td>
    <td>85</td>
 
  </tr>
  <tr>
    <td class="locked">Student04</td>
    <td>Languages</td>
    <td>male</td>
    <td>60</td>
    <td>55</td>
    <td>100</td>
    <td>100</td>
 
  </tr>
  <tr>
    <td class="locked">Student05</td>
    <td>Languages</td>
    <td>female</td>
    <td>68</td>
    <td>80</td>
    <td>95</td>
    <td>80</td>
 
  </tr>
  <tr>
    <td class="locked">Student06</td>
    <td>Mathematics</td>
    <td>male</td>
    <td>100</td>
    <td>99</td>
    <td>100</td>
    <td>90</td>
 
  </tr>
  <tr>
    <td class="locked">Student07</td>
    <td>Mathematics</td>
    <td>male</td>
    <td>85</td>
    <td>68</td>
    <td>90</td>
    <td>90</td>
 
  </tr>
  <tr>
    <td class="locked">Student08</td>
    <td>Languages</td>
    <td>male</td>
    <td>100</td>
    <td>90</td>
    <td>90</td>
    <td>85</td>
 
  </tr>
  <tr>
    <td class="locked">Student09</td>
    <td>Mathematics</td>
    <td>male</td>
    <td>80</td>
    <td>50</td>
    <td>65</td>
    <td>75</td>
 
  </tr>
  <tr>
    <td class="locked">Student10</td>
    <td>Languages</td>
    <td>male</td>
    <td>85</td>
    <td>100</td>
    <td>100</td>
    <td>90</td>
 
  </tr>
  <tr>
    <td class="locked">Student11</td>
    <td>Languages</td>
    <td>male</td>
    <td>86</td>
    <td>85</td>
    <td>100</td>
    <td>100</td>
 
  </tr>
  <tr>
    <td class="locked">Student12</td>
    <td>Mathematics</td>
    <td>female</td>
    <td>100</td>
    <td>75</td>
    <td>70</td>
    <td>85</td>
 
  </tr>
  <tr>
    <td class="locked">Student13</td>
    <td>Languages</td>
    <td>female</td>
    <td>100</td>
    <td>80</td>
    <td>100</td>
    <td>90</td>
 
  </tr>
  <tr>
    <td class="locked">Student14</td>
    <td>Languages</td>
    <td>female</td>
    <td>50</td>
    <td>45</td>
    <td>55</td>
    <td>90</td>
 
  </tr>
  <tr>
    <td class="locked">Student15</td>
    <td>Languages</td>
    <td>male</td>
    <td>95</td>
    <td>35</td>
    <td>100</td>
    <td>90</td>
 
  </tr>
  <tr>
    <td class="locked">Student16</td>
    <td>Languages</td>
    <td>female</td>
    <td>100</td>
    <td>50</td>
    <td>30</td>
    <td>70</td>
 
  </tr>
  <tr>
    <td class="locked">Student17</td>
    <td>Languages</td>
    <td>female</td>
    <td>80</td>
    <td>100</td>
    <td>55</td>
    <td>65</td>
 
  </tr>
  </tbody>
  </table>
  </div>
</body>
 
</html>
 
Source:http://web.tampabay.rr.com/bmerkey/examples/locked-column-csv.html

Tuesday, June 5, 2007

SQL SERVER 2000 Maximum Capacity Specifications

Object

SQL Server 2000

Batch size

65,536 * Network Packet Size1

Bytes per sort string column

8,000

Bytes per text, ntext, or image column

2 GB-2

Bytes per GROUP BY, ORDER BY

8,060

Bytes per index

9002

Bytes per foreign key

900

Bytes per primary key

900

Bytes per row

8,060

Bytes in source text of a stored procedure

Lesser of batch size or 250 MB

Clustered indexes per table

1

Columns in GROUP BY, ORDER BY

Limited only by number of bytes per GROUP BY, ORDER BY

Columns or expressions in a GROUP BY WITH CUBE or WITH ROLLUP statement

Columns per index

16

Columns per foreign key

16

Columns per primary key

16

Columns per base table

1,024

Columns per SELECT statement

4,096

Columns per INSERT statement

1,024

Connections per client

Maximum value of configured connections

Database size

1,048,516 TB3

Databases per instance of SQL Server

32,767

Filegroups per database

256

Files per database

32,767

File size (data)

32 TB

File size (log)

32 TB

Foreign key table references per table

253

Identifier length (in characters)

128

Instances per computer

16

Length of a string containing SQL statements (batch size)

65,536 * Network packet size1

Locks per connection

Max. locks per server

Locks per instance of SQL Server

2,147,483,647 (static)
40% of SQL Server memory (dynamic)

Nested stored procedure levels

32

Nested subqueries

32

Nested trigger levels

32

Nonclustered indexes per table

249

Objects concurrently open in an instance of SQL Server4

2,147,483,647 (or available memory)

Objects in a database

2,147,483,6474

Parameters per stored procedure

2,100

REFERENCES per table

253

Rows per table

Limited by available storage

Tables per database

Limited by number of objects in a database4

Tables per SELECT statement

256

Triggers per table

Limited by number of objects in a database4

UNIQUE indexes or constraints per table

249 nonclustered and 1 clustered

Maximum Capacity Specifications for SQL Server 2005

 

The following table specifies the maximum sizes and numbers of various objects defined in SQL Server 2005 databases or referenced in Transact-SQL statements. The table does not include SQL Server Windows CE Edition.

SQL Server 2005 Database Engine object Maximum sizes/numbers SQL Server 2005 (32-bit) Maximum sizes/numbers SQL Server 2005 (64-bit)

Batch size1

65,536 * Network Packet Size

65,536 * Network Packet Size

Bytes per short string column

8,000

8,000

Bytes per GROUP BY, ORDER BY

8,060

8,060

Bytes per index key2

900

900

Bytes per foreign key

900

900

Bytes per primary key

900

900

Bytes per row8

8,060

8,060

Bytes per varchar(max), varbinary(max), xml, text, or image column

2^31-1

2^31-1

Characters per ntext or nvarchar(max) column

2^30-1

2^30-1

Clustered indexes per table

1

1

Columns in GROUP BY, ORDER BY

Limited only by number of bytes

Limited only by number of bytes

Columns or expressions in a GROUP BY WITH CUBE or WITH ROLLUP statement

10

10

Columns per index key7

16

16

Columns per foreign key

16

16

Columns per primary key

16

16

Columns per base table

1,024

1,024

Columns per SELECT statement

4,096

4,096

Columns per INSERT statement

1,024

1,024

Connections per client

Maximum value of configured connections

Maximum value of configured connections

Database size

1,048,516 terabytes

1,048,516 terabytes

Databases per instance of SQL Server

32,767

32,767

Filegroups per database

32,767

32,767

Files per database

32,767

32,767

File size (data)

16 terabytes

16 terabytes

File size (log)

2 terabytes

2 terabytes

Foreign key table references per table4

253

253

Identifier length (in characters)

128

128

Instances per computer

50 instances on a stand-alone server for all SQL Server 2005 editions except for Workgroup Edition. Workgroup Edition supports a maximum of 16 instances.

SQL Server 2005 supports 25 instances on a failover cluster.

50 instances on a stand-alone server.

25 instances on a failover cluster.

Length of a string containing SQL statements (batch size)1

65,536 * Network packet size

65,536 * Network packet size

Locks per connection

Maximum locks per server

Maximum locks per server

Locks per instance of SQL Server5

Up to 2,147,483,647

Limited only by memory

Nested stored procedure levels6

32

32

Nested subqueries

32

32

Nested trigger levels

32

32

Nonclustered indexes per table

249

249

Parameters per stored procedure

2,100

2,100

Parameters per user-defined function

2,100

2,100

REFERENCES per table

253

253

Rows per table

Limited by available storage

Limited by available storage

Tables per database3

Limited by number of objects in a database

Limited by number of objects in a database

Partitions per partitioned table or index

1,000

1,000

Statistics on non-indexed columns

2,000

2,000

Tables per SELECT statement

256

256

Triggers per table3

Limited by number of objects in a database

Limited by number of objects in a database

UNIQUE indexes or constraints per table

249 nonclustered and 1 clustered

249 nonclustered and 1 clustered

User connections

32,767

32,767

XML indexes

249

249