Search This Blog

Tuesday, September 30, 2008

Register exe as Windows Service

From command line where the exe exists
Application.exe -install

installutil Application.exe

To remove
Application.exe -uninstall

installutil Application.exe /u

Friday, September 26, 2008

BCP and SMO for SQL 2008

These needed to have BCP DMO/SMo support in SQL 2008

When installing SS2008, if you remove your only instance of SQL 2000 or SQL 2005, DMO may disappear. Here is an article of how to reinstall it. I understand that there is an upgrade to DMO which fixes a bug so it can talk to SS2005 & SS2008. That is not referred to in this document. We may want to create this package to use in the future.

http://support.microsoft.com/kb/326613

BCP – Install the Microsoft SQL Server 2008 Command Line Utilities from net prod dev\tool\sql2008…


Tuesday, September 23, 2008

SQL Server 2000 sysindexes Table Columns

, sysSource

Column name Data type Description

id

int

ID of table (for indid = 0 or 255). Otherwise, ID of table to which the index belongs.

status

int

Internal system-status information.

first

binary(6)

Pointer to the first or root page.

indid

smallint

ID of index:

0 = Heap = Table Data (not Index)
1 = Clustered Index
2 ... 254 = Nonclustered Index
255 = Entry for tables that have text or image data

root

binary(6)

For indid >= 1 and < indid =" 0" indid =" 255,">

minlen

smallint

Minimum size of a row.

keycnt

smallint

Number of keys.

groupid

smallint

Filegroup ID on which the object was created.

dpages

int

For indid = 0 or indid = 1, dpages is the count of data pages used. For indid=255, it is set to 0. Otherwise, it is the count of index pages used.

reserved

int

For indid = 0 or indid = 1, reserved is the count of pages allocated for all indexes and table data. For indid = 255, reserved is a count of the pages allocated for text or image data. Otherwise, it is the count of pages allocated for the index.

used

int

For indid = 0 or indid = 1, used is the count of the total pages used for all index and table data. For indid = 255, used is a count of the pages used for text or image data. Otherwise, it is the count of pages used for the index.

rowcnt

bigint

Data-level rowcount based on indid = 0 and indid = 1. For indid = 255, rowcnt is set to 0.

rowmodctr

int

Counts the total number of inserted, deleted, or updated rows since the last time statistics were updated for the table.

xmaxlen

smallint

Maximum size of a row.

maxirow

smallint

Maximum size of a nonleaf index row.

OrigFillFactor

tinyint

Original fillfactor value used when the index was created. This value is not maintained; however, it can be helpful if you need to re-create an index and do not remember what fillfactor was used.

reserved1

tinyint

Reserved.

reserved2

int

Reserved.

FirstIAM

binary(6)

Reserved.

impid

smallint

Reserved. Index implementation flag.

lockflags

smallint

Used to constrain the considered lock granularities for an index. For example, a lookup table that is essentially read-only could be set up to do only table level locking to minimize locking cost.

pgmodctr

int

Reserved.

keys

varbinary(816)

List of the column IDs of the columns that make up the index key.

name

sysname

Name of table (for indid = 0 or 255). Otherwise, name of index.

statblob

image

Statistics BLOB.

maxlen

int

Reserved.

rows

int

Data-level rowcount based on indid = 0 and indid = 1, and the value is repeated for indid >1. For indid = 255, rows is set to 0. Provided for backward compatibility.

Find Primary Key in SQL 2000

In SQL Server 2000 it is difficult to see as primary key and a foreign key.

Try running this script, which will give you all primary key on all tables in the database including column information.


SELECT A.TABLE_NAME, A.CONSTRAINT_NAME, B.COLUMN_NAME
FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS A, INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE B
WHERE CONSTRAINT_TYPE = 'PRIMARY KEY' AND A.CONSTRAINT_NAME = B.CONSTRAINT_NAME
ORDER BY A.TABLE_NAME

Thursday, September 18, 2008

Moonville Tunnel Photos

Moonville and Kings Tunnels circa 1850s



Front side
From Railroad Tunnel


Far Side
From Railroad Tunnel

Insert Identity ON for SQL Server

SET IDENTITY_INSERT tablename ON
SET IDENTITY_INSERT tablename OFF

How to Alter Blogger Template

This is my first attempt to alter my blogger template, I thought I would want I discover.

Increase over width of page:
/* Wrapper */

#outer-wrapper {
margin: 0 auto;
border: 0;
width: 1200px;
text-align: $startSide;
background: $mainBgColor url(http://www.blogblog.com/moto_son/innerwrap.gif) top $endSide repeat-y;
font: $bodyFont;
}

Previous value width: 692px;