sql-server-2000

I am getting a "fatal error 7987" error from SQL Server 2000

The error happens trying to do an insert from a stored proc. I tried running DBCC CHECKDB as suggested by the kb article that Jonathan Holland suggested and it returned with the all clear. ...

Programatically renaming a table in SQL Server 2000 - is sp_rename the only solution?

I recently had to rename a table (and a column and FK/PK contraints) in SQL Server 2000 without losing an data. There did not seem to be an obvious DDL T-SQL statements for performing this action, so I used sp_rename to directly fiddle with object names. Was this the only solution to the problem? (other, than give the table the correct ...

Is there a way to script diagrams in SQL 2000 (or save them another way)?

It's possible to create digrams in SQL Server 2000 that can be useful to show the relationships between tables. The problem we run into is that when somebody refreshes our development database, the diagrams get lost. We can load tables, stored procedures, views, etc. with SQL scripts, but we have to create the diagrams by hand. Is the...

My SQL Server 2000 Transaction Log Size Seems Small

I'm wondering why my transaction log would only be 2 MB on my 40 GB database when I have recovery mode set to full and unlimited file growth set on the transaction log. Any ideas? Edit: I'd say there is probably a few hundred MB inserted every day and a lot of updates going on. It's a database that drives a fairly active website. ...

Is there a "poor man's" alternative to RedGate for scripting out entire database schema?

I'm in a situation where I would to generate a script for a database that I could run on another server and get a database identical to the original one, but without any of the data. In essence, I want to end up with a big create script that captures the database schema. I am working in an environment that has SQL Server 2000 installe...

Cannot open user default database. Login failed. SQL 2005

I have taken a copy of a database home with me so I can do some testing. However when I try to run a stored procedure I get Cannot open user default database. Login failed.. I have checked and checked and checked I can open tables in the databases login to sql management studio and access the default as well as other databases any idea...

Can I create a Database Deadlock test in Nunit?

In this asp.net I'm cleaning up it's possible for deadlocks to occur. I want to make sure that the code deals with them properly, so I'm trying to write NUnit tests which trigger a deadlock..... The DAO is split by entity. Each entity has a set of tests which are surrounded by Startup() and Teardown() methods which create a transactio...

Convert SQL Server Database from 2005 to 2000

We have a Microsoft SQL Server 2005 database that needs to be converted back to SQL Server 2000. Does anybody have any suggestions on the approach or tools I should use to perform this conversion? We don't utilise any SQL Server 2005 specific features in the database so this should not make the conversion problematic. I should mention t...

SQL Server 2000 Live data mirroring

I am currently working with 2 sql 2000 servers one I can query but not add any databases to which lead to the second one having lots of queries that use the first as a linked server. I would like to improve performance while still querying live data. Is it possible to mirror the live data to the second server, that way the queries would...

How to import data from Excel 2007 xlsx file into SQL Server 2000 Database?

SQL Server 2000 doesn't seem to support the xml based .xlsx file types. Besides converting the file to a 97-2003 file type, how else can I achieve this? ...

SQL procedure running time widely divergent

I have an application that runs a huge stored procedure on SQL Server 2000. Usually it takes about 1 minute to complete, but occasionally it will take MUCH longer. Just now I ran it three times in a row in my test system. It took 1:12, 1:23, and 55:25. What would cause that behavior? There are other things going on in the database, so I...

How can I determine the last time any record changed in a specific Sql Server 2000 database?

I have a SQL Server 2000 database instance that is rarely updated. I also have a database table which has no columns holding each row's created date or modified date. Is there any way that I can determine the last time an update or insert was performed on the database as a whole, so that I can at least put a bound on when the specifi...

Sql Server SHRINKDATABASE command

When I shrink a sql server database using the GUI (All Tasks->Shrink Database->Accept all defaults, click OK), it finishes quickly. But if I run this command, it takes a very very long time. DBCC SHRINKDATABASE('my_database') What am I missing? This is in SQL Server 2000. ...

SQL DTS Database Copy Fails

Hey All, I have been working on this problem for a while and the usual google searches are not helping :( I have a production database in SQL 2000. I want to copy it over the top of a training database to refresh it. I want this to be something that is scheduled to happen once a week to keep the training database up-to-date. I have a D...

How do I group by date in Crystal Reports 8.0?

I have a Crystal Report that looks like: Date | Person | Ticket | Summary Date | Person | Ticket | Summary Date | Person | Ticket | Summary I would like it to look like: Date Person | Ticket | Summary Person | Ticket | Summary Date Person | Ticket | Summary All values are pulled from a MS SQL 2000 database, the application t...

MSSQL2000: get list of role members

I know a role name and want to find all users in this role. How do I acheive this in SQL Server 2000 (in the SQL script, not in Management Studio or other tool)? ...

How to update a text or ntext field in SQL Server 2000

So I need to update a text field. Neither the UPDATE statement or the WRITETEXT statement work when used below CREATE TABLE MyTable (IDField int, MyField text) INSERT INTO MyTable (IDField) SELECT 1 DECLARE @Data1 varchar(8000), @Data2 varchar(8000), @ptrval binary(16) SELECT @Data1 = REPLICATE('1',8000) SELECT @Data2 = REPLICATE('2'...

Why does the Store Procedure I'm calling over ODBC fail at the same location?

I'm using the freeodbc++ library to access data on a MS SQL Server 2000 database (SP3? SP4?). In particular, I'm running a particularly long and nasty stored procedure. I can watch the procedure execute in SQL Profiler, however, it tends to stop processing at a certain point. No error codes or exceptions thrown. If I comment out the ...

How would views & procs referencing another db cause log to grow?

Hi, I've got 2 databases on one server; let’s call them db A and B. Database A is about 11 GB, database B is very small (155mb). Database B has some views and procs which are constantly accessing and updating data in database A. The interesting thing is, the log for database B quickly grows to huge sizes, I think it grew to about 12 ...

How to query an Oracle table from SQL Server 2000?

A colleague would like to query a table in an Oracle database using SQL Server 2000, Enterprise Manager. He knows how to do the whole DTS thing, but doesn't want to go down that route for add hoc queries. Is there another way? ...