Showing posts with label old. Show all posts
Showing posts with label old. Show all posts

Tuesday, March 27, 2012

Clear Old Server Names Out Of SQL Server Service Manager

How can I Clear Old Server Names Out Of SQL Server Service
Manager. They are ghosts."Jay Kusch" <Jay.Kusch@.mm-games.com> wrote in message
news:067601c3c578$b3a92520$a001280a@.phx.gbl...
> How can I Clear Old Server Names Out Of SQL Server Service
> Manager. They are ghosts.
You mean the list of servers that display for selection to connect? I do not
believe that you can remove those... If you are talking about something
different, please respond with more detail.
Steve|||This list is kept in the registry
HKEY_CURRENT_USER\Software\Microsoft\MSSQLServer\Client\PrefServers
"Jay Kusch" <Jay.Kusch@.mm-games.com> wrote in message
news:01a601c3c584$82991010$a101280a@.phx.gbl...
> >--Original Message--
> >"Jay Kusch" <Jay.Kusch@.mm-games.com> wrote in message
> >news:067601c3c578$b3a92520$a001280a@.phx.gbl...
> >> How can I Clear Old Server Names Out Of SQL Server
> Service
> >> Manager. They are ghosts.
> >
> >You mean the list of servers that display for selection
> to connect? I do not
> >believe that you can remove those... If you are talking
> about something
> >different, please respond with more detail.
> >
> >Steve
> >
> >
> >
> >
> >.
> >
> Thanks Steve ...
> That was the answer that covers it all. We have had so
> many servers in and out of test and production that my
> server list is just unmanagable. Wish there were some way
> to clear the ghosts. Thanks and Happy Holidays!
> J. Kuschsqlsql

Sunday, March 25, 2012

Clean up old stored procedures

Is there a way to find out if a stored procedure has not been run in a
while?
Mike W wrote:
> Is there a way to find out if a stored procedure has not been run in a
> while?
Not directly. The best you can do is create a server-side trace that
traps the SP:Starting event. You do not need to bind the TextData, only
the ObjectID, DatabaseID. Let it run until you feel you'll get the best
collection of procedures. You can resolve the object names against the
sysobjects table in each database or use object_name() for the currently
selected database.
I would obviously test the removal in the deve environment before
removing any procedures from production.
David Gugick
Imceda Software
www.imceda.com

Clean up old stored procedures

Is there a way to find out if a stored procedure has not been run in a
while?Mike W wrote:
> Is there a way to find out if a stored procedure has not been run in a
> while?
Not directly. The best you can do is create a server-side trace that
traps the SP:Starting event. You do not need to bind the TextData, only
the ObjectID, DatabaseID. Let it run until you feel you'll get the best
collection of procedures. You can resolve the object names against the
sysobjects table in each database or use object_name() for the currently
selected database.
I would obviously test the removal in the deve environment before
removing any procedures from production.
David Gugick
Imceda Software
www.imceda.comsqlsql

Clean up old stored procedures

Is there a way to find out if a stored procedure has not been run in a
while?Mike W wrote:
> Is there a way to find out if a stored procedure has not been run in a
> while?
Not directly. The best you can do is create a server-side trace that
traps the SP:Starting event. You do not need to bind the TextData, only
the ObjectID, DatabaseID. Let it run until you feel you'll get the best
collection of procedures. You can resolve the object names against the
sysobjects table in each database or use object_name() for the currently
selected database.
I would obviously test the removal in the deve environment before
removing any procedures from production.
David Gugick
Imceda Software
www.imceda.com

Clean old backup with retaindays

Hi,
i have 3 sql server, one with sql2000 and other with sql2005.
on each server i have a maintenance plan. this plan save all base to a
network share on another server.
all plans have the option retaindays at 2.
the sql2000 server clean correctly the old backup. but the sql2005 servers
don' t do it.
all the sql service are running under the same account.
i applied patch on a sql2005 at 3152, the other is always at 3042. but
nothing change.
everydays i muste clean manually the backup...retaindays don't work!
someone have an idea about this bug ?
Ty
ChristopheChristophe,
It's not a bug, it's a feature. :) I assume that you are using the
Maintenance Plans. One thing to know is that the option RETAINDAYS does not
actually delete anything, it is just marking the file to tell SQL Server not
to overwrite this file before the retain time is up.
If you are using SQL 2000 Legacy Maintenance Plans, check the Complete
Backup and Transaction Log Backup tabs and make sure that "Remove files
older than" is set.
If you are using SQL 2005 Maintenance plans, you also need to include the
Maintenance Cleanup task to specify file deletions.
RLF
"Christophe" <Christophe@.discussions.microsoft.com> wrote in message
news:C14216B5-32AA-4D94-972C-122D864DEA51@.microsoft.com...
> Hi,
> i have 3 sql server, one with sql2000 and other with sql2005.
> on each server i have a maintenance plan. this plan save all base to a
> network share on another server.
> all plans have the option retaindays at 2.
> the sql2000 server clean correctly the old backup. but the sql2005 servers
> don' t do it.
> all the sql service are running under the same account.
> i applied patch on a sql2005 at 3152, the other is always at 3042. but
> nothing change.
> everydays i muste clean manually the backup...retaindays don't work!
> someone have an idea about this bug ?
> Ty
> Christophe|||ty very much ! ;)
"Russell Fields" wrote:
> Christophe,
> It's not a bug, it's a feature. :) I assume that you are using the
> Maintenance Plans. One thing to know is that the option RETAINDAYS does not
> actually delete anything, it is just marking the file to tell SQL Server not
> to overwrite this file before the retain time is up.
> If you are using SQL 2000 Legacy Maintenance Plans, check the Complete
> Backup and Transaction Log Backup tabs and make sure that "Remove files
> older than" is set.
> If you are using SQL 2005 Maintenance plans, you also need to include the
> Maintenance Cleanup task to specify file deletions.
> RLF
>
> "Christophe" <Christophe@.discussions.microsoft.com> wrote in message
> news:C14216B5-32AA-4D94-972C-122D864DEA51@.microsoft.com...
> > Hi,
> >
> > i have 3 sql server, one with sql2000 and other with sql2005.
> > on each server i have a maintenance plan. this plan save all base to a
> > network share on another server.
> > all plans have the option retaindays at 2.
> > the sql2000 server clean correctly the old backup. but the sql2005 servers
> > don' t do it.
> > all the sql service are running under the same account.
> > i applied patch on a sql2005 at 3152, the other is always at 3042. but
> > nothing change.
> >
> > everydays i muste clean manually the backup...retaindays don't work!
> > someone have an idea about this bug ?
> >
> > Ty
> > Christophe
>
>

Thursday, March 8, 2012

Chinese character in the field (Sql 7)

Guys,
I have to replace some old chinese characters (words) with some new
ones. In the database, the fields are displayed as ?.
The current chinese characters will display fine when you retrieved the
fields through the website. As soon as I cut and paste the new chinese
characters onto the field that I want to replace, the website will
display ? with the fields that I just updated.
I have installed the Chinese (Taiwan) letters and enable my language
toolbar. During the cut and paste process, I also switched to "CH".
Any idea?
Please help.
Thanks in advance,
TonyHi,
You can try to use CAST(0xABCD1234 as NVARCHAR(4)) etc. instead of copy and
paste.
Replace the 0xABCD1234 with the binary code of the Chinese characters.
Kenneth
<tractng@.gmail.com> wrote in message
news:1132790630.847208.228190@.z14g2000cwz.googlegroups.com...
> Guys,
> I have to replace some old chinese characters (words) with some new
> ones. In the database, the fields are displayed as ?.
> The current chinese characters will display fine when you retrieved the
> fields through the website. As soon as I cut and paste the new chinese
> characters onto the field that I want to replace, the website will
> display ? with the fields that I just updated.
>
> I have installed the Chinese (Taiwan) letters and enable my language
> toolbar. During the cut and paste process, I also switched to "CH".
> Any idea?
> Please help.
>
> Thanks in advance,
> Tony
>|||Kenneth,
Can you explain, how I can do this. I am a newbie.
Thanks,
Tony

Sunday, February 19, 2012

Checking if String is NULL or EMPTY in SQL

I need to check in my Stored procedure if the information passed is null or empty so I can decided to insert the new value or keep the old. How do I accomplish this please in T-SQL. Thanks in advance.

IFISNULL(@.param)OR @.param =''THEN doSomething...
(Note the two apostrophes ' and ', not a quote mark!)
|||

Books online (help files that comes with SQL) is an amzing little app. Below is an example and the Syntax.

USE pubsGOSELECTAVG(ISNULL(price, $10.00))FROM titlesGOISNULL ( check_expression , replacement_value )
|||

Create Procedure mySpNameHere

@.InputValueHere VARCHAR(50) = NULL

AS

IF @.InputValue IS NULL OR @.InputValue = ''

/*Keep the old value*/

ELSE

/*Run the update statement here with your new value*/

|||

cheetahtech:

ISNULL ( check_expression , replacement_value )

Sorry. I got a blackout. Of course, ISNULL syntax is to be used in a query where you want to specify an alternative value, if the expression is NULL.

The correct way to check for NULL in a condition is IF @.Param IS NULL as rich freeman points out.