Author Archives: paulwinans

database mail problem

What to do if database mail is not working. Mail was not being sent. First I queried SELECT * FROM msdb.dbo.sysmail_event_log and saw in the description field “The mail could not be sent to the recipients because of the mail … Continue reading

Posted in DBA | Leave a comment

sql traces

I was asked to trace department’s access to a certain sql server here. To create a trace that is run by sql server, open profiler and define your trace. Then, while it is not running, you can script it by … Continue reading

Posted in DBA | Leave a comment

Using SQL DMO to read DTS Packages

There is a column name and defination change and lots of code has to be examined. The developers were worried about looking through the many DTS packages. Happily the contents can be queried using sql-dmo. The short of it is … Continue reading

Posted in SQL DMO | Tagged | Leave a comment

Finding a job

One of my friends asked me how I found a job so fast after such a long vacation. Here is what I wrote to her: Does your resume shout out that you meet the job poster’s qualifications requirements? Here is my … Continue reading

Posted in DBA, Employment | Leave a comment

using sp_msforeachdb

I really like sp_msforeachdb. For example, here is the sql to my regular maintenance jobs: exec sp_MSforeachdb ‘DBCC CHECKDB(?) with NO_INFOMSGS, ALL_ERRORMSGS’ exec sp_msforeachdb ‘if db_id(”?”) <> db_id(”master”) and db_id(”?”) <> db_id(”tempdb”) begin use [?];exec sp_dbreindex_or_indexdefrag;end’ exec sp_msforeachdb ‘if db_id(”?”) … Continue reading

Posted in Day to day, DBA | Leave a comment

Concatenating rows

We decided to use the data driven subscriptions for SSRS. This means storing all kinds of info in a database and then having to present it to the report server as subscription parameters. Specifically we have to concatenate a bunch … Continue reading

Posted in SQL, SSRS | Tagged | Leave a comment

Removing a startup stored procedure

In my combing through of the sql servers I found a startup stored procedure on one of the sql servers here. I didn’t recognize the tables it created or its name, so I asked around: no one else knew anything either. … Continue reading

Posted in DBA | Leave a comment

Cleaning up sql job ownership

We have a lot of jobs owned by many different accounts due to the currently lax security. Before cleaning up the local admins group and removing all sysadmin role members it is important to make sure the jobs that are … Continue reading

Posted in Day to day, DBA | Tagged | Leave a comment

SQL Server 2000 sp4 and Memory

I configured 3 of the development sql servers to use the available memory last night. 2 had 8gb; 1 had 4. The one with 4 just required adding the /3GB and a restart; for the other two I modified the … Continue reading

Posted in DBA | Leave a comment

SQL Blogs I like

http://www.sqlskills.com/BLOGS/PAUL/ http://www.sqlskills.com/BLOGS/KIMBERLY/ http://sqlfool.com/ http://sqlinthewild.co.za/

Posted in Day to day, DBA | Leave a comment