Tuesday, November 30, 2004

Pro SQL Server Reporting Services


Just got this new book on Reporting Services ... VERY good book. If you are just starting out or need help with some good examples, I highly recommend this book.

Stored procedure to find all instances of a field

As a report writer, database administrator, developer or user, it may be useful to know which table a field exists in. Many third party vendors don't supply a data schema, making it difficult to query and build reports. This stored procedure is a simple method of searching through all the table in the current database for a field that you specify.

While you certainly cannot assume that because two tables have the same field that they are related, this will certainly be at least one tool you can use to help find those relationships.

CREATE PROCEDURE dbo.sp_FieldInfo
(
@Column_Name nvarchar(384) = NULL
)
AS
SELECT Object_Name(id) as 'Table Name',
rtrim(Name) as 'Field Name'
FROM syscolumns
WHERE name like @Column_Name
GO

Then to call this proc:
sp_fieldinfo employeeid

Wednesday, November 24, 2004

Email attachment limits

What a pain it is when you want to email someone a large file only to find out Hotmail, Gmail, Yahoo, or any of the other numerous email providers don't support large attachments - most only allow up to 10mb. 10MB?? With today's focus on media (pictures, movies, songs, etc.) - how can I email a bunch of pictures in one big zip file?

Yousendit has started a service which will allow you to email large attachments to somebody - up to 1 GIG!! THAT'S more like it! Using the yousendit website, you upload your file, enter the email addresses you want it sent to, a link is sent to them via email, they click on the link to download the file. Your file is stored for seven days, then deleted. VERY COOL!

Tuesday, November 16, 2004

Office Developer Center: VBA Language References

Office Developer Center: VBA Language References

Microsoft has recently published the language references for all of the Office 2003 applications. You can view them online or download them.

If you are a VBA programmer, you should download these useful references.

Blogging on Visio

Blogging on Visio

Just found another great blog with very useful tips and techniques using Microsoft Visio. For some strange reason, Visio seems to have very little documentation and there aren't many Visio books available. If you see other Visio sites or have any books to recommend, please post in the comments - thanks!

Thursday, November 04, 2004

Microsoft Photo Story 3 for Windows: make show-n-tell cool again

Microsoft Photo Story 3 for Windows: make show-n-tell cool again

If you are into photo editing or you share your photos with friends and family - you gotta check this out! Microsoft Photo Story 3 - it's free!!!

Bring life into your favorite memories with Photo Story 3 for Windows by adding motion, effects, music, and more to your digital photos. Easily retouch your images with a single click and add slick-looking titles, or add dramatic pans and zooms that give your creations a professional finish, create a soundtrack - even record narration. Then enjoy the show. Start sharing your stories today!

Retrieve current username from windows using VBA

Ever needed to retrieve username of the person currently logged into Windows? Using VBA in any of the Office products, the following code will return the current username. Great for implementing your own security or auditing.

' Makes sure all variables are dimensioned in each subroutine.
Option Explicit

' Access the GetUserNameA function in advapi32.dll and
' call the function GetUserName.
Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" _
(ByVal lpBuffer As String, nSize As Long) As Long

' Main routine to Dimension variables, retrieve user name
' and display answer.
Sub Get_User_Name()

' Dimension variables
Dim lpBuff As String * 25
Dim ret As Long, UserName As String

' Get the user name minus any trailing spaces found in the name.
ret = GetUserName(lpBuff, 25)
UserName = Left(lpBuff, InStr(lpBuff, Chr(0)) - 1)

' Display the User Name
MsgBox UserName
End Sub

Wednesday, November 03, 2004

Library of Free Data Models

Library of Free Data Models

Reading the news groups today, I came across this little gem of a website. If you are just starting out with database design or need help coming up with a data model, this website gives some EXCELLENT examples of well designed databases.