sql-server-2000

sql server 2000 error, error trying to connect to sql server 2005

i am connecting to sql server 2000 on a remote computer with a dotnet application, but when i try to open the connection it gives the following error: When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections What is this? ...

Product with Last Purchase Date

Hello , I would like to query from SQL Server 2000 Database.I have got two tables. They are Purchase and PurchaseDetails. I would like to get product records with Last Purchase ID but I can't query with the following statements.So please help me. SELECT TOP 100 PERCENT dbo.Purchase.PurchaseID AS LastOfPurchaseID, dbo.PurchaseDetai...

SQL last day in moth select

I have the following table which is basically the summary of daily transactions and is loaded nightly. +++++++++++++++++++++++ + DateCreated + Sale + +++++++++++++++++++++++ + 20100101 + 1000 + + 20100131 + 2000 + + 20100210 + 2000 + + 20100331 + 4000 + +++++++++++++++++++++++ I need to display the sale by month, but ...

SQL Profiler: Read/Write units

i'm running a select query in Query Analyzer. While running SQL Profiler i see that the query took 2,027 reads: EventClass: SQL:BatchCompleted TextData: SELECT Transactions.... CPU: 422 Reads: 2027 Writes: 0 Duration: 466 i ran the query with the SET STATISTICS IO ON option, and i get nowhere clos...

Will SQL Server 2000 be able to use indexes in a view over a union of a view across linked servers.

I have the following scenario: 2 DB servers (Linked to each other) DB1 has a (large) table with transaction records DB2 has a (not quite as large yet) table with transaction records (of a similar nature but without some of the data as it is a different system) There are a bunch of reports that pull records out of the transaction table ...

Why won't this SQL CAST work?

I have a nvarchar(50) column in a SQL Server 2000 table defined as follows: TaskID nvarchar(50) NULL I need to populate this column with random SQL GUID's using the NEWID() function (I am unable to change the column type to uniqueidentifier). I tried this: UPDATE TaskData SET TaskID = CAST(NEWID() AS nvarchar) but I got the follow...

Calendar Table - Week number of month

I have a calendar table with data from year 2000 to 2012 (2012 wasn't intentional!). I just realize that I don't have the week number of month (e.g In January 1,2,3,4 February 1,2,3,4) How do I go about calculating the week numbers in a month to fill this table? Here is the table schema CREATE TABLE [TCalendar] ( [TimeKey] [int] N...

SQL Server: Is it possible to prevent SQL Agent from failing a step on error?

I have a stored procedure that runs custom backups for around 60 SQL servers (mixes 2000 through 2008R2). Occasionally, due to issues outside of my control (backup device inaccessible, network error, etc.) an individual backup on one or two databases will fail. This causes this entire step to fail, which means any subsequent backup comm...

Mass update of data in sql from int to varchar

We have a large table (5608782 rows and growing) that has 3 columns Zip1,Zip2, distance All columns are currently int, we would like to convert this table to use varchars for international usage but need to do a mass import into the new table convert zip < 5 digits to 0 padded varchars 123 becomes 00123 etc. is there a way to do this sh...

SQL SERVER 2000 is Slow & linked server send an error "Server doesn't exist or Access is denied"

I have a problem in my SQL SERVER 2000 , the server is so slow when i made any query and recently i couldn't link with other SQL servers. The message is "the server doesn't exists or access is denied". In spite of that the linked servers were working well and i can access them remotely & the service pack is SP4... ...

backup the stored procedure of a database in sql server 2000.

what is the query to backup the stored procedure of a database in sql server 2000. ...

SQL Server: Must numbers all be specified with latin numeral digits?

Does SQL server expect numbers to be specified with digits from the latin alphabet, e.g.: 0123456789 Is it valid to give SQL Server digits in other alphabets? Rosetta Stone: Latin: 01234567890 Arabic: ٠١٢٣٤٥٦٧٨٩ Bengali: ০১২৩৪৫৬৭৮৯ i know that the client (ADO) will convert 8-bit strings to 16-bit unicode strings using the curre...

SQL Server: What locale should be used to format numeric values into SQL Server format?

It seems that SQL Server does not accept numbers formatted using any particular locale. It also doesn't support locales that have digits other than 0-9. For example, if the current locale is bengali, then the number 123456789 would come out as "১২৩৪৫৬৭৮৯". And that's just the digits, nevermind what the digit grouping would be. But the ...

Trigger Code on a table in my ERP Database

My ERP Vendor has the following trigger on a table: SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TRIGGER [dbo].[SOItem_DeleteCheck] ON [dbo].[soitem] FOR DELETE AS BEGIN DECLARE @RecCnt int, @LogInfo varchar(256) SET @RecCnt = (SELECT COUNT(*) FROM deleted) IF @RecCnt > 150 BEGIN RAISERROR (54010...

Problem using SQLDMO/Vb6 against SQL Server 2008

I have a client, that uses SQLDMO for a portion of a custom application that was written against SQL Server 2000, and they recently upgraded to SQL Server 2008. The majority of the app still runs fine (doesn't use SQLDMO), but the admin functions which rely on SQLDMO stopped working. I installed the SQL2005 backward compatibility pack,...

Finding employees specific to department in SQL Server 2000

Suppose I have a table (tblEmp) whose structure is like as under Dept Emp ----- ------ d1 e1 d1 e2 d1 e3 d2 e4 d2 e5 d3 e6 If I need to bring the output as Dept DepartmentSpecificEmployees ------ ---------------------------- d1 e1,e2,e3 d2 e4,e5 d3 ...

How to apply Data Mining (Association Rule) to a huge database ?

Hello What I want to do is to apply Association method of data mining on my SQL Server 2000 database. Association rule is something like "finding the most frequent items that appear together in database." For those who don't know or who want to remember what is association method is like, take a look at this presentation about Associa...

Is it possible to install SQL Server 2000 on my PC?

Hi, I am pretty much new to using SQL Server 2000. I have been using only open source databases until this time. I want to know if there is any developer version of SQL Server 2000 available. It's for learning purposes only. Is it available free or do I need to pay for it? Thanks ...

Delphi Application using COMMIT and ROLLBACK for Multiple SQL Updates

Is it possible to use the SQL BEGIN TRANSACTION, COMMIT TRANSACTION, ROLLBACK TRANSACTION when embedding SQL Queries into an application with mutiple calls to the SQL for Table Updates. For example I have the following code: Q.SQL.ADD(<UPDATE A RECORD>); Q.ExecSQL; Q.Close; Q.SQL.Clear; Q.SQL.ADD(<Select Some Data>); Q.Open; Set Som...

I need some ideas on my algortihm for a Hit Counter (Group By Time Interval)

My algorithm is for a 'hit counter', I am trying to not count the same person twice if that person came to the site twice in a time interval (For example if he comes twice in 5 minutes, I want to count it as 1 hit for this person) Here's what my database looks like UserIp UserId Date of user came 127.0.0.1 new.user.akb ...