sql-server-2000

How to combine two types of dynamic property in SQL Server 2000 DTS?

Basically, I can't find a way to combine two types. For example, supposing I want a connection to refer to a text file that is held in a path identified by one of the environment variables, and whose filename is a string form of the current day. I can use SQL to set the filename, and an environment variable to set the path, but I can't ...

Impersonation for sp_OA* on SQL Server 2000

Is there any way to impersonate for sp_OA* calls? I'm specifically using this for file system management, and I'm doing everything in TSQL to avoid DTS since there's a possibility of upgrading to 2005 and I want this solution to be cross-version. Unfortunately, I need to access remote file systems but I can't get AD permissions added t...

Maximum Count Range Intersection (in T-SQL)

Let's say I have a table with a bunch of dates, e.g.: declare @tbl table { idx int primary key, startdate datetime, enddate datetime } And I want to find the largest set of rows where startdate and enddate intersect (in the real world, the start date and end date represents start and end times for events, and I need to fin...

MySqlServer2000 data export to text file ???

Hi, I need to export all data from a database into a text or csv file from MSSQL Server2000. I have read from msdn and found that a tool 'bcp' could be useful for exporting data into text file. But MSSQL Server 2000 is not supporting 'queryout' keyword for it on EnterpriseManager Editor. Is there any other possible way with which i can ...

SQL Server, excecute batch T-SQL script on multiple databases

Our SQL Server 2000 instance hosts several databases which are all similar, one for each of our client. When comes the time to update them all, we use Red Gate SQL Compare to generate a migration script between the development database and a copy of the current state DB of all the clients database. SQL Compare generates a script which i...

Sending Notifications from a SQL Server 2000 Job without SMTP Server on the Box

I have SQL Server 2000 installed on Windows 2003 Server. We do not have SMTP installed on the box, so when creating a notification for a failed SQL Agent job, the email is not sent. Is there a way to send out a notification without installing SMTP on the box? ...

Case-insensitive REPLACE() in SQL Server 2000

I have a field that contains strings such as 'Blah-OVER', 'Blah-OveR', etc. and want to select them without the 'over's. This only catches the first case (so to speak) and not the others: SELECT field as "before", REPLACE(field, 'OVER', '') as "after" How do I just get them all to say 'Blah-' (preserving the case of what's left) with...

sql server 2000: release lock on table?

I run the following query select * from my t1 where c1 = 22 and query runs for ever.. How can I find out whats locking that row? I tried runnning sp_who, sp_who2, sp_lock, and googled for information but still no resolution in sight. Please help. I am using sql server 2000. ...

Intermittant problems connecting to SQL 2000 servers from SSMS 2008

We're having some intermittant connection problems connecting to our few SQL 2000 servers, but only seemingly from our SSMS 2008 workstations - there don't appear to be any actual business applications that aren't able to connect. Most of the time, SSMS connects just fine, but sometimes, I'll need to manually set the connection protocol ...

Selecting distinct, non-null, unless null is the only value for that record combination (tsql)

I have a table with Student ID, Service, and Provider. I want to show the DISTINCT Providers for each Service, but ONLY show NULL Providers if there is no other Provider for that Service and ID. In other words, if a Student has a certain Provider and Service, I don't want to select where the Provider is NULL, unless that specific Studen...

How to get a data's from one database to other database?

Using SQL 2000, SQL 2005 Old Database Name is – Sysdatabase New Database Name is - Dual_Proone, Dual_Protwo In the above two database table name and column name are different, but values are same. For Example Sysdatabase (Database Name) Person (Table Name) Column Names and values are ID Date 001 23-02-2009 002 24-02-2009 So o...

How triggers will work?

Using SQL Server 2000 I make a trigger in new database CREATE TRIGGER [CARDEVENTSAVING] ON [dbo].[T_CARDEVENT] AFTER INSERT AS DECLARE @EDATE VARCHAR(50) DECLARE @ETIME VARCHAR(50) DECLARE @EDOOR NVARCHAR(50) DECLARE @EFLOOR NVARCHAR(50) DECLARE @EMPID NVARCHAR(50) DECLARE @TAG NVARCHAR(50) DECLARE @ENAME NVARCHAR(50) DECLARE @ELNA...

Non-system databases in SQL Server 2000

How to retrieve the names of all Nonsystem-databases from SQL Server 2000 using a TSQL query? I have anticipated: SELECT * FROM sysdatabases where dbid >4 order by dbid it does not seem to be reliable. Anything else? ...

Converting string to datetime problem

Using SQL Server 2000: SELECT PERSONID, CARDEVENTDATE, INTIME, CASE WHEN OUTTIME = INTIME THEN 'No PunchOut' ELSE OUTTIME END AS OUTTIME, CONVERT(char(8), CASE WHEN DateAdd(Day, - DateDiff(Day, 0, OutTime), OutTime) > '18:00:0...

SQL Server / JDBC Connectivity Issues

I am experiencing some strange behaviour in my Java server application whereby database operations that usually take a few milliseconds are sporadically taking much longer (30s - 170s) to complete. This isn't isolated to a specific query as I've seen the delays occurring for both SQL update and select statements. Also, all of my select...

converting stored procedures from sql server to oracle

We have a massive amount of stored procedures to convert from sql-server 2000 to oracle 10g. Does anyone know of any tool that would achieve this? We used Oracle SQL developer for this but it seems like it is creating extra cursors for each IF/ELSE condition that was on sql server side. Has anyone successfully used a tool that would ...

How to display all the dates between two given dates in SQL

Using SQL server 2000. If the Start date is 06/23/2008 and End date is 06/30/2008 Then I need the Output of query as 06/23/2008 06/24/2008 06/25/2008 . . . 06/30/2008 I Created a Table names as Integer which has 1 Column, column values are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 then I used the below mentioned query Tried Query SELECT DATEADD...

Retrieve data from xml file and insert into database table

I am using c# .net 1.1 and SQL Server 2000.... I want to retrive data from an xml file and store that data into the database table. XML file: <information> <data> <id="1"></id> <name>peter</name> <age>25</age> </data> </information> My databse table is id int, name varchar(100), age int ...

How to convert mdb to mdf Database in Sql Server 2000

Using SQL Server 2000 and Access 2003 I want to convert the database from access to sql Database. There is possibility in sql server 2000 or any other tools is available. Need Help ...

Table Diff in SQL Server 2000

I'm using SQL Server 2000, and given a a set of data (with unique ID's), I want to figure out the diffs with rows in the database, matching on the unique IDs. I'm also trying to keep it as flexible as possible. I can use C#/VB in the front end to take the parameters, or even return things. Maybe passing in XML and getting XML in ret...