Sql-server – Figuring out database timezone

sql serversql-server-2000timezone

Does anybody know of a way to alter a time zone on a SQL database?

Is there any tool that could find the objects using the date and time?

Best Answer

The easiest way I have used to see if any objects are using a particular command (e.g. those that use a local time zone, such as GETDATE() and CURRENT_TIMESTAMP) is syscomments. The text column of this table in SQL 2000 has the actual command that makes up the object.

The caveat to this is if the procedure was created using WITH ENCRYPTION you will not be able to see or check the text column. I believe something like this should return what you are looking for:

SELECT OBJECT_NAME(ID), Text
FROM syscomments
WHERE Text LIKE '%GetDate%'