sql-server-2000

SQL Server 2000 Live data mirroring

孤者浪人 提交于 2019-12-11 02:22:46
问题 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 be local to that server? What are my options? If an upgrade from sql 2000 is needed that is a possibility. The data has low update, insert, delete use and

Query works in SQL Server 2005 but syntax error for SQL Server 2000

送分小仙女□ 提交于 2019-12-11 01:24:48
问题 I am trying to execute this query but getting syntax error when it perfectly fines with SQL server 2005 and table is already there and am trying to create new table on a different server, USE [myDataBase] GO CREATE TABLE [dbo].[myTable] ( [ID] [int] IDENTITY(1,1) NOT NULL, [Tittle] [varchar](1024) NOT NULL, [Description] [varchar](8000) NOT NULL, [Table2ID] [int] NOT NULL, [Table3ID] [int] NOT NULL, CONSTRAINT [PK_myTable] PRIMARY KEY CLUSTERED ( [ID] ASC ) WITH (PAD_INDEX = OFF, STATISTICS

SQL Server Error: “maximum number of prefixes. The maximum is 3” with subselect syntax

冷暖自知 提交于 2019-12-11 01:09:24
问题 Trying to run a cross-server update: UPDATE asilive.Contoso.dbo.lsipos SET PostHistorySequencenNmber = ( SELECT TransactionNumber FROM Transactions WHERE Transactions.TransactionDate = asilive.CMSFintrac.dbo.lsipos.TransactionDate) Gives the error: Server: Msg 117, Level 15, State 2, Line 5 The number name 'asilive.Contoso.dbo.lsipos' contains more than the maximum number of prefixes. The maximum is 3. What gives? Note: Rearranging the query into a less readable join form: UPDATE asilive

Update statement error: Subquery returned more than 1 value

心不动则不痛 提交于 2019-12-11 01:09:02
问题 I am trying to update all records in a column so that they start with 'CD' e.g. DCE206 would become CDE206. UPDATE table SET column = REPLACE(column1, 'DC', 'CD') WHERE column1 LIKE 'DC%' I am using the above update statement however the following error appears 'Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.' Is there anything I can change in the statement to make this happen or do I need

sql server + vb 6.0

孤街浪徒 提交于 2019-12-10 22:35:41
问题 I have created one database project in vb 6.0. I have created my database in sql server 2000. I am using adodc and odbc to connect to database. I want to keep my sql server in one system and my vb 6.0 application in another system and I want to access sql database from network. Please help me. Thank you. 回答1: This is how many client applications are written: A VB6 program running on a desktop system, and the SQL Server running on another system, usually on a Windows Server OS. As long as you

Eliminating ROW_NUMBER() for SQL 2000

霸气de小男生 提交于 2019-12-10 22:21:38
问题 I have to migrate a sql to work on Microsoft SQL Server 2000. Unfortunately the current sql uses the function ROW_NUMBER() which is not yet supported in this version. Therefore I have to find something similar. Below my SQL (I used * instead of listing all columns) SELECT [Id], ROW_NUMBER() OVER (ORDER BY InstallmentNumber, ID ASC) AS ROWID FROM [ARAS].[ARAS].[Movement] 回答1: Using a temp table with an identity column to simulate the ROW_NUMBER may be your best bet performance wise: CREATE

Exposing SQL Server 2000 to the Internet safely

旧街凉风 提交于 2019-12-10 21:22:25
问题 I've got a SQL Server 2000 box that I'd like to put on "the Internet" so that developers could connect remotely without VPN access. What's the safest way to do so? It might be temporary, e.g. every once in a while, but it's definitely necessary. Thanks, Rob 回答1: Short answer - don't do this. Long answer: Install good firewall on the box. Install and run ssh server on it. Open only the ssh port. Your devs can use PuTTY or any other ssh client to "tunnel" the sql port over the ssh connection.

Order by Field in non-alphabetical order in SQL Server 2000

梦想与她 提交于 2019-12-10 20:43:27
问题 I'm trying to order items by a list of names that are not in alphabetical order. After completing the list I am trying to continue the rest in alphabetical order without the ones I initially selected. See example: INPUT: print 'Results:' select * from Geniuses order by ('Charles Babbage', 'Albert Einstein', 'Adrien-Marie Legendre', 'Niels Henrik Abel') then finally sort the rest in alphabetical order... OUTPUT: Results: Charles Babbage ... details Albert Einstein ... Adrien-Marie Legendre ...

Problem convert column values from VARCHAR(n) to DECIMAL

徘徊边缘 提交于 2019-12-10 20:19:11
问题 I have a SQL Server 2000 database with a column of type VARCHAR(255). All the data is either NULL, or numeric data with up to two points of precision (e.g. '11.85'). I tried to run the following T-SQL query but received the error 'Error converting data type varchar to numeric' SELECT CAST([MyColumn] AS DECIMAL) FROM [MyTable]; I tried a more specific cast, which also failed. SELECT CAST([MyColumn] AS DECIMAL(6,2)) FROM [MyTable]; I also tried the following to see if any data is non-numeric,

SQL Server 2000 - How do I rotate the results of a join in the final results of a query?

妖精的绣舞 提交于 2019-12-10 19:29:04
问题 My database is quite complex so I've simplified my problem down to the tables below. TableA and TableB are related by the NameID field in TableB . I am trying to create a SQL statement to produce the desired results. I'm understand JOINs and how they work but I can't fogure this out. There will never be more than 2 items in TableB for each item in TableA . There could be less than 2 items. This will be used on a SQL Server 2000 server. TableA ID | Name ---+----- 1 | John 2 | Jane 3 | Bob 4 |