Quantcast
Channel: SQLServerCentral » SQL Server 7,2000 » Administration » Latest topics
Viewing all 482 articles
Browse latest View live

Can't Kill SPID

$
0
0
I have a SQL Server 2000 Database. 30+ GB with a 15+GB log file. I attempted to backup the Database and I receive the following error: Server: Msg 9001, Level 21, State 1, Line 1The log for database 'MYDB' is not available.I then checked the Activity log and I see a System process associated with this Database:Process ID 5Command: autoshrinkWait Type: LOGBUFFERWaitTime: 76153109 Memory usage: 3 Physical I/O: 181Cannot kill this SPID as it is a System process (receive this error:)Server: Msg 6107, Level 14, State 1, Line 1Only user processes can be killed.Can anyone help with this?

Use sp_MSforeachtable to gen COUNT(*) for each table in MyDBname

$
0
0

I'm trying to dynamically COUNT the # rows per table in a DB using sp_MSforeachtable. The following syntax executes DBCC CHECKTABLE for each table in my DB.

HOW can I modify the following SQL to perform a SELECT COUNT(*) from each table in my DB?

USE MyDBnameGO

sp_MSforeachtable @command1="print '?' dbcc checktable ('?')"

/* NOTE:You can issue up to three commands to the stored procedure using @command1 through @command3. */

View referencing table with ## in the name?

$
0
0
I am trying to get an old SQL2000 DB to run on at least SQL2005. Can't move it up to SQL2008 because it uses deprecated features in the SQL procs (old *= and *= type joins). :-( I have a couple views that won't bind because the tables don't exist. The SQL in them is:CREATE VIEW [dbo].[IN_RP_ISTD_VENDA4] (ITEMNUM, VENDORID) AS SELECT ITEMNUM, VENDORID FROM IN_RP_ISTD_VEND##14 UNION SELECT ITEMNUM, VENDORID FROM IN_RP_ISTD_VEND##24GOTables IN_RP_ISTD_VEND##14 and IN_RP_ISTD_VEND##24 do not exist, nor are they other views, or even functions. Anyone have any idea what they could be? Any insight would be appreciated.ThanksLori

Rename Instance of SQL Server

$
0
0
I know how to rename a SQL server, but how do I rename another instance of SQL server 2000.Thanks

Audit trigger returning multiple records

$
0
0
Halloon several tables on a MSSQL2000 db I put a couple of triggers for auditing purpose, on DELETE and UPDATE:[quote]CREATE TRIGGER dbo.TableAuditDel ON dbo.Table FOR DELETE ASINSERT INTO dbo.TableAudit SELECT D.*, USER_NAME(), GETDATE(),'Delete',HOST_NAME()FROM deleted D[/quote]From a certain point in time the system started logging more than one record, including seemingly:- records edited by other users- records not being edited at all (with no apparent relation with the record being actually edited)- same identical record, recorded at slightly different intervals of time (this could be possibly due to the fact that triggers insists on related tables too, where multiple records are interested by the editing)It seems that this happens when multiple operators (tenths) are using the system.The customer is not willing to upgrade SQL Server to a newer version.Could you please give me any hint?

Take too long to shrink a huge database, HELP!!!!

$
0
0

I have a db size 13.5GB with File Allocation of 29 GB and autoshrink is off.

I am running the following command, trying to shrink the db, but it has been running for over 2 hours now, and last week I have tried this for over 3 hours and I had to stop it.

use [MSQLDB] DBCC SHRINKFILE (N'MSQLDB_DATA', 4000)

Any other way to shrink this big db down? I can't leave it at this 29GB, it is taking up too much disk space on my server now.

Please advise.

Thanks.

Sin

An expression of non-boolean type specified in a context where a condition is expected, near 'AND'.

$
0
0
WHERE CASE @UWDECISSION WHEN 'DECLINED' THEN (SELECT [TBL_IL_PTRNPF].BATCTRCDE FROM [TBL_IL_PTRNPF] WHERE BATCTRCDE = 'T644') WHEN 'POSTPONED' THEN (SELECT [TBL_IL_PTRNPF].BATCTRCDE FROM [TBL_IL_PTRNPF] WHERE BATCTRCDE = 'TA63') ELSE (SELECT [TBL_IL_PTRNPF].BATCTRCDE FROM [TBL_IL_PTRNPF] WHERE BATCTRCDE IN ( 'T644','TA63')) ENDi am getting error like this "[b]An expression of non-boolean type specified in a context where a condition is expected, near 'AND[/b]'"could you please help me to fix this error. advance thank you.

about sql error

$
0
0
failed to generate user instance of sql server.... the connection will be closed.a network related..... or no serverI tried many times ,I searched from internet but I did not any solution

Recover records from delete statement

$
0
0

I ran a delete statement, and deleted all rows.

Can I restore all these deleted records?

We updated the table with a backup from 3.am this morning, which is okay for now.

Thanks!

List SQL Server patches

$
0
0
How can i get a listing of all the patches that are installed on SQL Server.Thanks

Before SSMS...Server 7

$
0
0
Hello,Apologies for (possibly) dumb question, but...What do I use to connect to a pre-2005 database?I used Informix until around 2005. My introduction to MS SQL Server was 2005 edition so I used SSMS from the start.Now, I need to query a redundant application at work that is running on SQL Server 7.Can I use SSMS to connect or do I need a different tool? And if I need something different, please URL where I can find it.Thanks. :-)

Network IP address is changing - What is the impact on SQL server?

$
0
0

Dear All,

My company is changing the IP address of our network. So, I have a few questions:

  1. Do I need to change anything on the SQL servers and clients accessing the SQL server?
  2. Where do I need to make these changes, and how do I test them?

Are there any articles that explain this?

Your help is highly appreciated.

Thanks.

Merge replication SQL server 2012

$
0
0
Hello Everyone,Hope everyone is doing well.can we configure the merge replication with out primarykey? please confirm as soon as possible.as i know that Primarykey is prerequisite for the replication part. i checked some articled they have mentioned that Primarykey is for only transnational replication.and Snapshot and Merge replication primary key is not required?Please correct me if im wrong.. please suggest me..Thanks in advance!!Regards,DBA

SQL 2000 cluster issue

$
0
0
I have few SQL instances running in active-active cluster (2 node). All the sql instances whichever is running in node B becomes inaccessible but these instances or sql groups shows to be online. Any suggestions?

Deny user from running Alter Server Role

$
0
0
This was a mistake. I've now posted it in the appropriate area. Sorry.

Reporting database for an ERP system

$
0
0

Hi,

I've created a reporting database that pulls data from the ERP system using DTS packages. On the reporting database the statistics are 2488 MB for data files and 44563 MB for log files. My question is why is the log file this big and what are possible strategies to managing this log file. Keep in mind that this is a reporting database and I don't need to record every process.

Thanks,

Joe

Error 1222: Lock request time out period exceeded

$
0
0

Our server is set up with connections settings with a timeout of 0 (unlimited). However we have suddenly developed a problem in Enterprise Manager.

When accessing Enterprise Manager, Management, Current Activity, Process Info, we get the error

Error 1222: Lock request time out period exceeded

Refreshing or disconnecting/connecting the server does not clear the error. Users of the production application, which uses that server, are experiencing difficulties but still able to work and log in. There is only the one application on that server.

Has anyone got any ideas? Nothing has been changed in SQL Server for some considerable time.

An error occurred while executing batch. Error message is: Exception of type 'System.OutOfMemoryException' was thrown.

$
0
0
Hi,I am geting this error when I try to run a quer through SSMS.Table got 23000 records and SQL srever max memoy assigned 3024.Thank you in Advance,Krishna

summation of a calculated time difference field

$
0
0
Dear EveryoneI have the following query:select DateDiff(s,min(CONVERT(VARCHAR(8),TRANSIT_DATE,108)),max(CONVERT(VARCHAR(8),TRANSIT_DATE,108)))/3600 , count (distinct identifier), parameter_3from HA_TRANSITwhere transit_Date>= '2015-08-23 00:00:00.000' and transit_date <= '2015-08-24 00:00:00.000'and identifier like '%C%'--and identifier not like '%T%'and identifier not like '%V%'and identifier not like '%O%'and parameter_3 = 'Filicori- Canteen'group by parameter_3, identifierThe result is below:Time Diff EmployeeCnt Company 9 1 Filicori- Canteen8 1 Filicori- Canteen8 1 Filicori- Canteen5 1 Filicori- CanteenNow i can modify my query and get the result: Sum EmployeeTotal Company 9 4 Filicori- CanteenI need the total man hours per company with the total employees per company. So the number 9 isnt the total but the first line. I need the total to say 9+8+8+5=30I tried derived tables but it didnt work let me know if anyone has any ideas thanks K. But i need the total

Slow join across SQL Linked Server to InterSystems Cache

$
0
0

Hi Everyone,

I am a newbie to this discussion forum. If I’m bending/breaking any of the rules, please let me know.

I need some major help with a linked server I setup. I have a cache database that we can only access through ODBC (no mumps). I have a SQL database, db01, which is storing data related to a table in one of the cache databases. I setup a linked server on our SQL Server pointing to the cache database using the MS OLE DB Provider for ODBC driver, referencing our ODBC data source.

From SQL Server I can do pass through queries using OPENQUERY and see excellent performance when looking for specific IDs.

/*

SELECT * FROM

OPENQUERY(Cache_test01, 'SELECT * FROM Table01 WHERE ID=22') AS X

*/

Works great. However, whenever I do a simple join between my SQL database and Cache across the link it crawls.

/*

--This returns 600 records but takes 12 minutes. It should take a few seconds top.

SELECT A.*, X.*

FROM

tblTable01AddOn AS A INNER JOIN Cache_test01..SQLUser.Table01 AS X ON A.ID = X.ID

--I also tried.

SELECT A.*, X.*

FROM Cache_test01..SQLUser.Table01 AS X, tblTable01AddOn A

Where X.ID = A.ID

*/

I have no access to the Cache server. I cannot make any modifications to any settings on that server. Our vendor reassured me that ID is indexed in Cache. ID is indexed on tblTable and Collation Compatible is checked on the SQL Linked Server pointing to Cache (Cache_test01).

I know little about Cache but I am stuck with making this work. At first glance I would imagine the performance issue has something to do with a setting on the Cache server. But I’m seeing the following which strongly leads me to believe that it is SQL.

I somewhat replicated this entire situation in MS Access and it is smoking fast. I created a second ODBC data source pointing to my SQL database. I then created an Access 2000 database and created two linked tables using the ODBC data sources (one to tblTable01AddOn in the SQL database and the other to Table01 in the cache database [using the same DSN I referenced when setting up the Linked Server in SQL]).I then put together this query:

/*

SELECT dbo_tblTable01AddOn.*, SQLUser_Table01.*

FROM dbo_tblTable01AddOn INNER JOIN SQLUser_Table01 ON dbo_tblTable01AddOn.ID = SQLUser_Table01.ID;

*/

It returns the data, all 600 records, in two seconds. So the providers are capable of working in this manner. When I take the SQL linked server out of the equation it is fast. The linked table in Access uses the same ODBC data source I used to create the linked server, so I don’t think it’s ODBC driver or the DSN either.

I should be able to see this performance in SQL. What is it that Access/Jet is doing that SQL isn’t? Can someone please help me workout the issue with my linked server? There is something about how the linked server is pulling the data that Jet is not doing. I have to get this to work or I’m going to fall weeks back on this project. With a new born in the house, our first, and working 60 hours a week at work, I can’t afford to loose that time.

Thank you for any help you can provide.

BTW, I also tried

/*

Select A.*, C.ID

From

tblTable01AddOn AS A,

(SELECT ID

FROM Cache_test01..SQLUser.Table01

WHERE ID IN (SELECT ID FROM tblTable01AddOn)) AS C

*/

Thinking I would drive this as a table and rejoin it to my table in SQL, but it crawled. SQL still pulled the entire table back and then looked for my data.

So why is MS Access Kicking my SQL Server 2000’s backside? ANY help would be IMMENSELY appreciated. Thank you in advance.

Steven

Viewing all 482 articles
Browse latest View live