Wednesday, March 28, 2012
Problems with SQL-DMO.Job Script method
Agent Jobs. In this program I am using the SQL-DMO objects for SQL
Server.
When the output is generated from the Job.Script method the job steps
are not in the correct order. They are ordered by step_name rather
than the step_id. Scripts generated from Enterprise Manager works
fine. It is just the ones from the DMO objects that get out of order.
Anybody have this problem as well?
Thanks in advance.
Keith
Problem solved!
The msdb statistics were not updated and the query was using the
non-clustered index rather than the clustered index. The non-clustered
index was job_id, step_name. The clustered index is job_id , step_id.
Updated the statistics on msdb tables and it worked fine.
sql
Problems with SQL-DMO.Job Script method
Agent Jobs. In this program I am using the SQL-DMO objects for SQL
Server.
When the output is generated from the Job.Script method the job steps
are not in the correct order. They are ordered by step_name rather
than the step_id. Scripts generated from Enterprise Manager works
fine. It is just the ones from the DMO objects that get out of order.
Anybody have this problem as well?
Thanks in advance.
KeithProblem solved!
The msdb statistics were not updated and the query was using the
non-clustered index rather than the clustered index. The non-clustered
index was job_id, step_name. The clustered index is job_id , step_id.
Updated the statistics on msdb tables and it worked fine.
Problems with SQL-DMO.Job Script method
Agent Jobs. In this program I am using the SQL-DMO objects for SQL
Server.
When the output is generated from the Job.Script method the job steps
are not in the correct order. They are ordered by step_name rather
than the step_id. Scripts generated from Enterprise Manager works
fine. It is just the ones from the DMO objects that get out of order.
Anybody have this problem as well?
Thanks in advance.
KeithProblem solved!
The msdb statistics were not updated and the query was using the
non-clustered index rather than the clustered index. The non-clustered
index was job_id, step_name. The clustered index is job_id , step_id.
Updated the statistics on msdb tables and it worked fine.
Friday, March 23, 2012
Problems with quick record count (no table info in sysindexes)
In my program, I use the following statement to get a quick count of the
records in a given table:
SELECT [rows] FROM sysindexes WHERE [indid] = 0 AND [name] = 'table_name'
I don't know if it's just a bug with SQL, but it sometimes happens that when
there are changes to a particular table, there is no entry for that table in
sysindexes. I know this is pretty weird because BOL states that every table
should have an entry in sysindexes. If I drop the DB and then recreate it,
everything's OK but this is, of course, no realistic solution every time I
alter a table.
Does anyone else have this problem? Is there anything I can run to
repopulate sysindexes? Was this solved with some SP?
Any help would be much appreciated.
TIA,
sivrik.> In my program, I use the following statement to get a quick count of the
> records in a given table:
Why not just to SELECT COUNT(*) FROM TableName
or look at sp_spaceused system stored procedure in the BOL
Note: It's not recomended to query system tables instead use
INFORMATION_SCHEMA views. (See examples in the BOL)
"sivrik" <sivrik@.discussions.microsoft.com> wrote in message
news:7BB560F0-ADB7-43CB-B0FA-8BD687F65699@.microsoft.com...
> Hi everybody,
> In my program, I use the following statement to get a quick count of the
> records in a given table:
> SELECT [rows] FROM sysindexes WHERE [indid] = 0 AND [name] = 'table_name'
> I don't know if it's just a bug with SQL, but it sometimes happens that
when
> there are changes to a particular table, there is no entry for that table
in
> sysindexes. I know this is pretty weird because BOL states that every
table
> should have an entry in sysindexes. If I drop the DB and then recreate
it,
> everything's OK but this is, of course, no realistic solution every time I
> alter a table.
> Does anyone else have this problem? Is there anything I can run to
> repopulate sysindexes? Was this solved with some SP?
> Any help would be much appreciated.
> TIA,
> sivrik.|||Uri,
Thanks for the reply. I don't use SELECT COUNT(*) because there can be a
lot of data in a particular table and it takes forever. Thanks for the tip
on sp_spaceused. Is there a way to get it to return only the rowcount? I
need to set the value to a variable. I know this won't work but something
like:
select [rows] from (exec sp_spaceused 'table_name')
Or maybe there's another way to get this value quickly. I took a quick look
at INFORMATION_SCHEMA but couldn't find anything helpful.
Thanks again,
sivrik.
"Uri Dimant" wrote:
> Why not just to SELECT COUNT(*) FROM TableName
> or look at sp_spaceused system stored procedure in the BOL
>
> Note: It's not recomended to query system tables instead use
> INFORMATION_SCHEMA views. (See examples in the BOL)
>
> "sivrik" <sivrik@.discussions.microsoft.com> wrote in message
> news:7BB560F0-ADB7-43CB-B0FA-8BD687F65699@.microsoft.com...
> when
> in
> table
> it,
>
>|||I think your problem is that you are assuming that indid is always the table
.
If the table has a clustered index, then the 0 is changed to 1. 0 for indid
indicates the table has no clustered index and is a heap. When a clustered
index is added the 0 is changed.
select count(*) is the best way to get a quick count of rows. I uses index
information if possible.
"sivrik" wrote:
> Hi everybody,
> In my program, I use the following statement to get a quick count of the
> records in a given table:
> SELECT [rows] FROM sysindexes WHERE [indid] = 0 AND [name] = 'table_name'
> I don't know if it's just a bug with SQL, but it sometimes happens that wh
en
> there are changes to a particular table, there is no entry for that table
in
> sysindexes. I know this is pretty weird because BOL states that every tab
le
> should have an entry in sysindexes. If I drop the DB and then recreate it
,
> everything's OK but this is, of course, no realistic solution every time I
> alter a table.
> Does anyone else have this problem? Is there anything I can run to
> repopulate sysindexes? Was this solved with some SP?
> Any help would be much appreciated.
> TIA,
> sivrik.|||Mike,
Thanks for the reply. I did make that assumption but the problem is that
ALL information for the particular table "disappears" from sysindexes. So
SELECT * FROM sysindexes WHERE [name] = 'Table_Name'
returns absolutely nothing. SELECT COUNT(*) from a table with a lot of data
in it takes forever so that's why I was looking for a quicker way.
sivrik.
"Mike Hanson" wrote:
> I think your problem is that you are assuming that indid is always the tab
le.
> If the table has a clustered index, then the 0 is changed to 1. 0 for ind
id
> indicates the table has no clustered index and is a heap. When a clustere
d
> index is added the 0 is changed.
> select count(*) is the best way to get a quick count of rows. I uses inde
x
> information if possible.
> "sivrik" wrote:
>|||Hi
You will have to create a 'template' table with all columns that output from
sp_spaceused
INSERT INTO #Temp EXEC sp_spaceused 'table name'
SELECT COUNT(rows) FROM #Temp
Another way is to create an indexed view that will produce a more efficient
execution plan.
This example has written by Steve Kass.
create table T (
i int,
filler char(1000) default 'abc'
)
go
create view T_count with schemabinding as
select
cast(i as bit) as val,
count_big(*) T_count
from dbo.T group by cast(i as bit)
go
create unique clustered index T_count_uci on T_count(val)
go
insert into T(i)
select OrderID
from Northwind..[Order Details]
go
set statistics io on
select count(*) from T
go
select sum(T_count) from T_count with (noexpand)
go
set statistics io off
-- uses an efficient query plan on the materialized view
go
drop view T_count
drop table T
"sivrik" <sivrik@.discussions.microsoft.com> wrote in message
news:0F09E3E7-2B20-41BD-98E6-0354136D8D2C@.microsoft.com...
> Uri,
> Thanks for the reply. I don't use SELECT COUNT(*) because there can be a
> lot of data in a particular table and it takes forever. Thanks for the
tip
> on sp_spaceused. Is there a way to get it to return only the rowcount? I
> need to set the value to a variable. I know this won't work but something
> like:
> select [rows] from (exec sp_spaceused 'table_name')
> Or maybe there's another way to get this value quickly. I took a quick
look
> at INFORMATION_SCHEMA but couldn't find anything helpful.
> Thanks again,
> sivrik.
> "Uri Dimant" wrote:
>
the
the
'table_name'
that
table
recreate
time I|||Hi Sivrik
I have never heard of information dissappearing from sysindexes before, at
the risk of offending you, are you sure you are running the select within th
e
right database context. I do this all the time in Query Analyzer, forgettin
g
to change the context, perhaps your application connection string is not
setting the correct database context for the query.
I usally find count(*) to be quite fast if a clustered index exists on the
table and statistics are up to date. Usually slow performance of this
function means it is actually having to update the statistics (if automatic
statistics are enabled) or do a manual count, because statistics are out of
date or do not exist.
Mike Hanson
"sivrik" wrote:
> Mike,
> Thanks for the reply. I did make that assumption but the problem is that
> ALL information for the particular table "disappears" from sysindexes. So
> SELECT * FROM sysindexes WHERE [name] = 'Table_Name'
> returns absolutely nothing. SELECT COUNT(*) from a table with a lot of da
ta
> in it takes forever so that's why I was looking for a quicker way.
> sivrik.
>
> "Mike Hanson" wrote:
>|||sivrik try
create table #temp(name varchar(100), rows int, reserved varchar(100), data
varchar(100), index_size varchar(100), unused varchar(100))
insert #temp(name, rows, reserved, data, index_size, unused)
exec sp_spaceused 'your table'
select rows from #temp
Regards
Meir
"sivrik" <sivrik@.discussions.microsoft.com> wrote in message
news:0F09E3E7-2B20-41BD-98E6-0354136D8D2C@.microsoft.com...
> Uri,
> Thanks for the reply. I don't use SELECT COUNT(*) because there can be a
> lot of data in a particular table and it takes forever. Thanks for the
tip
> on sp_spaceused. Is there a way to get it to return only the rowcount? I
> need to set the value to a variable. I know this won't work but something
> like:
> select [rows] from (exec sp_spaceused 'table_name')
> Or maybe there's another way to get this value quickly. I took a quick
look
> at INFORMATION_SCHEMA but couldn't find anything helpful.
> Thanks again,
> sivrik.
> "Uri Dimant" wrote:
>
the
the
'table_name'
that
table
recreate
time I|||No offense taken, I'm sure we've all forgot to swith the DB in query analyze
r
before. =) No, it's not that I'm running it in the wrong context. It's
actually that there is no more information about the table in sysindexes. I
t
seems strange to me too so that's why I was asking.
Thanks,
sivrik.
"Mike Hanson" wrote:
> Hi Sivrik
> I have never heard of information dissappearing from sysindexes before, at
> the risk of offending you, are you sure you are running the select within
the
> right database context. I do this all the time in Query Analyzer, forgett
ing
> to change the context, perhaps your application connection string is not
> setting the correct database context for the query.
> I usally find count(*) to be quite fast if a clustered index exists on the
> table and statistics are up to date. Usually slow performance of this
> function means it is actually having to update the statistics (if automati
c
> statistics are enabled) or do a manual count, because statistics are out o
f
> date or do not exist.
> Mike Hanson
>|||Also you need to be aware that the information you get from spaceused (which
comes from sysindexes ) is not updated with each insert, update, or delete,
and will often be close , but not exact... ( It can be very far off if you
have done a truncate table.)
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"sivrik" <sivrik@.discussions.microsoft.com> wrote in message
news:B7F509C2-6C9E-4B0B-B091-0A8DFBB8F790@.microsoft.com...
> No offense taken, I'm sure we've all forgot to swith the DB in query
> analyzer
> before. =) No, it's not that I'm running it in the wrong context. It's
> actually that there is no more information about the table in sysindexes.
> It
> seems strange to me too so that's why I was asking.
> Thanks,
> sivrik.
> "Mike Hanson" wrote:
>
>
Wednesday, March 21, 2012
Problems with Parameters (C#)
mentioned here many times to my report. I get the following error:
Default value or value provided for the report parameter 'fromclient' is
not a valid value.
The execution log shows 'rsInvalidReportParameter'.
'fromclient is a string value and it is the 3rd parameter of seven. The
first two are boolean, and I pass them as "0" and "1".
I don't seem to get past this point. What am I doing wrong?
GerhardJust check the Report parameters and see what datatype is
set for FromClient.
May be its set to something else other than string
>--Original Message--
>I am passing parameters from Bryan Keller's C# program
that has been
>mentioned here many times to my report. I get the
following error:
> Default value or value provided for the report
parameter 'fromclient' is
>not a valid value.
>The execution log shows 'rsInvalidReportParameter'.
>'fromclient is a string value and it is the 3rd parameter
of seven. The
>first two are boolean, and I pass them as "0" and "1".
>I don't seem to get past this point. What am I doing wrong?
>Gerhard
>
>.
>|||It's string but it is from a query (dropdown box). Maybe that's the
problem?
Gerhard
"Ravi" <ravikantkv@.rediffmail.com> wrote in message
news:5a3301c491d9$db50e8a0$a601280a@.phx.gbl...
> Just check the Report parameters and see what datatype is
> set for FromClient.
> May be its set to something else other than string
> >--Original Message--
> >I am passing parameters from Bryan Keller's C# program
> that has been
> >mentioned here many times to my report. I get the
> following error:
> > Default value or value provided for the report
> parameter 'fromclient' is
> >not a valid value.
> >The execution log shows 'rsInvalidReportParameter'.
> >
> >'fromclient is a string value and it is the 3rd parameter
> of seven. The
> >first two are boolean, and I pass them as "0" and "1".
> >I don't seem to get past this point. What am I doing wrong?
> >Gerhard
> >
> >
> >.
> >
Monday, March 12, 2012
Problems with installing SQL Server 2005 Developer Edition
Hi,
I downloaded SQL Server 2005 Developer Edition (x86) via MSDNAA (the package conatins 2 cd images the download program CRC checked them and all. I'm trying to install it on Windows XP prof. sp2).
When I mount the first CD, the installation menu comes up, if from the Install menu I select
"Server components, tools, Books Online, and samples"
an error message pops up saying:
"The application or DLL D:\Setup\setupex.dll is not a valid Windows image. Please check this against your installation diskette."
When I press OK, it pops up again, then after clicking on OK one more time the Microsoft SQL Server 2005 Setup window comes up. After accepting the installation conditions and clicking next, it takes me to the "Installing Prerequisites" phrase, where when I press the Install button, it writes:
"Errors occured during the installation:
Error 193 installing .NET Framework 2.0"
Then the installation freezes, and I must press cancel (after that, the installation breaks saying: SQL Server Setup unexpectedly failed...)
If in the installation menu I choose
" Install SQL Server Upgrade Advisor"
or
" Run the SQL Native Client Installation Wizard"
a warning pops up saying:
"This installation package could not be opened.
Contact the application vendor to verify that this is a
valid Windows Installer package."
When I press OK, the warning disappeares, nothing happens.
I have .NET Framework 2.0, running VS2005 Prof. with no problem, had MS SQL Server 2005 Express Edition, but uninstalled it (never used), and just installed the latest MSI.
Searched the net for the "error 193" message, but haven't found anything that actually could help my case.
Thank you for your help.
You say you are mounting the installation CD, with what software are you mounting the CD/DVD image. Guess that if the DVD is CRC Check-ok there is a problem with your mounting software, not with the actual image.HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
|||
Oh yes, I forgot to mention that I tried to burn the iso too. Used Damon Tools 4.0 for mounting and Magic ISO for burning. (burnt version gives the same errors)
|||I have exactly the same problem. Did you overcome this? I can't find any answers on the web.I've downloaded the image several times, tried mounting using several different tools, and tried burning to disc but always the same error. Also tried repairing .net 2 framework.
|||Well, I also encountered the same problem. I mounted the iso image using Nero ImageDrive and it installed well. I think it has something to do with installation path.
So, try mounting your iso image and run the install again.
Problems with installing SQL Server 2005 Developer Edition
Hi,
I downloaded SQL Server 2005 Developer Edition (x86) via MSDNAA (the package conatins 2 cd images the download program CRC checked them and all. I'm trying to install it on Windows XP prof. sp2).
When I mount the first CD, the installation menu comes up, if from the Install menu I select
"Server components, tools, Books Online, and samples"
an error message pops up saying:
"The application or DLL D:\Setup\setupex.dll is not a valid Windows image. Please check this against your installation diskette."
When I press OK, it pops up again, then after clicking on OK one more time the Microsoft SQL Server 2005 Setup window comes up. After accepting the installation conditions and clicking next, it takes me to the "Installing Prerequisites" phrase, where when I press the Install button, it writes:
"Errors occured during the installation:
Error 193 installing .NET Framework 2.0"
Then the installation freezes, and I must press cancel (after that, the installation breaks saying: SQL Server Setup unexpectedly failed...)
If in the installation menu I choose
" Install SQL Server Upgrade Advisor"
or
" Run the SQL Native Client Installation Wizard"
a warning pops up saying:
"This installation package could not be opened.
Contact the application vendor to verify that this is a
valid Windows Installer package."
When I press OK, the warning disappeares, nothing happens.
I have .NET Framework 2.0, running VS2005 Prof. with no problem, had MS SQL Server 2005 Express Edition, but uninstalled it (never used), and just installed the latest MSI.
Searched the net for the "error 193" message, but haven't found anything that actually could help my case.
Thank you for your help.
You say you are mounting the installation CD, with what software are you mounting the CD/DVD image. Guess that if the DVD is CRC Check-ok there is a problem with your mounting software, not with the actual image.HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
|||
Oh yes, I forgot to mention that I tried to burn the iso too. Used Damon Tools 4.0 for mounting and Magic ISO for burning. (burnt version gives the same errors)
|||I have exactly the same problem. Did you overcome this? I can't find any answers on the web.I've downloaded the image several times, tried mounting using several different tools, and tried burning to disc but always the same error. Also tried repairing .net 2 framework.
Problems with identity column
which recorded when a certain event was complete. I was removing this field
because it was possible to tell that the event was complete through other
means so the field was a duplication and a violation of good data design.
The end result was that it was possible for something in the program to show
as completed when in fact it wasn't. I thought this was a really good
example of how bad data design effects the end user.
When using Identity columns as the primary key some here think it is bad
design but I've never seen anyone quote an actual di
vantage for the enduser, all the "di
vantages" seem to be quite abstract and far removed fromthe real world. In fact all I can see is advantages for the end user. Can
anyone come up with an actual real word di
vantage for an identity columnpk?IDENTITY, BIT, and "field" are **totally non-relational** concepts.
But in fairness, you realized that you had a computed column (NOT
field!!) so perhaps you can be saved.
Let me go ahead one more step and play Q&A with the direction I think
you are going:
Q: Couldn't a compound key become very long?
A1: So what? This is the 21-s's century and we have much better
computers than we did in the 1950's when key size was a real physical
issue. What is funny to me is the number of idiots who replace a
natural two or three integer compound key with a huge GUID that no
human being or other system can possibly understand because they think
it will be "faster and easy" to program.
A2: This is an implementation problem that the SQL engine can handle.
For example, Teradata is an SQL designed for VLDB apps that uses
hashing instead of B-tree or other indexes. They guarantee that no
search requires more than two probes, no matter how large the database.
A tree index requires more and more probes as the size of the database
increases.
A3: A long key is not always a bad thing for performance. For example,
if I use (city, state) as my key, I get a free index on just (city). I
can also add extra columns to the key to make it a super-key when such
a super-key gives me a covering index (i.e. an index which contains all
of the columns required for a query, so that the base table does not
have to be accessed at all).
A handle to the row? Oh, you mean faking a sequential file's
positional record number, so I can reference the physical storage
location? Sure, if I want to lose all the advantages of an abstract
data model, SQL set oriented programming, carry extra data and destroy
the portability of code!
More and more programmers who have absolutely no database training are
being told to design a database. They are using GUIDs, IDENTITY, ROWID
and other proprietary auto-numbering "features" in SQL products to
imitate either a record number (sequential file system mindset) or OID
(OO mindset) since they don't know anything else.
Experienced database designers tend toward intelligent keys they find
in industry standard codes, such as UPC, VIN, GTIN, ISBN, etc. They
know that they need to verify the data against the reality they are
modeling. A trusted external source is a good thing to have.
The IDENTITY column is a holdover from the early programming languages
which were very close to the hardware. For example, the fields (not
columns; big difference) in a COBOL or FORTRAN program were assumed to
be physically located in main storage in the order they were declared
in the program. The languages have constructs using that model --
logical and physical implementations are practically one! The data has
meaning BECAUSE of the program reading it (i.e. the same bits could be
a character in one program and be an integer in another)
The early SQLs were based on existing file systems. The data was kept
in physically contiguous disk pages, in physically contiguous rows,
made up of physically contiguous columns. In short, just like a deck
of punch cards or a magnetic tape. Most programmer still carry that
mental model, which is why I keep doing that rant about file vs. table,
row vs. record and column vs. field.
But physically contiguous storage is only one way of building a
relational database and it is not the best one. The basic idea of a
relational database is that user is not supposed to know *how* or
*where* things are stored at all, much less write code that depends on
the particular physical representation in a particular release of a
particular product on particular hardware at a particular time.
One of the biggest errors is the IDENTITY column (actually property,
not a column at all) in the Sybase/SQL Server family. People actually
program with this "feature" and even use it as the primary key for the
table! Now, let's go into painful details as to why this thing is bad.
The first practical consideration is that IDENTITY is proprietary and
non-portable, so you know that you will have maintenance problems when
you change releases or port your system to other products. Newbies
actually think they will never port code! Perhaps they only work for
companies that are failing and will be gone. Perhaps their code is
such crap nobody else want their application.
But let's look at the logical problems. First try to create a table
with two columns and try to make them both IDENTITY. If you cannot
declare more than one column to be of a certain data type, then that
thing is not a datatype at all, by definition. It is a property which
belongs to the PHYSICAL table, not the LOGICAL data in the table.
Next, create a table with one column and make it an IDENTITY. Now try
to insert, update and delete different numbers from it. If you cannot
insert, update and delete rows from a table, then it is not a table by
definition.
Finally create a simple table with one IDENTITY and a few other
columns. Use a few statements like
INSERT INTO Foobar (a, b, c) VALUES ('a1', 'b1', 'c1');
INSERT INTO Foobar (a, b, c) VALUES ('a2', 'b2', 'c2');
INSERT INTO Foobar (a, b, c) VALUES ('a3', 'b3', 'c3');
To put a few rows into the table and notice that the IDENTITY
sequentially numbered them in the order they were presented. If you
delete a row, the gap in the sequence is not filled in and the sequence
continues from the highest number that has ever been used in that
column in that particular table. This is how we did record numbers in
pre-allocated sequential files in the 1950's, by the way. A utility
program would then "pack" or "compress" the records that were flagged
as deleted or unused to move the empty space to the physical end of the
physical file. IDENTITY leaves the gaps.
But now use a statement with a query expression in it, like this:
INSERT INTO Foobar (a, b, c)
SELECT x, y, z
FROM Floob;
Since a query result is a table, and a table is a set which has no
ordering, what should the IDENTITY numbers be? The entire, whole,
completed set is presented to Foobar all at once, not a row at a time.
There are (n!) ways to number (n) rows, so which one do you pick? The
answer has been to use whatever the *physical* order of the result set
happened to be. That non-relational phrase "physical order" again!
But it is actually worse than that. If the same query is executed
again, but with new statistics or after an index has been dropped or
added, the new execution plan could bring the result set back in a
different physical order.
Can you explain from a logical model why the same rows in the second
query get different IDENTITY numbers? In the relational model, they
should be treated the same if all the values of all the attributes are
identical.
Using IDENTITY as a primary key is a sign that there is no data model,
only an imitation of a sequential file system. Since this "magic,
all-purpose, one-size-fits-all" pseudo-identifier exists only as a
result of the physical state of a particular piece of hardware at a
particular time as read by the current release of a particular database
product, how do you verify that an entity has such a number in the
reality you are modeling?
You will see newbies who design tables like this:
CREATE Drivers
(driver_id IDENTITY (1,1) NOT NULL PRIMARY KEY,
ssn CHAR(9) NOT NULL REFERENCES Personnel(ssn),
vin CHAR(17) NOT NULL REFERENCES Motorpool(vin));
Now input data and submit the same row a thousand times, a million
times. Your data integrity is trashed. The natural key was this:
CREATE Drivers
(ssn CHAR(9) NOT NULL REFERENCES Personnel(ssn),
vin CHAR(17) NOT NULL REFERENCES Motorpool(vin),
PRIMARY KEY (ssn, vin));
To demonstrate, here is a typical newbie schema -- you will them all
over the news groups. I call them "idiots" because they always name
the IDENTITY property column "id" in EVERY table. They don't
understand basic data modeling -- one and only name for an attribute.
About half the time they don't use any DRI, but let's show it.
CREATE TABLE MotorPool
(id IDENTITY (1,1) NOT NULL PRIMARY KEY,
ssn CHAR(9) NOT NULL REFERENCES Personnel(snn),
vin CHAR(17) NOT NULL REFERENCES Vehicle(vin));
CREATE TABLE Personnel
(id IDENTITY (1,1) NOT NULL PRIMARY KEY,
ssn CHAR(9) NOT NULL UNIQUE,
.);
CREATE TABLE Vehicles
(id IDENTITY (1,1) NOT NULL PRIMARY KEY,
vin CHAR(17) NOT NULL UNIQUE,
..);
Now change a row in Personnel:
UPDATE Personnel
SET ssn = '666666666'
WHERE id = 1;
or
UPDATE Personnel
SET ssn = '666666666'
WHERE ssn = '999999999';
or
BEGIN ATOMIC
DELETE FROM Personnel WHERE id = 1;
INSERT INTO Personnel VALUES ('666666666');
END;
What happened in Motorpool? There is no logical relationship between
the real key and the exposed physical locator, not is there any way to
make one.
Another cute way to destroy data integrity:
BEGIN ATOMIC
DELETE FROM Foobar
WHERE id = <<some row>>;
INSERT INTO Foobar
VALUES ( <<recreate deleted row>> )
END;
Logically this should do nothing, but since IDENTITY has gaps, it
trashes the data.
Now you are REALLY thinking about relations and keys instead of 1950's
sequential record numbering. Adding an IDENTITY column to either of
these tables as a candidate key would be dangerously redundant; one
query uses the IDENTITY and another uses the real key, and like a man
with two watches, you are never sure what time it is.
Finally, an appeal to authority, with a quote from Dr. Codd:
"..Database users may cause the system to generate or delete a
surrogate, but they have no control over its value, nor is its value
ever displayed to them ..."(Dr. Codd in ACM TODS, pp 409-410) and Codd,
E. (1979), Extending the database relational model to capture more
meaning. ACM Transactions on Database Systems, 4(4). pp. 397-434.
This means that a surrogate ought to act like an index; created by the
user, managed by the system and NEVER seen by a user. That means never
used in queries, DRI or anything else that a user does.
Codd also wrote the following:
"There are three difficulties in employing user-controlled keys as
permanent surrogates for entities.
(1) The actual values of user-controlled keys are determined by users
and must therefore be subject to change by them (e.g. if two companies
merge, the two employee databases might be combined with the result
that some or all of the serial numbers might be changed.).
(2) Two relations may have user-controlled keys defined on distinct
domains (e.g. one uses social security, while the other uses employee
serial numbers) and yet the entities denoted are the same.
(3) It may be necessary to carry information about an entity either
before it has been assigned a user-controlled key value or after it has
ceased to have one (e.g. and applicant for a job and a retiree).
These difficulties have the important consequence that an equi-join on
common key values may not yield the same result as a join on common
entities. A solution - proposed in part [4] and more fully in [14] -
is to introduce entity domains which contain system-assigned
surrogates. Database users may cause the system to generate or delete
a surrogate, but they have no control over its value, nor is its value
ever displayed to them...." (Codd in ACM TODS, pp 409-410).
References
Codd, E. (1979), Extending the database relational model to capture
more meaning. ACM Transactions on Database Systems, 4(4). pp. 397-434|||Although I do use identity columns myself, off the top of my head, I can thi
nk
of four issues with Identity columns
1. Users have to make a call to the database to get the PK value. This is a
pain
in parent-child situations where the parent must save before you save the
children. It is much nicer from a development standpoint to be able to gener
ate
a unique PK value on the client (or middle-tier) side. This is an easy issue
to
solve of course, it just doesn't make it as nice.
2. It is difficult if not impossible to share your keys with third parties.
If
you need to allow third-parties to generate keys (e.g. shipping numbers), th
en
Identity columns are out of the question. They absolutely will need the abil
ity
to generate a unique key on their side that will be unique on your side. Thi
s is
situation where a check digit of some sort is truly necessary. However, most
systems do not have this requirement. If it is never expected for this situa
tion
to arise, then this shouldn't be a consideration. Not every system has to be
designed to meet DOD standards.
3. Replication is more difficult. If you have multiple sites with databases
that
contain Identity columns, it is much more difficult to set it up in such a w
ay
as to not get conflicts between the two sites. It is still doable, but more
problematic. In addition, the more sites you add, the more difficult it is.
4. It is more difficult to port to a system that does not contain Identity
columns. This one is a pipe dream IMO. Part of the cost of porting to anothe
r
system would be the creation of a new key generation mechanism to take the p
lace
of the identity column. Further, it is likely that there are far more issues
that will need to be resolved than handling identity column.
Part of the problem is that "primary key" denotes two vastly different conce
pts.
In the relational model, a key is a subset of an entity's attributes that a
human can use to identify that entity. However, in every vendor's DBMS, the
PK
is also the "glue" used to relate entities to each other. I.e., it has speci
al
meaning and purpose.
Further, I would argue that there are rare situations where a human has no n
eed
of identifying a entity. Generally, this happens when a human treats a serie
s of
items as a set of indistinguishable elements. For example, suppose we have
invoices and invoice items. While it is true that users will want a means to
identify an invoice, they may never have a desire to uniquely identify the i
tems
on the invoice and may specifically want to allow for situations where the s
ame
product is listed twice on the same invoice (A friend of mine actually
encountered this situation. I believe the reason given was clarity in displa
ying
discounts). However, while the *users* may never have a need to identify an
invoice item, the *system* that retrieves and saves them most likely will
(granted you could always read and write the entire list each time).
That said, when using Identity columns, I will make an effort to include at
least one unique index on the attributes other than the PK. The advantage of
this approach is that you can change and/or add unique keys far easier than
changing the makeup of the PK itself.
Thomas|||"--CELKO--" <jcelko212@.earthlink.net> wrote in message
news:1117151361.768467.270510@.z14g2000cwz.googlegroups.com...
> Q: Couldn't a compound key become very long?
> IDENTITY, BIT, and "field" are **totally non-relational** concepts.
> The first practical consideration is that IDENTITY is proprietary and
> non-portable,
> A handle to the row? Oh, you mean faking a sequential file's
> positional record number
> The IDENTITY column is a holdover from the early programming languages
<snip>
You proved my point perfectly. I asked if you could come up with an actual
real world end user di
vantage to identity pks. As I expected you came upwith a whole lot of abstract points that wouldn't affect the end user. I'm
sure that was a big cut and paste and largely irrelevant to the actual
question so I didn't read the whole thing but if by some chance there was a
di
vantage in there please let me know, I'd be very interested to see it.Michael|||"Thomas Coleman" <replyingroup@.anywhere.com> wrote in message
news:ungSrBlYFHA.584@.TK2MSFTNGP15.phx.gbl...
> Although I do use identity columns myself, off the top of my head, I can
> think of four issues with Identity columns
> 1. Users have to make a call to the database to get the PK value. This is
> a pain in parent-child situations where the parent must save before you
> save the children.
Users wouldn't see this though as you could make the save into a single
operation.
> It is much nicer from a development standpoint to be able to generate a
> unique PK value on the client (or middle-tier) side. This is an easy issue
> to solve of course, it just doesn't make it as nice.
The uniqueidentifier solves this. By "identity pk" in my original Q I really
meant non-natural pk, either identity or guid or just an int, which I know I
should have stated :-)
> 2. It is difficult if not impossible to share your keys with third
> parties. If you need to allow third-parties to generate keys (e.g.
> shipping numbers), then Identity columns are out of the question. They
> absolutely will need the ability to generate a unique key on their side
> that will be unique on your side. This is situation where a check digit of
> some sort is truly necessary. However, most systems do not have this
> requirement. If it is never expected for this situation to arise, then
> this shouldn't be a consideration. Not every system has to be designed to
> meet DOD standards.
In that case I would drop the identity but keep it as an int.
> 3. Replication is more difficult. If you have multiple sites with
> databases that contain Identity columns, it is much more difficult to set
> it up in such a way as to not get conflicts between the two sites. It is
> still doable, but more problematic. In addition, the more sites you add,
> the more difficult it is.
Can you still replicated on your unique index?
> 4. It is more difficult to port to a system that does not contain Identity
> columns. This one is a pipe dream IMO. Part of the cost of porting to
> another system would be the creation of a new key generation mechanism to
> take the place of the identity column. Further, it is likely that there
> are far more issues that will need to be resolved than handling identity
> column.
True.
> That said, when using Identity columns, I will make an effort to include
> at least one unique index on the attributes other than the PK. The
> advantage of this approach is that you can change and/or add unique keys
> far easier than changing the makeup of the PK itself.
I agree with that, you should still have something unique that identifies
each records.
Michael|||> Users wouldn't see this though as you could make the save into a single
> operation.
Using stored procedures makes this a snap, or it would be easy in the
dynamic SQL generation to use the data entered as the key to retrieve the
row:
insert into table (col1, col2) values (1,2)
select pkValue from table where col1 = 1 --assuming it is the natural key.
> The uniqueidentifier solves this. By "identity pk" in my original Q I
> really meant non-natural pk, either identity or guid or just an int, which
> I know I should have stated :-)
The problem is that it is so darn big. I mean it will take four times as
much space as an integer! Meaning four times as many pages in your index,
and even worse if you use it in your clustered index. Why is it so hard to
just get the value back after you create the new row? It is easy to do
using the natural key of the row you have created, or scope_identity() (of
course this is assuming you are using a surrogate)
Here you are really mixing paradigms. The identity value should not be the
key you share. The key you share would be the third-party key. It gives
you a lot of freedom to modify the value later without shifting around
structures in your database, or even to have more than one third party
reference to the same row. Identities or any surrogate key with no
check-digit or something(as you continue on to discuss) generally make lousy
keys. because they are kind of plain, and too easy to mistake. It is best
when you can type in a value 00003002 not to be able to fat finger it and
type 00003001 and get an actual value that works. Not impossible to stumble
upon a value, but unlikely.
I think that either type of key works just fine, but I like identies for the
flexibility of building the natural keys, as well as the ability to have a
common pattern of development (all primary keys int, all primary keys
singular, etc.) I don't think this is a requirement for a good design, not
at all. But it is a good design and works great.
> I agree with that, you should still have something unique that identifies
> each records.
>
Unless there is a compelling reason not to, you should ALWAYS do this! This
is what really kills so many databases that use identity keys. Hopefully I
am preaching to the choir, but it bears repeating that a surrogate key must
be a surrogate for something.
There are cases where you can't come up with a unique key, but they are very
few and far between. The best example I have is logging operations that
occur closer together than .003 seconds (the grain of the datetime.)
----
Louis Davidson - http://spaces.msn.com/members/drsql/
SQL Server MVP
"Michael C" <mculley@.NOSPAMoptushome.com.au> wrote in message
news:%23SVYvUlYFHA.2756@.tk2msftngp13.phx.gbl...
> "Thomas Coleman" <replyingroup@.anywhere.com> wrote in message
> news:ungSrBlYFHA.584@.TK2MSFTNGP15.phx.gbl...
> Users wouldn't see this though as you could make the save into a single
> operation.
>
> The uniqueidentifier solves this. By "identity pk" in my original Q I
> really meant non-natural pk, either identity or guid or just an int, which
> I know I should have stated :-)
> In that case I would drop the identity but keep it as an int.
>
> Can you still replicated on your unique index?
>
> True.
>
> I agree with that, you should still have something unique that identifies
> each records.
> Michael
>|||>> Users wouldn't see this though as you could make the save into a single
> Using stored procedures makes this a snap, or it would be easy in the dyna
mic
> SQL generation to use the data entered as the key to retrieve the row:
> insert into table (col1, col2) values (1,2)
> select pkValue from table where col1 = 1 --assuming it is the natural key.
Granted. Didn't say it wasn't possible; just more of a pain. It's more of a
pain
with the parent-child scenario like a invoice and invoice items. You have to
save the invoice, retrieve the new key and then save the invoice items. Not
a
big deal and I have used stored procs to solve this problem easily. Just mor
e of
a pain.
<snip>
> Why is it so hard to just get the value back after you create the new row?
It
> is easy to do using the natural key of the row you have created, or
> scope_identity() (of course this is assuming you are using a surrogate)
It isn't *so* hard per se. Just more of a pain. Like I said, if you have a l
ong
inheritance chain (parent-child-child...), it makes it more of a pain. Not
impossible to overcome. Just more problematic.
> Here you are really mixing paradigms. The identity value should not be th
e
> key you share.
<snip>
Exactly. The identity value in and of itself cannot be shared to a third par
ty.
Another unique key must be derived that is given to the third party (as you
said) that contains check digits and such. I have used this exact schema in
situations where a bar code with a check digit was necessary. A new key was
derived *once it was realized* that it would be needed. The bar coded value
was
merely one more way to identify the entity.
<snip>
> Unless there is a compelling reason not to, you should ALWAYS do this! Th
is
> is what really kills so many databases that use identity keys. Hopefully
I am
> preaching to the choir, but it bears repeating that a surrogate key must b
e a
> surrogate for something.
> There are cases where you can't come up with a unique key, but they are ve
ry
> few and far between. The best example I have is logging operations that o
ccur
> closer together than .003 seconds (the grain of the datetime.)
Agreed or that the exact make up the unique key is not known at initial desi
gn.
The lesson here is to strive to be the most restrictive in your design. Try
to
apply unique indexes initially. Try to make columns non-nullable. Add check
constraints etc. By abstracting the key away from the data, you make it poss
ible
to remove these restrictions later or even add new ones.
Remember, that the original poster asked what *potential* downsides are ther
e to
an identity. They do exist. As with all design decisions, their use must be
evaluated using more criteria than just "Codd says don't use them!".
Thomas|||> Remember, that the original poster asked what *potential* downsides are
> there to an identity. They do exist. As with all design decisions, their
> use must be evaluated using more criteria than just "Codd says don't use
> them!".
True enough, I was just opining back because I just felt the rush of the
"don't let the db server do anything" mentality that seems to be so popular
these days (and often ruining good data everywhere when not done by
extremely professional people, due to the multitude of tools that let you
subtrovert the rules of the database if they are not implemented for every
modification, not just those going through an exterior layer.
----
Louis Davidson - http://spaces.msn.com/members/drsql/
SQL Server MVP
"Thomas Coleman" <thomas@.newsgroup.nospam> wrote in message
news:%23Hp5tDnYFHA.3272@.TK2MSFTNGP14.phx.gbl...
> Granted. Didn't say it wasn't possible; just more of a pain. It's more of
> a pain with the parent-child scenario like a invoice and invoice items.
> You have to save the invoice, retrieve the new key and then save the
> invoice items. Not a big deal and I have used stored procs to solve this
> problem easily. Just more of a pain.
> <snip>
> It isn't *so* hard per se. Just more of a pain. Like I said, if you have a
> long inheritance chain (parent-child-child...), it makes it more of a
> pain. Not impossible to overcome. Just more problematic.
>
> <snip>
> Exactly. The identity value in and of itself cannot be shared to a third
> party. Another unique key must be derived that is given to the third party
> (as you said) that contains check digits and such. I have used this exact
> schema in situations where a bar code with a check digit was necessary. A
> new key was derived *once it was realized* that it would be needed. The
> bar coded value was merely one more way to identify the entity.
> <snip>
>
> Agreed or that the exact make up the unique key is not known at initial
> design. The lesson here is to strive to be the most restrictive in your
> design. Try to apply unique indexes initially. Try to make columns
> non-nullable. Add check constraints etc. By abstracting the key away from
> the data, you make it possible to remove these restrictions later or even
> add new ones.
> Remember, that the original poster asked what *potential* downsides are
> there to an identity. They do exist. As with all design decisions, their
> use must be evaluated using more criteria than just "Codd says don't use
> them!".
>
> Thomas
>|||Michael,
First, I can think of three good uses for IDENTITY columns:
1) Provide a search key for full-text search
2) Small applications that very well could be done in Access
3) Non "database" usage -- logging tables, error tables, etc.
The single largest reason not to use an IDENTITY, GUID, or any other
meaningless key is that they become POINTERs to data. There are inherent
problems with pointer-based data models that the relational data model set
out to solve. If you ever research implementation of Heirarchical (IMS) or
Network (CODASYL) models (which both are pointer-based), you'll see why this
is so problematic.
The whole point of the relational model is that data inherently relate to
eachother and need no pointers to tie them together. When you have
Order_Nums, Part_Nums, Codes, etc, you don't need a pointer -- you already
have something that uniquely identifies the entity.
Just like any improvement in technology, you can choose to ignore it and go
with how they used to do it. They built houses just fine in the 40's with
knob & tube wiring, and if you built a house today with it, I'm sure it woul
d
work ok. But professionals build houses with Romex and grounding because
those improvements solved a helluva lot of problems that N&T have. Your new
N&T house would probably start to have issues if you try to draw too many
amps and will become a safety hazard after a few decades.
As such, if you choose to go with pointer-based data model, it will face the
same problems that other pointer-based models have. And it will fall apart.
Alex Papadimoulis
http://weblogs.asp.net/Alex_Papadimoulis
"Michael C" wrote:
> I was working on a program recently that had a bit field called 'completed
'
> which recorded when a certain event was complete. I was removing this fiel
d
> because it was possible to tell that the event was complete through other
> means so the field was a duplication and a violation of good data design.
> The end result was that it was possible for something in the program to sh
ow
> as completed when in fact it wasn't. I thought this was a really good
> example of how bad data design effects the end user.
> When using Identity columns as the primary key some here think it is bad
> design but I've never seen anyone quote an actual di
vantage for the end> user, all the "di
vantages" seem to be quite abstract and far removed from
> the real world. In fact all I can see is advantages for the end user. Can
> anyone come up with an actual real word di
vantage for an identity column
> pk?
>
>|||> [...] Just more of a pain.
> It isn't *so* hard per se. Just more of a pain. Like I said, if you have a
long
> inheritance chain (parent-child-child...), it makes it more of a pain.
The right way is usually the harder way. I have yet to find anything where
this is not true -- shortcuts create problems in everything.
I don't quite understand the lazy programmer. I can understand a lazy
carpenter -- lifting wood, sawing, etc is, quite literally, hard work. But
with a programmer, we're talking keystrokes and a few mouse clicks. What
exactly are we avoiding here?
Alex Papadimoulis
http://weblogs.asp.net/Alex_Papadimoulis
Friday, March 9, 2012
Problems with Enterprise Manager/MSDE
ry to register the database with Enterprise Manager, Enterprise Manager doesn't see the instance. Similarly, my program that uses SQLDMO.DLL to enumerate all servers does not see the MSDE instance. Both the database, my program, and Enterprise Manager are
running locally on the same machine.
This is a development box, and I have had to uninstall MSDE by hand several times by removing registry keys manually. I suspect that my problem is that I have deleted a key that I needed. Does anyone have any clues? Thanks in advance.
Rob Reagan
By default MSDE only uses Shared Memory for communicating with client
applications. Make sure that when you install MSDE that you use the command
line switch DISABLENETWORKPROTOCOLS=0.
Jim
"Rob Reagan" <RobReagan@.discussions.microsoft.com> wrote in message
news:94D3760F-80D4-41DB-97A0-320506FE04AA@.microsoft.com...
> I have installed an MSDE instance on my PC. I have used both the setup.exe
program and installed MSDE with the merge modules. Everything works fine - I
am able to programmatically connect to the database and execute all of my
statements. However, when I try to register the database with Enterprise
Manager, Enterprise Manager doesn't see the instance. Similarly, my program
that uses SQLDMO.DLL to enumerate all servers does not see the MSDE
instance. Both the database, my program, and Enterprise Manager are running
locally on the same machine.
> This is a development box, and I have had to uninstall MSDE by hand
several times by removing registry keys manually. I suspect that my problem
is that I have deleted a key that I needed. Does anyone have any clues?
Thanks in advance.
> Rob Reagan
|||Can one re-enable NETWORK connections without an uninstall/re-install ?
Pete
"Jim Young" <thorium48@.hotmail.com> wrote in message
news:uLzTSNzVEHA.208@.TK2MSFTNGP10.phx.gbl...
> By default MSDE only uses Shared Memory for communicating with client
> applications. Make sure that when you install MSDE that you use the
command[vbcol=seagreen]
> line switch DISABLENETWORKPROTOCOLS=0.
> Jim
> "Rob Reagan" <RobReagan@.discussions.microsoft.com> wrote in message
> news:94D3760F-80D4-41DB-97A0-320506FE04AA@.microsoft.com...
setup.exe
> program and installed MSDE with the merge modules. Everything works fine -
I
> am able to programmatically connect to the database and execute all of my
> statements. However, when I try to register the database with Enterprise
> Manager, Enterprise Manager doesn't see the instance. Similarly, my
program
> that uses SQLDMO.DLL to enumerate all servers does not see the MSDE
> instance. Both the database, my program, and Enterprise Manager are
running
> locally on the same machine.
> several times by removing registry keys manually. I suspect that my
problem
> is that I have deleted a key that I needed. Does anyone have any clues?
> Thanks in advance.
>
|||hi Pete,
"Pete" <p0911@.hotmail.com> ha scritto nel messaggio
news:%23zmObU4VEHA.584@.TK2MSFTNGP09.phx.gbl...
> Can one re-enable NETWORK connections without an uninstall/re-install ?
>
execute Server Network Utiliy (svrnetcn.exe) and enable the desired network
protocol(s)
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.8.0 - DbaMgr ver 0.54.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
|||Thank you Andrea - will give it a whirl
"Andrea Montanari" <andrea.sqlDMO@.virgilio.it> wrote in message
news:2jo0brF139hlfU1@.uni-berlin.de...[vbcol=seagreen]
> hi Pete,
> "Pete" <p0911@.hotmail.com> ha scritto nel messaggio
> news:%23zmObU4VEHA.584@.TK2MSFTNGP09.phx.gbl...
?
> execute Server Network Utiliy (svrnetcn.exe) and enable the desired
network
> protocol(s)
> --
> Andrea Montanari (Microsoft MVP - SQL Server)
> http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
> DbaMgr2k ver 0.8.0 - DbaMgr ver 0.54.0
> (my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
> interface)
> -- remove DMO to reply
>
|||Brilliant - comes up like a dream and all protocols are listed - thank you
once again Andrea
"Andrea Montanari" <andrea.sqlDMO@.virgilio.it> wrote in message
news:2jo0brF139hlfU1@.uni-berlin.de...[vbcol=seagreen]
> hi Pete,
> "Pete" <p0911@.hotmail.com> ha scritto nel messaggio
> news:%23zmObU4VEHA.584@.TK2MSFTNGP09.phx.gbl...
?
> execute Server Network Utiliy (svrnetcn.exe) and enable the desired
network
> protocol(s)
> --
> Andrea Montanari (Microsoft MVP - SQL Server)
> http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
> DbaMgr2k ver 0.8.0 - DbaMgr ver 0.54.0
> (my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
> interface)
> -- remove DMO to reply
>
|||Andrea,
I believe that I am using SQL Server 2000 Personal edition. When I try to run the Server Network Utility from either the programs menu or from the command line, nothing happens. Is this included with Sql Server Personal edition?
When I look at the Client Network Utility, both TCP/IP and Named Pipes are enabled. Since this was working before and I have screwed with the registry by hand, I tend to think that the problem is that I deleted some needed key. Any suggestions on how to t
roubleshoot this problem?
Rob Reagan
"Andrea Montanari" wrote:
> hi Pete,
> "Pete" <p0911@.hotmail.com> ha scritto nel messaggio
> news:%23zmObU4VEHA.584@.TK2MSFTNGP09.phx.gbl...
> execute Server Network Utiliy (svrnetcn.exe) and enable the desired network
> protocol(s)
> --
> Andrea Montanari (Microsoft MVP - SQL Server)
> http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
> DbaMgr2k ver 0.8.0 - DbaMgr ver 0.54.0
> (my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
> interface)
> -- remove DMO to reply
>
|||hi Rob,
"Rob Reagan" <RobReagan@.discussions.microsoft.com> ha scritto nel messaggio
news:C8C04B22-74FB-464E-8ECF-36F594E34E86@.microsoft.com...
> Andrea,
> I believe that I am using SQL Server 2000 Personal edition. When I try to
run the Server
>Network Utility from either the programs menu or from the command line,
nothing happens.
>Is this included with Sql Server Personal edition?
yep, the Server Network Utility is installed with every server installation,
MSDE or SQL Server, while Client Network utility is installed with client
component and/or MDAC..
> When I look at the Client Network Utility, both TCP/IP and Named Pipes are
enabled.
>Since this was working before and I have screwed with the registry by hand,
I tend to
>think that the problem is that I deleted some needed key. Any suggestions
on how to
>troubleshoot this problem?
=;-D
unfortunately I can't help your (damaged) registry :-(
try installing another SQL Server/MSDE instance (and then removing it), that
coul'd resolve your registry issues..
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.8.0 - DbaMgr ver 0.54.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
Wednesday, March 7, 2012
Problems with C# Sample to Print Reports
Bryan Keller. (http://www.csharphelp.com/archives3/archive545.html)
The DefaultCredentials from the CredentialCache certainly has no data, and I
don't seem to be able to get valid data into the cache
Not sure about the relative path of the report either. I am running against
my own report, since I don't have the samples installed. I am using:
/Report Project1/118-2 as a path.
Don't know if that is correct, but that is what I see when I run it in the
browser. Except the '/' char turns into %2F, and the space into a '+'.
So it's %2FReport+Project1%2F118-2 in the browser.
Has anybody else tried this sample program with their own reports?
GerhardThe path of a report is relative to the root on the Report
Server.
So in the Report Manager if you see your report , lets say
report1 under the folder Report Project1 then the path of
your report is Report Project1/report1.
>--Original Message--
>I am having permission problems with the sample report
printing program from
>Bryan Keller.
(http://www.csharphelp.com/archives3/archive545.html)
>The DefaultCredentials from the CredentialCache certainly
has no data, and I
>don't seem to be able to get valid data into the cache
>Not sure about the relative path of the report either. I
am running against
>my own report, since I don't have the samples installed.
I am using:
>/Report Project1/118-2 as a path.
>Don't know if that is correct, but that is what I see
when I run it in the
>browser. Except the '/' char turns into %2F, and the
space into a '+'.
>So it's %2FReport+Project1%2F118-2 in the browser.
>Has anybody else tried this sample program with their own
reports?
>Gerhard
>
>.
>|||Ok, thanks, Ravi, that makes sense.
What about the DefaultCredentials? There are null strings for user/pw and
domain right now.
How do I get my domain credentials into the cache?
Gerhard
"Ravi" <anonymous@.discussions.microsoft.com> wrote in message
news:253e01c48e1e$c8cae640$a601280a@.phx.gbl...
> The path of a report is relative to the root on the Report
> Server.
> So in the Report Manager if you see your report , lets say
> report1 under the folder Report Project1 then the path of
> your report is Report Project1/report1.
> >--Original Message--
> >I am having permission problems with the sample report
> printing program from
> >Bryan Keller.
> (http://www.csharphelp.com/archives3/archive545.html)
> >
> >The DefaultCredentials from the CredentialCache certainly
> has no data, and I
> >don't seem to be able to get valid data into the cache
> >
> >Not sure about the relative path of the report either. I
> am running against
> >my own report, since I don't have the samples installed.
> I am using:
> >/Report Project1/118-2 as a path.
> >Don't know if that is correct, but that is what I see
> when I run it in the
> >browser. Except the '/' char turns into %2F, and the
> space into a '+'.
> >So it's %2FReport+Project1%2F118-2 in the browser.
> >
> >Has anybody else tried this sample program with their own
> reports?
> >
> >Gerhard
> >
> >
> >.
> >|||Ok, got the path and credentials problem solved. I can elaborated if it
will help others.
Path is: /folder/report
Credentials is: rs.Credentials = new
NetworkCredential("user","pw","domain")
DefaultCredentials may work if you're on a Lan, I'm on a VPN.
But now the question is: How do I pass parameters, as part of the URL? And
syntax?
Yeah I know, I'm a pain. <g> Sorry, this is all hitting me a little fast
too.
Gerhard
"Ravi" <anonymous@.discussions.microsoft.com> wrote in message
news:253e01c48e1e$c8cae640$a601280a@.phx.gbl...
> The path of a report is relative to the root on the Report
> Server.
> So in the Report Manager if you see your report , lets say
> report1 under the folder Report Project1 then the path of
> your report is Report Project1/report1.
> >--Original Message--
> >I am having permission problems with the sample report
> printing program from
> >Bryan Keller.
> (http://www.csharphelp.com/archives3/archive545.html)
> >
> >The DefaultCredentials from the CredentialCache certainly
> has no data, and I
> >don't seem to be able to get valid data into the cache
> >
> >Not sure about the relative path of the report either. I
> am running against
> >my own report, since I don't have the samples installed.
> I am using:
> >/Report Project1/118-2 as a path.
> >Don't know if that is correct, but that is what I see
> when I run it in the
> >browser. Except the '/' char turns into %2F, and the
> space into a '+'.
> >So it's %2FReport+Project1%2F118-2 in the browser.
> >
> >Has anybody else tried this sample program with their own
> reports?
> >
> >Gerhard
> >
> >
> >.
> >|||> Has anybody else tried this sample program with their own reports?
After making modifications for credencials I have used this code
successfully. Thursday I will try running it as a assembly from a web
page - we shall see. Looks good.
dlr
"Gerhard Paulman" <gerhardp@.inch.com> wrote in message
news:%23M$IbFejEHA.3428@.TK2MSFTNGP11.phx.gbl...
> I am having permission problems with the sample report printing program
from
> Bryan Keller. (http://www.csharphelp.com/archives3/archive545.html)
> The DefaultCredentials from the CredentialCache certainly has no data, and
I
> don't seem to be able to get valid data into the cache
> Not sure about the relative path of the report either. I am running
against
> my own report, since I don't have the samples installed. I am using:
> /Report Project1/118-2 as a path.
> Don't know if that is correct, but that is what I see when I run it in the
> browser. Except the '/' char turns into %2F, and the space into a '+'.
> So it's %2FReport+Project1%2F118-2 in the browser.
> Has anybody else tried this sample program with their own reports?
> Gerhard
>
Saturday, February 25, 2012
Problems with myconnection.Open()
An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in system.data.dll
Additional information: System error.
What is this?
I aquired SQL server 2000 and installed it on my machine
I thought the problem was with the line when setting up the connection as there wasnt previously a SQL server running on machine.
Dim myconnection As SqlConnection = New SqlConnection("server=(local);database=pubs;uid=;pwd=")
Does anyone know how to fix this problem?At first guess, I'd say that it was because you have no loginid or password specified, but I could be confused!
I'm really surprised that Tony hasn't moved this off to the VB area. He generally tries to keep this area tightly focused on SQL only.
-PatP