sql-server-2000

Problem with MS DTC on SQL2008 win server 2k8 with linked server from sql2000 win server 2k

Hi, We have migrated our db from sql2000 win server 2k to sql2008 win server 2k8. We have linked server from sql2000 win server 2k. By our opinion the problem is with DTC and we have made a lot of setting that we found as solution for our problem, but still the problem exist. There is no any error or worning or information niether in th...

Connecting to SQL Server 2000 through TCP/IP on localhost failed.

I have tried to connect to SQL Server 2000 through TCP/IP. I followed these steps and enabled SQL Server 2000 on port 1433. Then I used the command to test whether the port is opened up: telnet localhost 1433 But I found the following error: Connecting To localhost...Could not open connection to the host, on port 1433: Connect fa...

select a single distinct column in a table while others remain as it is

hi i have the following table P_id Fname Lname 1 vaibhav shukla 2 davalesh barak 2 sumo barath 3 kushal mehra now i want a query which returns any of the following table P_id Fname Lname 1 vaibhav shukla 2 davalesh barak 3 kushal mehra OR P_id F...

Concatenating Row Values

Hi, I was using Microsoft SQL server 2005 and was able to concatenate row values based on the following query: SELECT e1.EMP_ID, ( SELECT cast(Sector_ID as varchar(10)) + ';' FROM Employee_Sector_relationship e2 WHERE e2.Emp_ID = e1.Emp_ID ORDER BY Sector_ID FOR XML PATH('') ) AS Sectors FROM Employee_Sector_Relationship e1 GROUP BY Emp...

Migrating a database from SQL Server 2000 to SQL Server 2005

What technical issues am I likely to encounter when migrating a database from SQL Server 2000 to SQL Server 2005? Are there any common problems I should be aware of? Should i be worried about any T-SQL changes that may break when stored procs are executed against the newer version of the database? What about DTS packages? Are there any...

Average wait time performance counter - SQL2000 vs. SQL2005

The Locks performance object on SQL Server provides three counters that I'm interested in. X = Average Wait Time (ms) Y = Lock Wait Time (ms) Z = Lock Waits/sec From their descriptions I'd have imagined that X = Y / Z. However, while this is true for SQL2005, it does not seem to be true for SQL2000. I have some code that forces a dea...

DBCC SQL Server 2000 sysindexkeys

I have a SQL Server 2000 database. When I run the following command select * from sysindexkeys This display the appropriate records. I then do a DBCC command for the sysindexkeys. It doesn't display anything. Strange there is no page having the sysindexkeys records. Then how the query display the list of records. ...

SQL Server 2000 Table Optimization

Hi, Ive been working all day on optimizing a SQL Server 2000 db table with ~9million rows. My only db experience has been with tables with a few hundred rows, so I've never really had to deal with optimization. I am doing selects and updates based on a 21 digit number. Using an indexed char(21) type, the queries take more then 2 secon...

Max size varchar(max) in SQL Server 2000

Hi all expert, I would like to know what is the maximum size of varchar in SQL Server 2000. While I was googling somewhere its written 8000 characters and somewhere its written 8060 bytes. which one is correct??? Pls confirm me.. Thanks, Kumar ...

Automatic Insertion of Data

I have a table name Overtime Hours which have the following columns Ot_ID, Shift_Date, Employee_ID, Hours. What I need to do is insert a set of values in these tables on the 1st date of every month, automatically. for example, I need to add values('1/1/2010',12345,4.6) for january, values('2/1/2010',12345,4.6) for february and so on fo...

SQL2000 safely cast a VARCHAR(256) to INT

I'm having some problem safely casting a varchar to int on SQL2000. Part 1 of my problem was that IsNumeric returns false positives if your looking for integers only. I'm aware though why IsNumeric does this though (floats, money etcetera are numeric too) so i looked for an IsInteger function on google. I found the following User Defi...

How are logical reads calculated ?

I've read the definition of logical reads from: http://msdn.microsoft.com/en-us/library/ms184361.aspx it says: "Number of pages read from the data cache." I have two tables (Row count of table_1 is 141, and table_2 is 16.811), when I run those two queries, it gives the following result. SELECT * FROM Table_1 results Scan count 1, ...

SQL server timeout 2000 from C# .NET

I have run into a strange problem using SQL Server 2000 and two linked server. For two years now our solution has run without a hitch, but suddenly yesterday a query synchronizing data from one of the databases to the other started timing out. I connect to a server in the production network, which is linked to a server containing order...

Stored Procedure vs User Defined Function for Error Handling

My ERP database uses non-nullable datetime fields. However, it enters '' for the datetime when one isn't available and returns ‘1900-01-01 00: 00: 00.000’ as the value. I want to suppress the 1900 dates while stripping the Date only from the Datetime field. I created the following UDF to do that: CREATE FUNCTION ExtractDate(@DirtyDat...

SQL Server: How to use Cursor to delete records

Hi guys: We want to remove tons of obsolete data in a table, but this will lock table for a long while. Is is possible to use Cursor to delete, says, one hundred records per transaction in a while-loop ? And where can I refer to the example? ...

How to run stored procedures and ad-hoc scripts asynchronously with "loosely" connected SQL Server 2000 instances.

Is there a way to initiate a script against an instance of SQL server when it is not connected then have it run on the instance the next time it connects? This needs to happen without any intervention from me. Background situation if you are interested: We have about 120 machines each with their own instance of SQL Server 2000. Most ...

SQL Server 2000 write problem

When I am trying to write in a table after running Database Maintenance plan (SQL Server 2000 SP4) I cannot write it and getting the exception as below. Could not complete cursor operation because the table schema changed after the cursor was declared. What is this error? How to solve this? Thanks. ...

Performant way to get the maximum value of a running total in TSQL

We have a table of transactions which is structured like the following : TranxID int (PK and Identity field) ItemID int TranxDate datetime TranxAmt money TranxAmt can be positive or negative, so the running total of this field (for any ItemID) will go up and down as time goes by. Getting the current total is obviously simple...

replace ntext (more than 4000 characters) in sql server 2000

How to replace text in sql server 2000 in a ntext column with more than 4000 characters? conversion to nvarchar(max) does not work as it truncates values. ...

Null value being returned from a Stored Procedure using Linq to SQL

If I run a stored procedure in my database (SQL 2000) and return the SCOPE_IDENTITY, I receive a value. However, using LINQ to SQL, I get a null value for the Column1 property. Anyone have a suggestion? ...