Showing posts with label sqlserver. Show all posts
Showing posts with label sqlserver. Show all posts

Friday, March 30, 2012

Problems with tempdb log.

Hi, I am trying to execute a process on a server that is running sql
server 2000 sp3. When i try to execute the process displays this error:
Error: 9002, Severity: 17, State: 6
The log file for database 'tempdb' is full. Back up the transaction log
for the database to free up some log space.
I check the tempdb log and is ok, i create a secundary file on another
disk and it still display the error. I drop and recreate the second file
and the error continues.
The process i executed by a cognos software.
The server has enought free space.
Do you know what could be the reason of this error.
Thanks a lot for your help.
*** Sent via Developersdex http://www.codecomments.com ***Can you check for open transactions?
dbcc opentran
go
AMB
"MariaGuzman" wrote:

> Hi, I am trying to execute a process on a server that is running sql
> server 2000 sp3. When i try to execute the process displays this error:
> Error: 9002, Severity: 17, State: 6
> The log file for database 'tempdb' is full. Back up the transaction log
> for the database to free up some log space.
> I check the tempdb log and is ok, i create a secundary file on another
> disk and it still display the error. I drop and recreate the second file
> and the error continues.
> The process i executed by a cognos software.
> The server has enought free space.
> Do you know what could be the reason of this error.
> Thanks a lot for your help.
>
>
>
> *** Sent via Developersdex http://www.codecomments.com ***
>|||Better to read this.
Why is tempdb full, and how can I prevent this from happening?
http://www.aspfaq.com/show.asp?id=2446
AMB
P.S. Thanks god I do not have to pay to Aaron every time I post a link from
his oustanding web site.
"Alejandro Mesa" wrote:
[vbcol=seagreen]
> Can you check for open transactions?
> dbcc opentran
> go
>
> AMB
> "MariaGuzman" wrote:
>sql

Problems with tempdb log.

Hi, I am trying to execute a process on a server that is running sql
server 2000 sp3. When i try to execute the process displays this error:
Error: 9002, Severity: 17, State: 6
The log file for database 'tempdb' is full. Back up the transaction log
for the database to free up some log space.
I check the tempdb log and is ok, i create a secundary file on another
disk and it still display the error. I drop and recreate the second file
and the error continues.
The process i executed by a cognos software.
The server has enought free space.
Do you know what could be the reason of this error.
Thanks a lot for your help.
*** Sent via Developersdex http://www.codecomments.com ***
Can you check for open transactions?
dbcc opentran
go
AMB
"MariaGuzman" wrote:

> Hi, I am trying to execute a process on a server that is running sql
> server 2000 sp3. When i try to execute the process displays this error:
> Error: 9002, Severity: 17, State: 6
> The log file for database 'tempdb' is full. Back up the transaction log
> for the database to free up some log space.
> I check the tempdb log and is ok, i create a secundary file on another
> disk and it still display the error. I drop and recreate the second file
> and the error continues.
> The process i executed by a cognos software.
> The server has enought free space.
> Do you know what could be the reason of this error.
> Thanks a lot for your help.
>
>
>
> *** Sent via Developersdex http://www.codecomments.com ***
>
|||Better to read this.
Why is tempdb full, and how can I prevent this from happening?
http://www.aspfaq.com/show.asp?id=2446
AMB
P.S. Thanks god I do not have to pay to Aaron every time I post a link from
his oustanding web site.
"Alejandro Mesa" wrote:
[vbcol=seagreen]
> Can you check for open transactions?
> dbcc opentran
> go
>
> AMB
> "MariaGuzman" wrote:

Wednesday, March 28, 2012

Problems with SQL-DMO.Job Script method

I am trying to create a vbs program to generate the script for SQL
Agent Jobs. In this program I am using the SQL-DMO objects for SQL
Server.
When the output is generated from the Job.Script method the job steps
are not in the correct order. They are ordered by step_name rather
than the step_id. Scripts generated from Enterprise Manager works
fine. It is just the ones from the DMO objects that get out of order.
Anybody have this problem as well?
Thanks in advance.
Keith
Problem solved!
The msdb statistics were not updated and the query was using the
non-clustered index rather than the clustered index. The non-clustered
index was job_id, step_name. The clustered index is job_id , step_id.
Updated the statistics on msdb tables and it worked fine.
sql

Problems with SQL-DMO.Job Script method

I am trying to create a vbs program to generate the script for SQL
Agent Jobs. In this program I am using the SQL-DMO objects for SQL
Server.
When the output is generated from the Job.Script method the job steps
are not in the correct order. They are ordered by step_name rather
than the step_id. Scripts generated from Enterprise Manager works
fine. It is just the ones from the DMO objects that get out of order.
Anybody have this problem as well?
Thanks in advance.
KeithProblem solved!
The msdb statistics were not updated and the query was using the
non-clustered index rather than the clustered index. The non-clustered
index was job_id, step_name. The clustered index is job_id , step_id.
Updated the statistics on msdb tables and it worked fine.

Tuesday, March 20, 2012

problems with locks and automation

Hello to everybody!
I am a new comer in this forum and also a new user of SQLServer.
I would like to write a transact-SQL script that will permit me, when there is any deadlock,
- to have a list of the processes in deadlock in a ".txt" format or any other format
- to send a message to somebody in its mail account in order to inform him of the problem
- to kill the process which causes the deadlock

All these automatically.
First of all, is it possible?
Then if it is not, can you please give me another solution?
I am using SQLServer 2000.
Thanks in advance.Yes, it's possible:

1.
- to have a list of the processes in deadlock in a ".txt" format or any other format
See: sp_lock (use the help for more info)

2.
- to send a message to somebody in its mail account in order to inform him of the problem
See: xp_sendmail (use the help for more info) :)

3.
- to kill the process which causes the deadlock
See: kill (use the help for more info) :)

Best regards!
:cool:|||check the following page:

http://www.sql-server-performance.com/deadlocks.asp|||Thanx to all for your replies
Botond.baika can you please send me a script example please for all those manipulations?
Thanx.|||I could! :D ...but then you'll miss the fun of learning on your own. The MSSQL help is sufficiently detailed about these SPs. Writing the code instead of you is against my beliefs about teaching people. I could give you THE fish, but then you'll never learn how TO fish. :)
If you run into specifical problems that you can not solve it on your own, and neither help and neither the different posts on forums on the Internet can't help you, then ask us the question and we will answer you. But till then it's just to easy to have somebody else figure it out for you. ;)
If somebody else will do this for you (write the whole thing for you) it's fine with me, but I won't.

Best regards,
Botond BAIKA

Wednesday, March 7, 2012

Problems with date

Hi, my name is MANUEL. I don't speak english very well...
Today I am working with SQLServer. I would want to compare two dateTime fields for to determine if two or more customers are connected in the same moment into my applications...
For example:
Begin date of connections:
16/01/2007 16.19.59
end date of connection
16/01/2007 16.25.23 for customers 01

Begin date of connections:
16/01/2007 16.20.59
end date of connection
16/01/2007 16.24.23 for customers 02

What i have to do!!!!
I must make this control to every hour of the day
Please Help!

Hi Manuel,

If I understand you question, you are looking to write a query that shows overlapping sessions.

If you start with a list of all the distinct start times, you can then use a correlated query to look for overlapping sessions (something like):

Code Snippet

select s1.app, st, (
select count(*)
from Sessions as s2
where
s1.app = s2.app

and s1.st >= s2.StartDateTime
and s1.st < s2.StopDateTime ) as Overlaps
from (
select distinct app, StartDateTime st
from Sessions
) as s1

Note that set based solutions around this type of problem can become really slow, really quickly! A cursor based solution can scale much better. You'd have to do some testing to see which would work best for you.

Hope that helps.

Jamie

|||

Here is a query that will retrieve all the connections that are overlapping.

Code Snippet

Select Conn1.Customer, Conn1.BeginDate, Conn1.EndDate,

Conn2.Customer, Conn2.BeginDate, Conn2.EndDate, *

From Connections Conn1, Connections Conn2

Where Conn2.BeginDate Between Conn1.BeginDate And Conn1.EndDate

And Conn1.ID <> Conn2.ID

I'm assuming the table name is called 'Connections' and that there is a primary key which is called ID. Here I've joined the table on itself looking for connections that have their start time between another connection's start and end time. I added 'Conn1.ID <> Conn2.ID' so that the query does not assume that the same connection is as an overlapping one.

I hope this answers your question.

Best regards,

Sami Samir

|||

This query might help you...

Code Snippet

Select
MainThread.CustomerId Customer
,MainThread.Startdate Customer1StartAt
,MainThread.Enddate Customer2EndAt
,ParlelThread.CustomerId ParllelWith
,ParlelThread.Startdate ParllelCustomerJoinAt
,ParlelThread.Enddate ParllelCustomerLeaveAt
,DateDiff(Mi, ParlelThread.Startdate, Case When MainThread.Enddate < ParlelThread.Enddate Then MainThread.Enddate Else ParlelThread.Enddate End ) TotalMinutesParllel
from AuditLog MainThread
Join AuditLog ParlelThread On
MainThread.Enddate > ParlelThread.Startdate And
MainThread.Startdate <= ParlelThread.Startdate
And MainThread.CustomerId <> ParlelThread.CustomerId
Order By 1

|||Sorry!I don't know SQL SERVER too

I have only one table which contains:
IDCustomers
Name
BeginDate
EndDate

My really problem is to abtain the list of cutomers whitch day,mount, years is the same and

have the same hour of logon.

I ask for new excuse for my English


|||

Try this :

Substitute your actual table name in <YourTable>

select BeginDate,IDCustomers,Name,EndDate

from <YourTable>

where BeginDate in

(

select BeginDate

from <YourTable>

group by BeginDate

having count(*) > 1

)

order by BeginDate,IDCustomers

Thanks.

Naras.

|||

The following query may help you...


Code Snippet

Select
MainThread.CustomerId Customer
,MainThread.Startdate Customer1StartAt
,MainThread.Enddate Customer2EndAt
,ParlelThread.CustomerId ParllelWith
,ParlelThread.Startdate ParllelCustomerJoinAt
,ParlelThread.Enddate ParllelCustomerLeaveAt
Into #Data
from <YourTable> MainThread
Join <YourTable>ParlelThread On
MainThread.Enddate > ParlelThread.Startdate And
MainThread.Startdate <= ParlelThread.Startdate
And MainThread.CustomerId <> ParlelThread.CustomerId
Order By 1

Select Customer, Customer1StartAt, Customer2EndAt From #Data
Union
Select ParllelWith, ParllelCustomerJoinAt, ParllelCustomerLeaveAt From #Data

Drop Table #Data

|||thanks to all… I have resolved the problem with one function.
you have been fast and kind
BYE

Saturday, February 25, 2012

Problems with a JET-ODBC-Connection and Access97-Runtime

I have a very strange problem with a JET-ODBC-Connection.
Using Access97-Runtime, we connect the table with a
DSN-less-ODBC-Connection to SQLServer 2000 SP3.
The Application runs on a Windows Server 2003 Terminal-Server with
CITRIX Metaframe.
Office 2003 is also installed (no Access2003)
And now the problem:
When our application is installed anew, the ODBC-Connection works fine.
When I start any Office2003-Application like Winword, the system files
MSJINT35.DLL and MSJTER35.DLL are changed. (I used ashampoo Uninstaller
Suite to check this issue).
Afterwards, our Application doesn't run anymore, the Application quits
without any error.
If I copy the MSJINT35.DLL anew from the install-directory, our
application runs again correctly.
The strange thing is, that the "changed" MSJINT35.DLL is exactly the
same as the original file. Version, Metadata, Language, Filesize, and
even a Hex-based-compare result that the files are identically.
Nevertheless, a copy of the file into system32 is a workaround to fix
the problem for a few hours.
Does anyone has any idea? PLEASE HELP!
How are you installing the app? I use Wise Install Builder, which installs
the Access 97 runtime into it's own folder - C:\Program Files\Access 97
Runtime. It installs the DLLs in question into that folder, too. The reason
being - when an app looks for DLL's it starts with the folder the app
started in, then looks in the folders in the PATH environment variable (e.g.
System32). You could probably solve your problem by having your installer
put the DLLs in question into the Runtime folder.
"Andreas Lauffer" <alweb01@.online.de> wrote in message
news:1132133394.166634.268470@.z14g2000cwz.googlegr oups.com...
> I have a very strange problem with a JET-ODBC-Connection.
> Using Access97-Runtime, we connect the table with a
> DSN-less-ODBC-Connection to SQLServer 2000 SP3.
> The Application runs on a Windows Server 2003 Terminal-Server with
> CITRIX Metaframe.
> Office 2003 is also installed (no Access2003)
> And now the problem:
> ----
> When our application is installed anew, the ODBC-Connection works fine.
> When I start any Office2003-Application like Winword, the system files
> MSJINT35.DLL and MSJTER35.DLL are changed. (I used ashampoo Uninstaller
> Suite to check this issue).
> Afterwards, our Application doesn't run anymore, the Application quits
> without any error.
> If I copy the MSJINT35.DLL anew from the install-directory, our
> application runs again correctly.
> The strange thing is, that the "changed" MSJINT35.DLL is exactly the
> same as the original file. Version, Metadata, Language, Filesize, and
> even a Hex-based-compare result that the files are identically.
> Nevertheless, a copy of the file into system32 is a workaround to fix
> the problem for a few hours.
> ----
> Does anyone has any idea? PLEASE HELP!
>

Problems with a JET-ODBC-Connection and Access97-Runtime

I have a very strange problem with a JET-ODBC-Connection.
Using Access97-Runtime, we connect the table with a
DSN-less-ODBC-Connection to SQLServer 2000 SP3.
The Application runs on a Windows Server 2003 Terminal-Server with
CITRIX Metaframe.
Office 2003 is also installed (no Access2003)
And now the problem:
----
When our application is installed anew, the ODBC-Connection works fine.
When I start any Office2003-Application like Winword, the system files
MSJINT35.DLL and MSJTER35.DLL are changed. (I used ashampoo Uninstaller
Suite to check this issue).
Afterwards, our Application doesn't run anymore, the Application quits
without any error.
If I copy the MSJINT35.DLL anew from the install-directory, our
application runs again correctly.
The strange thing is, that the "changed" MSJINT35.DLL is exactly the
same as the original file. Version, Metadata, Language, Filesize, and
even a Hex-based-compare result that the files are identically.
Nevertheless, a copy of the file into system32 is a workaround to fix
the problem for a few hours.
----
Does anyone has any idea? PLEASE HELP!How are you installing the app? I use Wise Install Builder, which installs
the Access 97 runtime into it's own folder - C:\Program Files\Access 97
Runtime. It installs the DLLs in question into that folder, too. The reason
being - when an app looks for DLL's it starts with the folder the app
started in, then looks in the folders in the PATH environment variable (e.g.
System32). You could probably solve your problem by having your installer
put the DLLs in question into the Runtime folder.
"Andreas Lauffer" <alweb01@.online.de> wrote in message
news:1132133394.166634.268470@.z14g2000cwz.googlegroups.com...
> I have a very strange problem with a JET-ODBC-Connection.
> Using Access97-Runtime, we connect the table with a
> DSN-less-ODBC-Connection to SQLServer 2000 SP3.
> The Application runs on a Windows Server 2003 Terminal-Server with
> CITRIX Metaframe.
> Office 2003 is also installed (no Access2003)
> And now the problem:
> ----
> When our application is installed anew, the ODBC-Connection works fine.
> When I start any Office2003-Application like Winword, the system files
> MSJINT35.DLL and MSJTER35.DLL are changed. (I used ashampoo Uninstaller
> Suite to check this issue).
> Afterwards, our Application doesn't run anymore, the Application quits
> without any error.
> If I copy the MSJINT35.DLL anew from the install-directory, our
> application runs again correctly.
> The strange thing is, that the "changed" MSJINT35.DLL is exactly the
> same as the original file. Version, Metadata, Language, Filesize, and
> even a Hex-based-compare result that the files are identically.
> Nevertheless, a copy of the file into system32 is a workaround to fix
> the problem for a few hours.
> ----
> Does anyone has any idea? PLEASE HELP!
>

problems whit SQLServer and JDeveloper

I'm trying to open a new DB conection in JDeveloper 9. I've created a DB in SQL Server 2000 with one user called mta_ds.
When i look in JDeveloper the connection show me 3 users for that DB (dbo, guest and mta_ds), but with the only user that i can see the tables of the db is with dbo. both dbo and mta_ds had the same permisions and roles. So.. why i can't see the tables for mta_ds?? i've used one driver open source: Driver name = net.sourceforge.jtds.jdbc.Driver
url = jdbc:jtds://Tauros:1433/DB_Visa_MoraTemprana
Could be this the problem?

Pleaseeee Somebody help meeee!!!
THANK's A LOT!!!!Run SP_HELPROTECT from query analyzer and see the privileges for individual roles/users.

Problems while attaching a database in SQLServer 2000

Dear all,

I recive a error when i attaching a database in sqlserver 2000. The error is :-

An exception occurred while executing a T-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

Could not find row in sysindex for databases ID 12, object ID 1, index ID 1. Run DBCC CHECKTABLE on sysindexs.

Could not open new database 'ABC'. Create Database is aborted. (Microsoft SQL Server, Error: 602)

Are you attaching a database in SQL Server 2000 from a SQL Server 2005 Express? This won't work.|||Not in Express edition. I am trying it on Sql Server 2005 Enterprise Edition..|||

Hi Deepak,

could you post the t-sql used !!! and post Errors from SQL Error Logs too!!

Hemantgiri S. Gowami

|||

I recive a error when i attaching a database in sqlserver 2000. The error is :-

An exception occurred while executing a T-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

Could not find row in sysindex for databases ID 12, object ID 1, index ID 1. Run DBCC CHECKTABLE on sysindexs.

Could not open new database 'ABC'. Create Database is aborted. (Microsoft SQL Server, Error: 602)

|||

How I can solve the error when attaching a database in sqlserver 2000.

Could not find row in sysindex for databases ID 7, object ID 1, index ID 1. Run DBCC CHECKTABLE on sysindexs.

Could not open new database 'ABC'. Create Database is aborted. (Microsoft SQL Server, Error: 602)

Problems while attaching a database in SQLServer 2000

Dear all,

I recive a error when i attaching a database in sqlserver 2000. The error is :-

An exception occurred while executing a T-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

Could not find row in sysindex for databases ID 12, object ID 1, index ID 1. Run DBCC CHECKTABLE on sysindexs.

Could not open new database 'ABC'. Create Database is aborted. (Microsoft SQL Server, Error: 602)

Are you attaching a database in SQL Server 2000 from a SQL Server 2005 Express? This won't work.|||Not in Express edition. I am trying it on Sql Server 2005 Enterprise Edition..|||

Hi Deepak,

could you post the t-sql used !!! and post Errors from SQL Error Logs too!!

Hemantgiri S. Gowami

|||

I recive a error when i attaching a database in sqlserver 2000. The error is :-

An exception occurred while executing a T-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

Could not find row in sysindex for databases ID 12, object ID 1, index ID 1. Run DBCC CHECKTABLE on sysindexs.

Could not open new database 'ABC'. Create Database is aborted. (Microsoft SQL Server, Error: 602)

|||

How I can solve the error when attaching a database in sqlserver 2000.

Could not find row in sysindex for databases ID 7, object ID 1, index ID 1. Run DBCC CHECKTABLE on sysindexs.

Could not open new database 'ABC'. Create Database is aborted. (Microsoft SQL Server, Error: 602)

Problems while attaching a database in SQLServer 2000

Dear all,

I recive a error when i attaching a database in sqlserver 2000. The error is :-

An exception occurred while executing a T-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

Could not find row in sysindex for databases ID 12, object ID 1, index ID 1. Run DBCC CHECKTABLE on sysindexs.

Could not open new database 'ABC'. Create Database is aborted. (Microsoft SQL Server, Error: 602)

Are you attaching a database in SQL Server 2000 from a SQL Server 2005 Express? This won't work.|||Not in Express edition. I am trying it on Sql Server 2005 Enterprise Edition..|||

Hi Deepak,

could you post the t-sql used !!! and post Errors from SQL Error Logs too!!

Hemantgiri S. Gowami

|||

I recive a error when i attaching a database in sqlserver 2000. The error is :-

An exception occurred while executing a T-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

Could not find row in sysindex for databases ID 12, object ID 1, index ID 1. Run DBCC CHECKTABLE on sysindexs.

Could not open new database 'ABC'. Create Database is aborted. (Microsoft SQL Server, Error: 602)

|||

How I can solve the error when attaching a database in sqlserver 2000.

Could not find row in sysindex for databases ID 7, object ID 1, index ID 1. Run DBCC CHECKTABLE on sysindexs.

Could not open new database 'ABC'. Create Database is aborted. (Microsoft SQL Server, Error: 602)