Friday, January 23, 2009

.SQL Files Being Perceived as Text Files

When trying to open SQL File on the web through Internet Explore (IE) sometimes it will show the file right in IE because it thinks it is just a text file so does not prompt you to open the file or save it.

You can change this by editing the following Registry Key:

[HKEY_CLASSES_ROOT\.SQL]

Delete the Value "PerceivedType".
And change (Default) to "sqlwb.sql.9.0"

Tuesday, January 20, 2009

Error 14274: Cannot add, update, or delete a job (or its steps or schedule) that originated from an MSX server.

You can get this error when trying to modify the properties of a Job after the SQL Server has been renamed or cloned into another computer. When we create a job on SQL Server it creates an entry in sysjobs table logging the job and server originated from. We can fix this issue by updating the sysjobs table:

USE [msdb]
GO

UPDATE sysjobs
  
SET originating_server = 'NewServerName'
GO

In addition to jobs not working now the @@ServerName variable can also return invalid information, old server name. Because the @@ServerName gets the server information from the sysservers system table. We can fix this issue with following script:
USE [master]
GO

sp_dropserver 'OldServerName'
GO

sp_addserver 'NewServerName', 'local'
GO

You will have to restart the SQL Server to see the new changes.

About Me

My Photo
Mohit K. Gupta
I have a B.Sc. Computer Science with Minor in Japanese. I am currently working on my Masters in Information Systems. I spend most of my time on studies for research or for SQL Server related issues. My main interests revolve around Japan, to that regards, I practice Kendo (The Way of the Sword) and have been doing it for now about 5 Years. In addition I like to play Go (or Igo in Japanese) board game like chess, but maybe a bit more complicated. I am hoping to go to Japan in the future to further develop my Japanese, Go and Kendo skills.
View my complete profile

Certification & Degrees

  • MCITP: Database Administrator
  • MCTS: SQL Server 2005
  • B.Sc. Computer Science
  • Japanese Minor