sql-server-2000

Database Missing ! Finding the root cause

断了今生、忘了曾经 提交于 2019-12-10 18:47:47
问题 Assume one fine day an admin comes to the office like he always does to do his admin tasks on Sql Server Databases and to his surprise finds a database missing. He has no clue of who dropped it or was it from an external batch or SQL injection etc ... where do one start an investigation and what are the important parameters/ findings that should happen to find the root cause of the Drop DB. Like what logs shud be checked and what information shud be investigated ? 回答1: There is a defaul trace

CROSS APPLY does not work with SQL SERVER 2000?

妖精的绣舞 提交于 2019-12-10 18:02:17
问题 How can I use something equivalent of CROSS APPLY in SQL Server 2000 ? I have a function which returns top level parent of id passed. ALTER Function [dbo].[fn_GetTopParentRiskCategory] ( @RctId int ) RETURNS @TEMP_TABLE TABLE ( rctId int, topParentRiskCat Varchar(100) ) AS BEGIN DECLARE @PARENTID INT DECLARE @GRANDPARENTID INT DECLARE @CODE VARCHAR(100) DECLARE @DESC VARCHAR(100) DECLARE @PARENTCODE VARCHAR(100) SELECT @PARENTID= rctParentID from RiskCategory where rctid=@RctId SELECT

How can I exclude LEFT JOINed tables from TOP in SQL Server?

梦想的初衷 提交于 2019-12-10 17:48:37
问题 Let's say I have two tables of books and two tables of their corresponding editions. I have a query as follows: SELECT TOP 10 * FROM (SELECT hbID, hbTitle, hbPublisherID, hbPublishDate, hbedID, hbedDate FROM hardback LEFT JOIN hardbackEdition on hbID = hbedID UNION SELECT pbID, pbTitle, pbPublisher, pbPublishDate, pbedID, pbedDate FROM paperback Left JOIN paperbackEdition on pbID = pbedID ) books WHERE hbPublisherID = 7 ORDER BY hbPublishDate DESC If there are 5 editions of the first two

SQL Server Error: maximum number of prefixes. The maximum is 3. with join syntax

亡梦爱人 提交于 2019-12-10 16:56:30
问题 Trying to run a cross-server update: UPDATE ASILIVE.CustomerManagementSystem.dbo.Sessions SET ASILIVE.CustomerManagementSystem.dbo.Sessions.VarianceAmount=Variances.VarianceAmount FROM ASILIVE.CustomerManagementSystem.dbo.Sessions INNER JOIN Variances ON ASILIVE.CustomerManagementSystem.dbo.Sessions.SessionGUID = Variances.SessionGUID WHERE ASILIVE.CustomerManagementSystem.dbo.Sessions.VarianceAmount <> Variances.VarianceAmount Gives the error: Msg 117, Level 15, State 2, Line 5 The number

SQL SERVER 2000 JDBC DRIVER

给你一囗甜甜゛ 提交于 2019-12-10 16:44:08
问题 I am trying to find the SQL SERVER 2000 JDBC Driver to use in extracting data from SQL SERVER and also carrying out several operation implemented in Java/JSF. Any idea where I could get my hands on the driver? It is no surprise that Microsoft.com /MSDN stopped supporting and hence supplying the necessary driver. Please help and it is greatly appreciated P.S. Sorry if this is the wrong place to post this :) EDIT: Solution Working: So JTDS does it based on link below. The strings I changed to

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

久未见 提交于 2019-12-10 16:35:14
问题 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. 回答1: Working with TEXT/NTEXT is a mess - one of the many reason to get rid of those fields as quickly as possible. You need to manipulate those with command such as READTEXT, WRITETEXT, UPDATETEXT and other - see some resources for help: MSDN docs on READTEXT MSDN docs on WRITETEXT MSDN docs on UPDATETEXT How do I handle REPLACE() within an

VS 2010 and Entity Framework: accessing SQL Server 2000 databases

孤者浪人 提交于 2019-12-10 15:26:13
问题 Consider a Visual Studio 2010 project whose requirement is to model the data using Entity Framework. The datasource is a SQL Server 2000 database. The first step is creating a new ADO.NET Entity Data Model item. The Entity Data Model Wizard prompts for a Data Connection. When creating a new Connection, you will need to use a provider other than SqlClient . Usually it's SQLOLEDB . The list of data providers only has SqlClient or ".NET Framework Data Provider for SQL Server". Is there a work

How to join two tables without any condition

一笑奈何 提交于 2019-12-10 15:25:45
问题 For example I have two tables (temp tables). One of them contains only IDs, and the other contains real information. They have exactly the same row number. #Table1 ID 14 15 16 #Table2 CarModel Year Ford 1996 Ferrari 2005 Toyota 2010 How can I join this two table in one (without any condition, just the result table has 3 columns, no matter in what order)? I need it for inserting the result for real table Cars ID CarModel Year And this table doesn't use identity. There is an own mechanism of

Tell me SQL Server Full-Text searcher is crazy, not me

为君一笑 提交于 2019-12-10 14:39:16
问题 i have some customers with a particular address that the user is searching for: 123 generic way There are 5 rows in the database that match: ResidentialAddress1 ============================= 123 GENERIC WAY 123 GENERIC WAY 123 GENERIC WAY 123 GENERIC WAY 123 GENERIC WAY i run a FT query to look for these rows. i'll show you each step as i add more criteria to the search: SELECT ResidentialAddress1 FROM Patrons WHERE CONTAINS(Patrons.ResidentialAddress1, '"123*"') ResidentialAddress1 =========

Effects of Clustered Index on DB Performance

孤街浪徒 提交于 2019-12-10 12:47:18
问题 I recently became involved with a new software project which uses SQL Server 2000 for its data storage. In reviewing the project, I discovered that one of the main tables uses a clustered index on its primary key which consists of four columns: Sequence numeric(18, 0) Date datetime Client varchar(9) Hash tinyint This table experiences a lot of inserts in the course of normal operation. Now, I'm a C++ developer, not a DB Admin, but my first impression of this table design was that that having