sql-server-2000

How to get only one set of data from my Stored Procedure?

I'm using SQL Server 2000. My SP produces the follwing output: It sums up all Taxable Earnings (top result) and subtract it by the sum of Deductible Expenses (middle result) to get the Net Taxable Income of an employee. How will I get the value of Net Taxable Income only? Here's my SP /* DECLARE @NET_TAXABLE_INCOME AS NUMERIC(19...

Connect SQL Server from Android based mobile

Hello, I plan to develop database application in a Android mobile ? Is that possible to connect a SQL Server 2000 from an Android mobile, that I could add / delete / edit records from that mobile ? ...

sql server 2000 using hint in view

CREATE VIEW xxxx AS SELECT order_date, DATEPART(W, order_date) AS dayID, Type FROM dbo.Shipment_Dates WHERE (TIP = 'normal') OPTION (FAST 20) This create statment causes error at hint part .. Is there a workaround for adding hint to views? ...

SQL Server 2000 Enterprise Manager - Store nvarchar data greater than 4000 characters?

I'm using SQL Server 2000 Enterprise Manager. I'm having trouble with storing some data in a column. The column has a data type of nvarchar, with a length of 4000, which I've now learned is the max length you can have. I need to store data in the column that is longer than 4000 characters...is there a way to increase the size? Or is the...

where like over varchar(500)

I have a query which slows down immensely when i add an addition where part which essentially is just a like lookup on a varchar(500) field where... and (xxxxx.yyyy like '% blahblah %') I've been racking my head but pretty much the query slows down terribly when I add this in. I'm wondering if anyone has suggestions in terms of chan...

Sql Server 2000 openrowset issue.

I’m attempting to query and Excel spread sheet on a network share, using the openrowset function with no success. I get the following error: SELECT * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;DATABASE=\\server\Xdrive:\Spreadsheet.xls', 'Select * from [Sheet1$]') Server: Msg 7399, Level 16, State 1, Line 1 O...

How to determine which databases are being used on SQL Server 2000

I have a SQL Server 2000 box that houses several databases, some of which are probably no longer in use. I'd like to clean things up by first taking them offline, and then later removing them all together. The problem is that I don't know how to tell which of these are still being actively used (outside sources may or may not be connec...

Password migration SQL Server 2000 to SQL Server 2008?

I have customer registration table in SQL Server 2000, in this table have password column which is encrypted ... now I want to migrate that table to SQL Server 2008 Plz help me .... ...

How do I select a 1 as a bit in a sql-server view?

I want to create a view in which I select something like the following: select id, name, 1 as active from users However, I want the active field, which I am creating in the select statement (it doesn't exist in the table), to be a bit field. Is there a way to do this? ...

Nested procedures with transactions

Hi! I have the following problem. I have to stored procedures (debug messages double-indended): CREATE PROC innerProc AS BEGIN SELECT 'innerProc 1',@@TRANCOUNT BEGIN TRAN SELECT 'innerProc 2',@@TRANCOUNT ROLLBACK SELECT 'innerProc 3',@@TRANCOUNT END GO ----------------------------------------- CREATE...

Auditing a terribly designed database system in SQL 2000

One of the most important databases that I administer is poorly designed. The program which uses it uses only 1 login which happens to be a System Administrator. Edits and deletes are done in place so change tracking is difficult. Further, it lacks proper auditing functionality so I cannot tell which user edited or deleted a certain re...

How to set the next job run time randomly in SQL Server 2000

Here is the scenario: We have a database in SQL Server 2000. The application that connects to this database randomly times out with different errors. We have run traces, but were not successful in catching the time out issue. Strangely, whenever we run the trace, the app does not time out. The plan is to setup a job to run traces. Cons...

Communicating with Informix from SQL Server

Right... I've got a program I'm doing some maintenance on. Urgh. Even describing it makes me shudder... Right, okay. Every night, a database running on what we think is SQL Server 2000 hooks up to an Informix database and copies it over into SQL Server. The Informix/SQL data is accessed by the program I'm maintaining, which then store...

How to update multiple tables from XML data

I have 6 tables in an SQL Server 2000 database. The XML contains a similar schema. What I want is to update the records in the database and append the new entries. I am a bit new to this. ...

Big parameter list for SQL query

Hello, I have a big list of int parameters for a SQL query: update mytable set col='xyz' where id in (/* thousands of ints */) My problem is that in SQL Server 2000 there are a limit for parameters. I could run this query on an SQL Server 2008 too. What is the better way to do this. Edit: The list of Ids come from a C# program. No...

Database constraint to check against specific constraints dependent on an input value?

I'm running maintenance on a database program with no foreign key constraints, even though it really should have... There is a Logging table which has a ParentID column, and a ParentType column. The entry in the ParentType column determines which table ParentID references. What I'm looking for is for ideas on the best way to add this i...

Referencing external database in a View?

In a project on which I am performing maintenance, I am referencing a database stored on another server. This reference was previously pointing at a database on the same server, but my testbed server isn't large enough to store both databases, so I'm having to refer back to the live database. Anyway, whoever created this application mad...

getting problem in group by clause

hi friends, i want to get the sum of quantity from the below query. how i write the group by clause in below mention query. select top 1 EvrId, TimeStamp, Date, BnhTnkMik1 as Quantity, (select TnkCode from Tanklar where TnkId=BnhTnkId) as Tank, FuelCode, InvoiceNo from Evrak join Hareket on (BnhEvrId=EvrId) join Stoklar on (StokId=Bn...

SQL query problem when upgrading from SQL Server 2000 to SQL Server 2008 R2

Dear all, I am currently upgrading a database server from SQL Server 2000 to SQL Server 2008 R2. One of my queries used to take under a second to run and now takes in excess of 3 minutes (running on faster a faster machine). I think I have located where it is going wrong but not why it is going wrong. Could somebody explain what the ...

Running BCP.exe

Hello, I have a system installation consisting of two servers, an application server and a database server. I need to bulk upload csv files generated at the application CSV files from the application t the database server, so I am simply the bcp.exe application. The database server is SQL server 2000 enterprise edition, the applicati...