Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Broken link

Author  Topic 

simflex
Constraint Violating Yak Guru

327 Posts

Posted - 2006-12-14 : 08:27:04
Greetings all,

We have a system that as I understand it, has been running fine for the last 3 years now.

The individual who built the system left the company.

I was hired to manage and maintain it.

Suddenly, a portion of it stopped working. There was no documentation on how the system works.

So, for the last 1 week now, I have been scratching my head trying to figure out what could be wrong.

Basically, the part that broke is the part that displays images.

From looking at the code, it appears that the code goes from one server to another remote server to grab the image, save the image on the current server, picks up the image from this current server (not the remote server where it was imported from) and displays it to the screen.

As I stated, over the past week, the images have been displaying and since the guy that built it is no longer with the company, I am having to go from code to code, t-sql to front end tool to try and figure what the codes do and why the images stopped displaying.

My question is, is it possible for someone to take a look at this below and explain what it is supposed to be doing?

exec master.dbo.xp_cmdshell 'net use z: \\196.46.22.2\wwwroot'

I changed the ip address to protect.

I just wanted to know what this code is doing with xp_cmdshell.

I know the the server where this command is issued doesn't have z drive. the z: is actually on the code

JoeNak
Constraint Violating Yak Guru

292 Posts

Posted - 2006-12-14 : 08:33:08
The command maps a drive on the server. Specifically it maps Z: to \\196.46.22.2\wwwroot
Go to Top of Page

simflex
Constraint Violating Yak Guru

327 Posts

Posted - 2006-12-14 : 08:45:58
I suspected so but I can't see that leter drive on the server.

Also, this is probably more of a network question but you might know the answer; how do I know what name is associated with that ip address?

Thanks for your quick response
Go to Top of Page

JoeNak
Constraint Violating Yak Guru

292 Posts

Posted - 2006-12-14 : 08:52:21
nslookup xxx.xxx.xxx.xxx
Go to Top of Page

simflex
Constraint Violating Yak Guru

327 Posts

Posted - 2006-12-14 : 09:10:53
Thanks again for your quick response.

One LAST one, I promise.

What is this t-sql doing?

CREATE PROCEDURE sp_getimages


AS
Set ansi_nulls on
Set ansi_warnings on
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
Go to Top of Page

simflex
Constraint Violating Yak Guru

327 Posts

Posted - 2006-12-14 : 09:16:08
What I was getting at with that last question is that I don't see any processes other than these 2 lines:

Set ansi_nulls on
Set ansi_warnings on

Are they supposed to mean anything?
Go to Top of Page

JoeNak
Constraint Violating Yak Guru

292 Posts

Posted - 2006-12-14 : 10:33:54
Not really. SET ANSI_NULLS ON means you can't use = or <> against Null values. SET ANSI_WARNINGS ON means warning will be generated on aggregate functions that contain NULLS.

You can read up in BOL.
Go to Top of Page
   

- Advertisement -