Showing posts with label sqlserver. Show all posts
Showing posts with label sqlserver. Show all posts

Sunday, March 25, 2012

Can not create Job on SQL2005

Could not create SQL jobs. Getting Error:

Unable to cast object of type 'Microsoft.SqlServer.Management.Smo.SimpleObjectKey' to type
'Microsoft.SqlServer.Management.Smo.Agent.JobObjectKey'. (Microsoft.SqlServer.Smo)

- Tried several different job types, always same result.
- Installing SP1 or SP2 does not help.
- Installing with or without Integration Service does not help.

Any help is highly appreciated

Thanks.

Try this:

Dim strDBName As String
Dim strJobID As Guid
Dim jobDumpJob As Job
Dim jbsDumpJobStep As JobStep
Dim intStepID As Integer

' Connect to the server
Dim srvMgmtServer As Server
srvMgmtServer = New Server("MyServer")
Dim srvConn As ServerConnection
srvConn = srvMgmtServer.ConnectionContext
srvConn.LoginSecure = True

strDBName = dbDatabase.Name
jobDumpJob = New Job(srvMgmtServer.JobServer, "YourJobName")
jobDumpJob.Description = "Job Description"
jobDumpJob.Category = "[Uncategorized (Local)]"
jobDumpJob.OwnerLoginName = "sa"
jobDumpJob.Create()
strJobID = jobDumpJob.JobID

jbsDumpJobStep = New JobStep(jobDumpJob, "Step 1")
jbsDumpJobStep.DatabaseName = "UserDB"
jbsDumpJobStep.Command = "TSQL command"
jbsDumpJobStep.OnSuccessAction = StepCompletionAction.QuitWithSuccess
jbsDumpJobStep.OnFailAction = StepCompletionAction.QuitWithFailure
jbsDumpJobStep.Create()
intStepID = jbsDumpJobStep.ID

jobDumpJob.ApplyToTargetServer(srvMgmtServer.Name)
jobDumpJob.StartStepID = intStepID
jobDumpJob.Alter()

|||

Hi

I am also having this problem.

Im trying to create a job to run SQL Server Integration Package.

The Code that you have given above. What is that for?

Thanks

|||This code uses SMO in VB.Net to create a job to execute a TSQL command. Browse around in ObjectBrowser and you should find the properties necessary to execute a SSIS package.|||

I can execute the SISS Package.

But i want to execute it within a job.

Is there any tutorials for creating jobs that i could look at?

|||for some reason it works on an another machine. I dont no why.|||

I figured it out. Despite you could install Management Tool on any computer it will work only on machine that have SQL Server 2005 SP2 installed.

|||Try installing SP2 for the client components on all computers taht run management studio, reboot, then try again from management studio client.|||

Identical problems here--also tried the new hotfix as well.

We've held off rolling out SP2 due to these and other errors. Until someone deals with these problems I suppose my company is stuck.

|||Check whether Distributed Transaction Coordinator service is started. If not, start it and try again.|||

We have a sql2005 installation that I've created jobs on routinely for months and then today we hit this message. I'm not going to install SP2 just yet since some users report that it doesn't help.

The details from the error message are as follows. Any help would be much appreciated. I deleted all SSIS packages and Jobs with no luck. We've rebooted and cycled services per suggestions from users.

The original error message:

TITLE: Microsoft SQL Server Management Studio

Unable to cast object of type 'Microsoft.SqlServer.Management.Smo.SimpleObjectKey' to type 'Microsoft.SqlServer.Management.Smo.Agent.JobObjectKey'. (Microsoft.SqlServer.Smo)


BUTTONS:

OK

Technical details

===================================

Unable to cast object of type 'Microsoft.SqlServer.Management.Smo.SimpleObjectKey' to type 'Microsoft.SqlServer.Management.Smo.Agent.JobObjectKey'. (Microsoft.SqlServer.Smo)


Program Location:

at Microsoft.SqlServer.Management.Smo.Agent.JobCollection.GetObjectByKey(ObjectKeyBase key)
at Microsoft.SqlServer.Management.Smo.SimpleObjectCollectionBase.Contains(String name)
at Microsoft.SqlServer.Management.SqlManagerUI.JobData.JobExists(String jobName)
at Microsoft.SqlServer.Management.SqlManagerUI.JobData.ApplyChanges()
at Microsoft.SqlServer.Management.SqlManagerUI.JobPropertySheet.DoPreProcessExecution(RunType runType, ExecutionMode& executionResult)
at Microsoft.SqlServer.Management.SqlMgmt.SqlMgmtTreeViewControl.DoPreProcessExecutionAndRunViews(RunType runType)
at Microsoft.SqlServer.Management.SqlMgmt.SqlMgmtTreeViewControl.ExecuteForSql(PreProcessExecutionInfo executionInfo, ExecutionMode& executionResult)
at Microsoft.SqlServer.Management.SqlMgmt.SqlMgmtTreeViewControl.Microsoft.SqlServer.Management.SqlMgmt.IExecutionAwareSqlControlCollection.PreProcessExecution(PreProcessExecutionInfo executionInfo, ExecutionMode& executionResult)
at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.RunNow(RunType runType, Object sender)

|||

Hi folks,

I too had the same exact error when trying to schedule a package. After reading numerous posts and forums, some people have said

SP2 solved their problems and some said it didn't.

Here's what I did to get it to work.

On our SQL Server 2005 development machine, we did install SP2

however, that doesn't solve the problem because the problem lies in scheduling your job using Management Studio through your local machine. If you logged onto your SQL 2005 server that has SP2, you should be able to schedule from there. But it's through Management Studio, which I'm guessing most of you are trying to create a job schedule for your packages. Usually, people don't think of upgrading their client tools as well.

I verified this by upgrading my local machine to SP2 for the client tools and was able to successfully schedule. You might also need to upgrade your server machine to SP2 to work as well.

I hope this helps.

-SX

|||

I finally uninstalled all SQL related products and services, reinstalled everything, added hot fixes and finally we have two of the three servers working--mostly. There are still occaisional errors, but most seem limited to SSMS' and its UI

I haven't rolled SP2 to production yet and won't be adding any new SQL servers to our mix until this mess settles. I thought we'd be going to some of the better features (like Mirroring) later this year but now it'll be Q1'08 at the earliest.

Haven't had this much fun since SQL2KSP4! Keep smiling....

|||

Hello Visgor Allen and others!

Thank you for reporting this problem, and sorry for the problems that you are experiencing.

I'd like to understand this issue better so we can provide guidance to other customers. Can somebody on this thread please provide more details on how to repro this problem:

1) What is the initial configuration on both server and client machines (if different)? Is it SQL Server 2005 RTM or SP1?

2) Does the problem reproduce after upgrading client/server/both machines to SP2?

3) From what machine (client/server) are you trying to create a new job?

Thanks in advance!

|||

Unable to create new jobs in sql 2005, SSIS service is running. Finally i was surfing net for solution and understood need to install SP2 in my machine. But if i need to create new jobs in remote system what should i do.

Please suggest me a solution.

Can not create Job on SQL2005

Could not create SQL jobs. Getting Error:

Unable to cast object of type 'Microsoft.SqlServer.Management.Smo.SimpleObjectKey' to type
'Microsoft.SqlServer.Management.Smo.Agent.JobObjectKey'. (Microsoft.SqlServer.Smo)

- Tried several different job types, always same result.
- Installing SP1 or SP2 does not help.
- Installing with or without Integration Service does not help.

Any help is highly appreciated

Thanks.

Try this:

Dim strDBName As String
Dim strJobID As Guid
Dim jobDumpJob As Job
Dim jbsDumpJobStep As JobStep
Dim intStepID As Integer

' Connect to the server
Dim srvMgmtServer As Server
srvMgmtServer = New Server("MyServer")
Dim srvConn As ServerConnection
srvConn = srvMgmtServer.ConnectionContext
srvConn.LoginSecure = True

strDBName = dbDatabase.Name
jobDumpJob = New Job(srvMgmtServer.JobServer, "YourJobName")
jobDumpJob.Description = "Job Description"
jobDumpJob.Category = "[Uncategorized (Local)]"
jobDumpJob.OwnerLoginName = "sa"
jobDumpJob.Create()
strJobID = jobDumpJob.JobID

jbsDumpJobStep = New JobStep(jobDumpJob, "Step 1")
jbsDumpJobStep.DatabaseName = "UserDB"
jbsDumpJobStep.Command = "TSQL command"
jbsDumpJobStep.OnSuccessAction = StepCompletionAction.QuitWithSuccess
jbsDumpJobStep.OnFailAction = StepCompletionAction.QuitWithFailure
jbsDumpJobStep.Create()
intStepID = jbsDumpJobStep.ID

jobDumpJob.ApplyToTargetServer(srvMgmtServer.Name)
jobDumpJob.StartStepID = intStepID
jobDumpJob.Alter()

|||

Hi

I am also having this problem.

Im trying to create a job to run SQL Server Integration Package.

The Code that you have given above. What is that for?

Thanks

|||This code uses SMO in VB.Net to create a job to execute a TSQL command. Browse around in ObjectBrowser and you should find the properties necessary to execute a SSIS package.|||

I can execute the SISS Package.

But i want to execute it within a job.

Is there any tutorials for creating jobs that i could look at?

|||for some reason it works on an another machine. I dont no why.|||

I figured it out. Despite you could install Management Tool on any computer it will work only on machine that have SQL Server 2005 SP2 installed.

|||Try installing SP2 for the client components on all computers taht run management studio, reboot, then try again from management studio client.|||

Identical problems here--also tried the new hotfix as well.

We've held off rolling out SP2 due to these and other errors. Until someone deals with these problems I suppose my company is stuck.

|||Check whether Distributed Transaction Coordinator service is started. If not, start it and try again.|||

We have a sql2005 installation that I've created jobs on routinely for months and then today we hit this message. I'm not going to install SP2 just yet since some users report that it doesn't help.

The details from the error message are as follows. Any help would be much appreciated. I deleted all SSIS packages and Jobs with no luck. We've rebooted and cycled services per suggestions from users.

The original error message:

TITLE: Microsoft SQL Server Management Studio

Unable to cast object of type 'Microsoft.SqlServer.Management.Smo.SimpleObjectKey' to type 'Microsoft.SqlServer.Management.Smo.Agent.JobObjectKey'. (Microsoft.SqlServer.Smo)


BUTTONS:

OK

Technical details

===================================

Unable to cast object of type 'Microsoft.SqlServer.Management.Smo.SimpleObjectKey' to type 'Microsoft.SqlServer.Management.Smo.Agent.JobObjectKey'. (Microsoft.SqlServer.Smo)


Program Location:

at Microsoft.SqlServer.Management.Smo.Agent.JobCollection.GetObjectByKey(ObjectKeyBase key)
at Microsoft.SqlServer.Management.Smo.SimpleObjectCollectionBase.Contains(String name)
at Microsoft.SqlServer.Management.SqlManagerUI.JobData.JobExists(String jobName)
at Microsoft.SqlServer.Management.SqlManagerUI.JobData.ApplyChanges()
at Microsoft.SqlServer.Management.SqlManagerUI.JobPropertySheet.DoPreProcessExecution(RunType runType, ExecutionMode& executionResult)
at Microsoft.SqlServer.Management.SqlMgmt.SqlMgmtTreeViewControl.DoPreProcessExecutionAndRunViews(RunType runType)
at Microsoft.SqlServer.Management.SqlMgmt.SqlMgmtTreeViewControl.ExecuteForSql(PreProcessExecutionInfo executionInfo, ExecutionMode& executionResult)
at Microsoft.SqlServer.Management.SqlMgmt.SqlMgmtTreeViewControl.Microsoft.SqlServer.Management.SqlMgmt.IExecutionAwareSqlControlCollection.PreProcessExecution(PreProcessExecutionInfo executionInfo, ExecutionMode& executionResult)
at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.RunNow(RunType runType, Object sender)

|||

Hi folks,

I too had the same exact error when trying to schedule a package. After reading numerous posts and forums, some people have said

SP2 solved their problems and some said it didn't.

Here's what I did to get it to work.

On our SQL Server 2005 development machine, we did install SP2

however, that doesn't solve the problem because the problem lies in scheduling your job using Management Studio through your local machine. If you logged onto your SQL 2005 server that has SP2, you should be able to schedule from there. But it's through Management Studio, which I'm guessing most of you are trying to create a job schedule for your packages. Usually, people don't think of upgrading their client tools as well.

I verified this by upgrading my local machine to SP2 for the client tools and was able to successfully schedule. You might also need to upgrade your server machine to SP2 to work as well.

I hope this helps.

-SX

|||

I finally uninstalled all SQL related products and services, reinstalled everything, added hot fixes and finally we have two of the three servers working--mostly. There are still occaisional errors, but most seem limited to SSMS' and its UI

I haven't rolled SP2 to production yet and won't be adding any new SQL servers to our mix until this mess settles. I thought we'd be going to some of the better features (like Mirroring) later this year but now it'll be Q1'08 at the earliest.

Haven't had this much fun since SQL2KSP4! Keep smiling....

|||

Hello Visgor Allen and others!

Thank you for reporting this problem, and sorry for the problems that you are experiencing.

I'd like to understand this issue better so we can provide guidance to other customers. Can somebody on this thread please provide more details on how to repro this problem:

1) What is the initial configuration on both server and client machines (if different)? Is it SQL Server 2005 RTM or SP1?

2) Does the problem reproduce after upgrading client/server/both machines to SP2?

3) From what machine (client/server) are you trying to create a new job?

Thanks in advance!

|||

Unable to create new jobs in sql 2005, SSIS service is running. Finally i was surfing net for solution and understood need to install SP2 in my machine. But if i need to create new jobs in remote system what should i do.

Please suggest me a solution.

Can not create Job on SQL2005

Could not create SQL jobs. Getting Error:

Unable to cast object of type 'Microsoft.SqlServer.Management.Smo.SimpleObjectKey' to type
'Microsoft.SqlServer.Management.Smo.Agent.JobObjectKey'. (Microsoft.SqlServer.Smo)

- Tried several different job types, always same result.
- Installing SP1 or SP2 does not help.
- Installing with or without Integration Service does not help.

Any help is highly appreciated

Thanks.

Try this:

Dim strDBName As String
Dim strJobID As Guid
Dim jobDumpJob As Job
Dim jbsDumpJobStep As JobStep
Dim intStepID As Integer

' Connect to the server
Dim srvMgmtServer As Server
srvMgmtServer = New Server("MyServer")
Dim srvConn As ServerConnection
srvConn = srvMgmtServer.ConnectionContext
srvConn.LoginSecure = True

strDBName = dbDatabase.Name
jobDumpJob = New Job(srvMgmtServer.JobServer, "YourJobName")
jobDumpJob.Description = "Job Description"
jobDumpJob.Category = "[Uncategorized (Local)]"
jobDumpJob.OwnerLoginName = "sa"
jobDumpJob.Create()
strJobID = jobDumpJob.JobID

jbsDumpJobStep = New JobStep(jobDumpJob, "Step 1")
jbsDumpJobStep.DatabaseName = "UserDB"
jbsDumpJobStep.Command = "TSQL command"
jbsDumpJobStep.OnSuccessAction = StepCompletionAction.QuitWithSuccess
jbsDumpJobStep.OnFailAction = StepCompletionAction.QuitWithFailure
jbsDumpJobStep.Create()
intStepID = jbsDumpJobStep.ID

jobDumpJob.ApplyToTargetServer(srvMgmtServer.Name)
jobDumpJob.StartStepID = intStepID
jobDumpJob.Alter()

|||

Hi

I am also having this problem.

Im trying to create a job to run SQL Server Integration Package.

The Code that you have given above. What is that for?

Thanks

|||This code uses SMO in VB.Net to create a job to execute a TSQL command. Browse around in ObjectBrowser and you should find the properties necessary to execute a SSIS package.|||

I can execute the SISS Package.

But i want to execute it within a job.

Is there any tutorials for creating jobs that i could look at?

|||for some reason it works on an another machine. I dont no why.|||

I figured it out. Despite you could install Management Tool on any computer it will work only on machine that have SQL Server 2005 SP2 installed.

|||Try installing SP2 for the client components on all computers taht run management studio, reboot, then try again from management studio client.|||

Identical problems here--also tried the new hotfix as well.

We've held off rolling out SP2 due to these and other errors. Until someone deals with these problems I suppose my company is stuck.

|||Check whether Distributed Transaction Coordinator service is started. If not, start it and try again.|||

We have a sql2005 installation that I've created jobs on routinely for months and then today we hit this message. I'm not going to install SP2 just yet since some users report that it doesn't help.

The details from the error message are as follows. Any help would be much appreciated. I deleted all SSIS packages and Jobs with no luck. We've rebooted and cycled services per suggestions from users.

The original error message:

TITLE: Microsoft SQL Server Management Studio

Unable to cast object of type 'Microsoft.SqlServer.Management.Smo.SimpleObjectKey' to type 'Microsoft.SqlServer.Management.Smo.Agent.JobObjectKey'. (Microsoft.SqlServer.Smo)


BUTTONS:

OK

Technical details

===================================

Unable to cast object of type 'Microsoft.SqlServer.Management.Smo.SimpleObjectKey' to type 'Microsoft.SqlServer.Management.Smo.Agent.JobObjectKey'. (Microsoft.SqlServer.Smo)


Program Location:

at Microsoft.SqlServer.Management.Smo.Agent.JobCollection.GetObjectByKey(ObjectKeyBase key)
at Microsoft.SqlServer.Management.Smo.SimpleObjectCollectionBase.Contains(String name)
at Microsoft.SqlServer.Management.SqlManagerUI.JobData.JobExists(String jobName)
at Microsoft.SqlServer.Management.SqlManagerUI.JobData.ApplyChanges()
at Microsoft.SqlServer.Management.SqlManagerUI.JobPropertySheet.DoPreProcessExecution(RunType runType, ExecutionMode& executionResult)
at Microsoft.SqlServer.Management.SqlMgmt.SqlMgmtTreeViewControl.DoPreProcessExecutionAndRunViews(RunType runType)
at Microsoft.SqlServer.Management.SqlMgmt.SqlMgmtTreeViewControl.ExecuteForSql(PreProcessExecutionInfo executionInfo, ExecutionMode& executionResult)
at Microsoft.SqlServer.Management.SqlMgmt.SqlMgmtTreeViewControl.Microsoft.SqlServer.Management.SqlMgmt.IExecutionAwareSqlControlCollection.PreProcessExecution(PreProcessExecutionInfo executionInfo, ExecutionMode& executionResult)
at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.RunNow(RunType runType, Object sender)

|||

Hi folks,

I too had the same exact error when trying to schedule a package. After reading numerous posts and forums, some people have said

SP2 solved their problems and some said it didn't.

Here's what I did to get it to work.

On our SQL Server 2005 development machine, we did install SP2

however, that doesn't solve the problem because the problem lies in scheduling your job using Management Studio through your local machine. If you logged onto your SQL 2005 server that has SP2, you should be able to schedule from there. But it's through Management Studio, which I'm guessing most of you are trying to create a job schedule for your packages. Usually, people don't think of upgrading their client tools as well.

I verified this by upgrading my local machine to SP2 for the client tools and was able to successfully schedule. You might also need to upgrade your server machine to SP2 to work as well.

I hope this helps.

-SX

|||

I finally uninstalled all SQL related products and services, reinstalled everything, added hot fixes and finally we have two of the three servers working--mostly. There are still occaisional errors, but most seem limited to SSMS' and its UI

I haven't rolled SP2 to production yet and won't be adding any new SQL servers to our mix until this mess settles. I thought we'd be going to some of the better features (like Mirroring) later this year but now it'll be Q1'08 at the earliest.

Haven't had this much fun since SQL2KSP4! Keep smiling....

|||

Hello Visgor Allen and others!

Thank you for reporting this problem, and sorry for the problems that you are experiencing.

I'd like to understand this issue better so we can provide guidance to other customers. Can somebody on this thread please provide more details on how to repro this problem:

1) What is the initial configuration on both server and client machines (if different)? Is it SQL Server 2005 RTM or SP1?

2) Does the problem reproduce after upgrading client/server/both machines to SP2?

3) From what machine (client/server) are you trying to create a new job?

Thanks in advance!

|||

Unable to create new jobs in sql 2005, SSIS service is running. Finally i was surfing net for solution and understood need to install SP2 in my machine. But if i need to create new jobs in remote system what should i do.

Please suggest me a solution.

Can not create Job on SQL2005

Could not create SQL jobs. Getting Error:

Unable to cast object of type 'Microsoft.SqlServer.Management.Smo.SimpleObjectKey' to type
'Microsoft.SqlServer.Management.Smo.Agent.JobObjectKey'. (Microsoft.SqlServer.Smo)

- Tried several different job types, always same result.
- Installing SP1 or SP2 does not help.
- Installing with or without Integration Service does not help.

Any help is highly appreciated

Thanks.

Try this:

Dim strDBName As String
Dim strJobID As Guid
Dim jobDumpJob As Job
Dim jbsDumpJobStep As JobStep
Dim intStepID As Integer

' Connect to the server
Dim srvMgmtServer As Server
srvMgmtServer = New Server("MyServer")
Dim srvConn As ServerConnection
srvConn = srvMgmtServer.ConnectionContext
srvConn.LoginSecure = True

strDBName = dbDatabase.Name
jobDumpJob = New Job(srvMgmtServer.JobServer, "YourJobName")
jobDumpJob.Description = "Job Description"
jobDumpJob.Category = "[Uncategorized (Local)]"
jobDumpJob.OwnerLoginName = "sa"
jobDumpJob.Create()
strJobID = jobDumpJob.JobID

jbsDumpJobStep = New JobStep(jobDumpJob, "Step 1")
jbsDumpJobStep.DatabaseName = "UserDB"
jbsDumpJobStep.Command = "TSQL command"
jbsDumpJobStep.OnSuccessAction = StepCompletionAction.QuitWithSuccess
jbsDumpJobStep.OnFailAction = StepCompletionAction.QuitWithFailure
jbsDumpJobStep.Create()
intStepID = jbsDumpJobStep.ID

jobDumpJob.ApplyToTargetServer(srvMgmtServer.Name)
jobDumpJob.StartStepID = intStepID
jobDumpJob.Alter()

|||

Hi

I am also having this problem.

Im trying to create a job to run SQL Server Integration Package.

The Code that you have given above. What is that for?

Thanks

|||This code uses SMO in VB.Net to create a job to execute a TSQL command. Browse around in ObjectBrowser and you should find the properties necessary to execute a SSIS package.|||

I can execute the SISS Package.

But i want to execute it within a job.

Is there any tutorials for creating jobs that i could look at?

|||for some reason it works on an another machine. I dont no why.|||

I figured it out. Despite you could install Management Tool on any computer it will work only on machine that have SQL Server 2005 SP2 installed.

|||Try installing SP2 for the client components on all computers taht run management studio, reboot, then try again from management studio client.|||

Identical problems here--also tried the new hotfix as well.

We've held off rolling out SP2 due to these and other errors. Until someone deals with these problems I suppose my company is stuck.

|||Check whether Distributed Transaction Coordinator service is started. If not, start it and try again.|||

We have a sql2005 installation that I've created jobs on routinely for months and then today we hit this message. I'm not going to install SP2 just yet since some users report that it doesn't help.

The details from the error message are as follows. Any help would be much appreciated. I deleted all SSIS packages and Jobs with no luck. We've rebooted and cycled services per suggestions from users.

The original error message:

TITLE: Microsoft SQL Server Management Studio

Unable to cast object of type 'Microsoft.SqlServer.Management.Smo.SimpleObjectKey' to type 'Microsoft.SqlServer.Management.Smo.Agent.JobObjectKey'. (Microsoft.SqlServer.Smo)


BUTTONS:

OK

Technical details

===================================

Unable to cast object of type 'Microsoft.SqlServer.Management.Smo.SimpleObjectKey' to type 'Microsoft.SqlServer.Management.Smo.Agent.JobObjectKey'. (Microsoft.SqlServer.Smo)


Program Location:

at Microsoft.SqlServer.Management.Smo.Agent.JobCollection.GetObjectByKey(ObjectKeyBase key)
at Microsoft.SqlServer.Management.Smo.SimpleObjectCollectionBase.Contains(String name)
at Microsoft.SqlServer.Management.SqlManagerUI.JobData.JobExists(String jobName)
at Microsoft.SqlServer.Management.SqlManagerUI.JobData.ApplyChanges()
at Microsoft.SqlServer.Management.SqlManagerUI.JobPropertySheet.DoPreProcessExecution(RunType runType, ExecutionMode& executionResult)
at Microsoft.SqlServer.Management.SqlMgmt.SqlMgmtTreeViewControl.DoPreProcessExecutionAndRunViews(RunType runType)
at Microsoft.SqlServer.Management.SqlMgmt.SqlMgmtTreeViewControl.ExecuteForSql(PreProcessExecutionInfo executionInfo, ExecutionMode& executionResult)
at Microsoft.SqlServer.Management.SqlMgmt.SqlMgmtTreeViewControl.Microsoft.SqlServer.Management.SqlMgmt.IExecutionAwareSqlControlCollection.PreProcessExecution(PreProcessExecutionInfo executionInfo, ExecutionMode& executionResult)
at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.RunNow(RunType runType, Object sender)

|||

Hi folks,

I too had the same exact error when trying to schedule a package. After reading numerous posts and forums, some people have said

SP2 solved their problems and some said it didn't.

Here's what I did to get it to work.

On our SQL Server 2005 development machine, we did install SP2

however, that doesn't solve the problem because the problem lies in scheduling your job using Management Studio through your local machine. If you logged onto your SQL 2005 server that has SP2, you should be able to schedule from there. But it's through Management Studio, which I'm guessing most of you are trying to create a job schedule for your packages. Usually, people don't think of upgrading their client tools as well.

I verified this by upgrading my local machine to SP2 for the client tools and was able to successfully schedule. You might also need to upgrade your server machine to SP2 to work as well.

I hope this helps.

-SX

|||

I finally uninstalled all SQL related products and services, reinstalled everything, added hot fixes and finally we have two of the three servers working--mostly. There are still occaisional errors, but most seem limited to SSMS' and its UI

I haven't rolled SP2 to production yet and won't be adding any new SQL servers to our mix until this mess settles. I thought we'd be going to some of the better features (like Mirroring) later this year but now it'll be Q1'08 at the earliest.

Haven't had this much fun since SQL2KSP4! Keep smiling....

|||

Hello Visgor Allen and others!

Thank you for reporting this problem, and sorry for the problems that you are experiencing.

I'd like to understand this issue better so we can provide guidance to other customers. Can somebody on this thread please provide more details on how to repro this problem:

1) What is the initial configuration on both server and client machines (if different)? Is it SQL Server 2005 RTM or SP1?

2) Does the problem reproduce after upgrading client/server/both machines to SP2?

3) From what machine (client/server) are you trying to create a new job?

Thanks in advance!

|||

Unable to create new jobs in sql 2005, SSIS service is running. Finally i was surfing net for solution and understood need to install SP2 in my machine. But if i need to create new jobs in remote system what should i do.

Please suggest me a solution.

sql

Can not create Job on SQL2005

Could not create SQL jobs. Getting Error:

Unable to cast object of type 'Microsoft.SqlServer.Management.Smo.SimpleObjectKey' to type
'Microsoft.SqlServer.Management.Smo.Agent.JobObjectKey'. (Microsoft.SqlServer.Smo)

- Tried several different job types, always same result.
- Installing SP1 or SP2 does not help.
- Installing with or without Integration Service does not help.

Any help is highly appreciated

Thanks.

Try this:

Dim strDBName As String
Dim strJobID As Guid
Dim jobDumpJob As Job
Dim jbsDumpJobStep As JobStep
Dim intStepID As Integer

' Connect to the server
Dim srvMgmtServer As Server
srvMgmtServer = New Server("MyServer")
Dim srvConn As ServerConnection
srvConn = srvMgmtServer.ConnectionContext
srvConn.LoginSecure = True

strDBName = dbDatabase.Name
jobDumpJob = New Job(srvMgmtServer.JobServer, "YourJobName")
jobDumpJob.Description = "Job Description"
jobDumpJob.Category = "[Uncategorized (Local)]"
jobDumpJob.OwnerLoginName = "sa"
jobDumpJob.Create()
strJobID = jobDumpJob.JobID

jbsDumpJobStep = New JobStep(jobDumpJob, "Step 1")
jbsDumpJobStep.DatabaseName = "UserDB"
jbsDumpJobStep.Command = "TSQL command"
jbsDumpJobStep.OnSuccessAction = StepCompletionAction.QuitWithSuccess
jbsDumpJobStep.OnFailAction = StepCompletionAction.QuitWithFailure
jbsDumpJobStep.Create()
intStepID = jbsDumpJobStep.ID

jobDumpJob.ApplyToTargetServer(srvMgmtServer.Name)
jobDumpJob.StartStepID = intStepID
jobDumpJob.Alter()

|||

Hi

I am also having this problem.

Im trying to create a job to run SQL Server Integration Package.

The Code that you have given above. What is that for?

Thanks

|||This code uses SMO in VB.Net to create a job to execute a TSQL command. Browse around in ObjectBrowser and you should find the properties necessary to execute a SSIS package.|||

I can execute the SISS Package.

But i want to execute it within a job.

Is there any tutorials for creating jobs that i could look at?

|||for some reason it works on an another machine. I dont no why.|||

I figured it out. Despite you could install Management Tool on any computer it will work only on machine that have SQL Server 2005 SP2 installed.

|||Try installing SP2 for the client components on all computers taht run management studio, reboot, then try again from management studio client.|||

Identical problems here--also tried the new hotfix as well.

We've held off rolling out SP2 due to these and other errors. Until someone deals with these problems I suppose my company is stuck.

|||Check whether Distributed Transaction Coordinator service is started. If not, start it and try again.|||

We have a sql2005 installation that I've created jobs on routinely for months and then today we hit this message. I'm not going to install SP2 just yet since some users report that it doesn't help.

The details from the error message are as follows. Any help would be much appreciated. I deleted all SSIS packages and Jobs with no luck. We've rebooted and cycled services per suggestions from users.

The original error message:

TITLE: Microsoft SQL Server Management Studio

Unable to cast object of type 'Microsoft.SqlServer.Management.Smo.SimpleObjectKey' to type 'Microsoft.SqlServer.Management.Smo.Agent.JobObjectKey'. (Microsoft.SqlServer.Smo)


BUTTONS:

OK

Technical details

===================================

Unable to cast object of type 'Microsoft.SqlServer.Management.Smo.SimpleObjectKey' to type 'Microsoft.SqlServer.Management.Smo.Agent.JobObjectKey'. (Microsoft.SqlServer.Smo)


Program Location:

at Microsoft.SqlServer.Management.Smo.Agent.JobCollection.GetObjectByKey(ObjectKeyBase key)
at Microsoft.SqlServer.Management.Smo.SimpleObjectCollectionBase.Contains(String name)
at Microsoft.SqlServer.Management.SqlManagerUI.JobData.JobExists(String jobName)
at Microsoft.SqlServer.Management.SqlManagerUI.JobData.ApplyChanges()
at Microsoft.SqlServer.Management.SqlManagerUI.JobPropertySheet.DoPreProcessExecution(RunType runType, ExecutionMode& executionResult)
at Microsoft.SqlServer.Management.SqlMgmt.SqlMgmtTreeViewControl.DoPreProcessExecutionAndRunViews(RunType runType)
at Microsoft.SqlServer.Management.SqlMgmt.SqlMgmtTreeViewControl.ExecuteForSql(PreProcessExecutionInfo executionInfo, ExecutionMode& executionResult)
at Microsoft.SqlServer.Management.SqlMgmt.SqlMgmtTreeViewControl.Microsoft.SqlServer.Management.SqlMgmt.IExecutionAwareSqlControlCollection.PreProcessExecution(PreProcessExecutionInfo executionInfo, ExecutionMode& executionResult)
at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.RunNow(RunType runType, Object sender)

|||

Hi folks,

I too had the same exact error when trying to schedule a package. After reading numerous posts and forums, some people have said

SP2 solved their problems and some said it didn't.

Here's what I did to get it to work.

On our SQL Server 2005 development machine, we did install SP2

however, that doesn't solve the problem because the problem lies in scheduling your job using Management Studio through your local machine. If you logged onto your SQL 2005 server that has SP2, you should be able to schedule from there. But it's through Management Studio, which I'm guessing most of you are trying to create a job schedule for your packages. Usually, people don't think of upgrading their client tools as well.

I verified this by upgrading my local machine to SP2 for the client tools and was able to successfully schedule. You might also need to upgrade your server machine to SP2 to work as well.

I hope this helps.

-SX

|||

I finally uninstalled all SQL related products and services, reinstalled everything, added hot fixes and finally we have two of the three servers working--mostly. There are still occaisional errors, but most seem limited to SSMS' and its UI

I haven't rolled SP2 to production yet and won't be adding any new SQL servers to our mix until this mess settles. I thought we'd be going to some of the better features (like Mirroring) later this year but now it'll be Q1'08 at the earliest.

Haven't had this much fun since SQL2KSP4! Keep smiling....

|||

Hello Visgor Allen and others!

Thank you for reporting this problem, and sorry for the problems that you are experiencing.

I'd like to understand this issue better so we can provide guidance to other customers. Can somebody on this thread please provide more details on how to repro this problem:

1) What is the initial configuration on both server and client machines (if different)? Is it SQL Server 2005 RTM or SP1?

2) Does the problem reproduce after upgrading client/server/both machines to SP2?

3) From what machine (client/server) are you trying to create a new job?

Thanks in advance!

|||

Unable to create new jobs in sql 2005, SSIS service is running. Finally i was surfing net for solution and understood need to install SP2 in my machine. But if i need to create new jobs in remote system what should i do.

Please suggest me a solution.

Can not create Job on SQL2005

Could not create SQL jobs. Getting Error:

Unable to cast object of type 'Microsoft.SqlServer.Management.Smo.SimpleObjectKey' to type
'Microsoft.SqlServer.Management.Smo.Agent.JobObjectKey'. (Microsoft.SqlServer.Smo)

- Tried several different job types, always same result.
- Installing SP1 or SP2 does not help.
- Installing with or without Integration Service does not help.

Any help is highly appreciated

Thanks.

Try this:

Dim strDBName As String
Dim strJobID As Guid
Dim jobDumpJob As Job
Dim jbsDumpJobStep As JobStep
Dim intStepID As Integer

' Connect to the server
Dim srvMgmtServer As Server
srvMgmtServer = New Server("MyServer")
Dim srvConn As ServerConnection
srvConn = srvMgmtServer.ConnectionContext
srvConn.LoginSecure = True

strDBName = dbDatabase.Name
jobDumpJob = New Job(srvMgmtServer.JobServer, "YourJobName")
jobDumpJob.Description = "Job Description"
jobDumpJob.Category = "[Uncategorized (Local)]"
jobDumpJob.OwnerLoginName = "sa"
jobDumpJob.Create()
strJobID = jobDumpJob.JobID

jbsDumpJobStep = New JobStep(jobDumpJob, "Step 1")
jbsDumpJobStep.DatabaseName = "UserDB"
jbsDumpJobStep.Command = "TSQL command"
jbsDumpJobStep.OnSuccessAction = StepCompletionAction.QuitWithSuccess
jbsDumpJobStep.OnFailAction = StepCompletionAction.QuitWithFailure
jbsDumpJobStep.Create()
intStepID = jbsDumpJobStep.ID

jobDumpJob.ApplyToTargetServer(srvMgmtServer.Name)
jobDumpJob.StartStepID = intStepID
jobDumpJob.Alter()

|||

Hi

I am also having this problem.

Im trying to create a job to run SQL Server Integration Package.

The Code that you have given above. What is that for?

Thanks

|||This code uses SMO in VB.Net to create a job to execute a TSQL command. Browse around in ObjectBrowser and you should find the properties necessary to execute a SSIS package.|||

I can execute the SISS Package.

But i want to execute it within a job.

Is there any tutorials for creating jobs that i could look at?

|||for some reason it works on an another machine. I dont no why.|||

I figured it out. Despite you could install Management Tool on any computer it will work only on machine that have SQL Server 2005 SP2 installed.

|||Try installing SP2 for the client components on all computers taht run management studio, reboot, then try again from management studio client.|||

Identical problems here--also tried the new hotfix as well.

We've held off rolling out SP2 due to these and other errors. Until someone deals with these problems I suppose my company is stuck.

|||Check whether Distributed Transaction Coordinator service is started. If not, start it and try again.|||

We have a sql2005 installation that I've created jobs on routinely for months and then today we hit this message. I'm not going to install SP2 just yet since some users report that it doesn't help.

The details from the error message are as follows. Any help would be much appreciated. I deleted all SSIS packages and Jobs with no luck. We've rebooted and cycled services per suggestions from users.

The original error message:

TITLE: Microsoft SQL Server Management Studio

Unable to cast object of type 'Microsoft.SqlServer.Management.Smo.SimpleObjectKey' to type 'Microsoft.SqlServer.Management.Smo.Agent.JobObjectKey'. (Microsoft.SqlServer.Smo)


BUTTONS:

OK

Technical details

===================================

Unable to cast object of type 'Microsoft.SqlServer.Management.Smo.SimpleObjectKey' to type 'Microsoft.SqlServer.Management.Smo.Agent.JobObjectKey'. (Microsoft.SqlServer.Smo)


Program Location:

at Microsoft.SqlServer.Management.Smo.Agent.JobCollection.GetObjectByKey(ObjectKeyBase key)
at Microsoft.SqlServer.Management.Smo.SimpleObjectCollectionBase.Contains(String name)
at Microsoft.SqlServer.Management.SqlManagerUI.JobData.JobExists(String jobName)
at Microsoft.SqlServer.Management.SqlManagerUI.JobData.ApplyChanges()
at Microsoft.SqlServer.Management.SqlManagerUI.JobPropertySheet.DoPreProcessExecution(RunType runType, ExecutionMode& executionResult)
at Microsoft.SqlServer.Management.SqlMgmt.SqlMgmtTreeViewControl.DoPreProcessExecutionAndRunViews(RunType runType)
at Microsoft.SqlServer.Management.SqlMgmt.SqlMgmtTreeViewControl.ExecuteForSql(PreProcessExecutionInfo executionInfo, ExecutionMode& executionResult)
at Microsoft.SqlServer.Management.SqlMgmt.SqlMgmtTreeViewControl.Microsoft.SqlServer.Management.SqlMgmt.IExecutionAwareSqlControlCollection.PreProcessExecution(PreProcessExecutionInfo executionInfo, ExecutionMode& executionResult)
at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.RunNow(RunType runType, Object sender)

|||

Hi folks,

I too had the same exact error when trying to schedule a package. After reading numerous posts and forums, some people have said

SP2 solved their problems and some said it didn't.

Here's what I did to get it to work.

On our SQL Server 2005 development machine, we did install SP2

however, that doesn't solve the problem because the problem lies in scheduling your job using Management Studio through your local machine. If you logged onto your SQL 2005 server that has SP2, you should be able to schedule from there. But it's through Management Studio, which I'm guessing most of you are trying to create a job schedule for your packages. Usually, people don't think of upgrading their client tools as well.

I verified this by upgrading my local machine to SP2 for the client tools and was able to successfully schedule. You might also need to upgrade your server machine to SP2 to work as well.

I hope this helps.

-SX

|||

I finally uninstalled all SQL related products and services, reinstalled everything, added hot fixes and finally we have two of the three servers working--mostly. There are still occaisional errors, but most seem limited to SSMS' and its UI

I haven't rolled SP2 to production yet and won't be adding any new SQL servers to our mix until this mess settles. I thought we'd be going to some of the better features (like Mirroring) later this year but now it'll be Q1'08 at the earliest.

Haven't had this much fun since SQL2KSP4! Keep smiling....

|||

Hello Visgor Allen and others!

Thank you for reporting this problem, and sorry for the problems that you are experiencing.

I'd like to understand this issue better so we can provide guidance to other customers. Can somebody on this thread please provide more details on how to repro this problem:

1) What is the initial configuration on both server and client machines (if different)? Is it SQL Server 2005 RTM or SP1?

2) Does the problem reproduce after upgrading client/server/both machines to SP2?

3) From what machine (client/server) are you trying to create a new job?

Thanks in advance!

|||

Unable to create new jobs in sql 2005, SSIS service is running. Finally i was surfing net for solution and understood need to install SP2 in my machine. But if i need to create new jobs in remote system what should i do.

Please suggest me a solution.

Tuesday, March 20, 2012

Can not connect remote SqlServer

I can not connect a SqlServer (version 2005) in remote.
I have checked there are no firewall problems, and the server have been set
to allow remote connection.
How can I do?I got the following from another post in SQLServer Setup community.
The Allow Remote Conections is not the correct setting (it controls the
ability for remote servers to execute stored procedures on the local server
via a linked server) The easiest thing to do is on the server go to
Start>Programs>Microsoft SQL Server 2005>Configuration Tools>SQL Surface
Area Configuration and click on Surface Area Configuration for Services And
Connections. Under the Database Engine section on the left select Remote
Connections and select the Local and remote connections radio burron and
select Using both TCP/ip and named pipes and click Apply.
"ad" wrote:

> I can not connect a SqlServer (version 2005) in remote.
> I have checked there are no firewall problems, and the server have been se
t
> to allow remote connection.
> How can I do?
>
>

Can not connect remote SqlServer

I can not connect a SqlServer (version 2005) in remote.
I have checked there are no firewall problems, and the server have been set
to allow remote connection.
How can I do?I got the following from another post in SQLServer Setup community.
The Allow Remote Conections is not the correct setting (it controls the
ability for remote servers to execute stored procedures on the local server
via a linked server) The easiest thing to do is on the server go to
Start>Programs>Microsoft SQL Server 2005>Configuration Tools>SQL Surface
Area Configuration and click on Surface Area Configuration for Services And
Connections. Under the Database Engine section on the left select Remote
Connections and select the Local and remote connections radio burron and
select Using both TCP/ip and named pipes and click Apply.
"ad" wrote:
> I can not connect a SqlServer (version 2005) in remote.
> I have checked there are no firewall problems, and the server have been set
> to allow remote connection.
> How can I do?
>
>

Can not connect remote SqlServer

I can not connect a SqlServer (version 2005) in remote.
I have checked there are no firewall problems, and the server have been set
to allow remote connection.
How can I do?
I got the following from another post in SQLServer Setup community.
The Allow Remote Conections is not the correct setting (it controls the
ability for remote servers to execute stored procedures on the local server
via a linked server) The easiest thing to do is on the server go to
Start>Programs>Microsoft SQL Server 2005>Configuration Tools>SQL Surface
Area Configuration and click on Surface Area Configuration for Services And
Connections. Under the Database Engine section on the left select Remote
Connections and select the Local and remote connections radio burron and
select Using both TCP/ip and named pipes and click Apply.
"ad" wrote:

> I can not connect a SqlServer (version 2005) in remote.
> I have checked there are no firewall problems, and the server have been set
> to allow remote connection.
> How can I do?
>
>

Can not attach mdf 2005 file into sqlserver 2000

hello all.
I have a database file in sqlserver 2005 mode, i set it's compatiblity to sqlserver 2000 (80) but i cant attach it in sqlserver 2000.
My host only support sqlserver 2000!

I need any help to convert or attach it!
Thank all!

Sadly to say: you can not attach a SQL2005 database to a SQL2000 instance even you set the compatiblity to sqlserver 2000 (80). I'm afraid you have create a new database with exact the same schema in SQL2000, and transfer data from the original database to the new one. You can get the scripts for creating the objects of the same schemas by right clicking the objects in Management Studio.

|||

Thank!

Sql 2005 is so bad! No server is using it now!

Can not access Excel file using OpenRowset

I am using SQLServer 2005 SP2. I enabled the Ad Hoc Distributed Queries and DisallowAdhocAccess registry option is explicitly set to 0. Query is working fine when I remote desk to the server and execute when I run same query from my workstation I am getting following error

Msg 7399, Level 16, State 1, Line 1

The OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" reported an error. The provider did not give any information about the error.

Msg 7303, Level 16, State 1, Line 1

Cannot initialize the data source object of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)".

Any help is appreciated.

Thanks

--

Farhan

Can you post the text of your query?|||

Here you go ...

Select * FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0',

'Data Source=C:\inventory.xls;Extended Properties=Excel 8.0')...[Laptop$]

|||Can we clarify your original statement?
You wrote that when you execute the statement from the server itself it works.
In that case how do you exactly execute the query? And how do you do it from your workstation?|||

Hello Anton,

I ran the query using SQLServer Management Studio both on Server and Workstation.

Thanks.

|||Connecting to the same server with the same credentials?|||

I think this is a point of view issue. Remember that when you perform OpenRowset, it is looking for that location from the server's point of view. If you create a file on the client at C:\file and try to link to it from the server, it will naturally not find C:\file. You have to specify where the server would find that file, not where it is on the client. This is the same kind of issue that would come up if you try to load a CLR assembly on the server that is built on the client. The file is not within the scope of the server's view and definitely not in the same place so it fails to find it and fails to load, but if you perform the exact same operation on the server, it succeeds. This is because, when performing this operation on the server, the client and server are the same machine and have the same filesystem view. You can work around this issue in a few ways if you need to dynamically link the server to a client file. I suggest either: 1.) upload the file through TCP or an extended stored procedure and link to it from the directory path in the server's view, 2.) create a share and place files on the share that you want to push over to the server, specifying the share should give you a uniform location across client and server and effectively abstract out this detail.

Hope that helps,

John

sql

Can not access Excel file using OpenRowset

I am using SQLServer 2005 SP2. I enabled the Ad Hoc Distributed Queries and DisallowAdhocAccess registry option is explicitly set to 0. Query is working fine when I remote desk to the server and execute when I run same query from my workstation I am getting following error

Msg 7399, Level 16, State 1, Line 1

The OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" reported an error. The provider did not give any information about the error.

Msg 7303, Level 16, State 1, Line 1

Cannot initialize the data source object of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)".

Any help is appreciated.

Thanks

--

Farhan

Can you post the text of your query?|||

Here you go ...

Select * FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0',

'Data Source=C:\inventory.xls;Extended Properties=Excel 8.0')...[Laptop$]

|||Can we clarify your original statement?
You wrote that when you execute the statement from the server itself it works.
In that case how do you exactly execute the query? And how do you do it from your workstation?|||

Hello Anton,

I ran the query using SQLServer Management Studio both on Server and Workstation.

Thanks.

|||Connecting to the same server with the same credentials?|||

I think this is a point of view issue. Remember that when you perform OpenRowset, it is looking for that location from the server's point of view. If you create a file on the client at C:\file and try to link to it from the server, it will naturally not find C:\file. You have to specify where the server would find that file, not where it is on the client. This is the same kind of issue that would come up if you try to load a CLR assembly on the server that is built on the client. The file is not within the scope of the server's view and definitely not in the same place so it fails to find it and fails to load, but if you perform the exact same operation on the server, it succeeds. This is because, when performing this operation on the server, the client and server are the same machine and have the same filesystem view. You can work around this issue in a few ways if you need to dynamically link the server to a client file. I suggest either: 1.) upload the file through TCP or an extended stored procedure and link to it from the directory path in the server's view, 2.) create a share and place files on the share that you want to push over to the server, specifying the share should give you a uniform location across client and server and effectively abstract out this detail.

Hope that helps,

John

Can not access Excel file using OpenRowset

I am using SQLServer 2005 SP2. I enabled the Ad Hoc Distributed Queries and DisallowAdhocAccess registry option is explicitly set to 0. Query is working fine when I remote desk to the server and execute when I run same query from my workstation I am getting following error

Msg 7399, Level 16, State 1, Line 1

The OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" reported an error. The provider did not give any information about the error.

Msg 7303, Level 16, State 1, Line 1

Cannot initialize the data source object of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)".

Any help is appreciated.

Thanks

--

Farhan

Can you post the text of your query?|||

Here you go ...

Select * FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0',

'Data Source=C:\inventory.xls;Extended Properties=Excel 8.0')...[Laptop$]

|||Can we clarify your original statement?
You wrote that when you execute the statement from the server itself it works.
In that case how do you exactly execute the query? And how do you do it from your workstation?|||

Hello Anton,

I ran the query using SQLServer Management Studio both on Server and Workstation.

Thanks.

|||Connecting to the same server with the same credentials?|||

I think this is a point of view issue. Remember that when you perform OpenRowset, it is looking for that location from the server's point of view. If you create a file on the client at C:\file and try to link to it from the server, it will naturally not find C:\file. You have to specify where the server would find that file, not where it is on the client. This is the same kind of issue that would come up if you try to load a CLR assembly on the server that is built on the client. The file is not within the scope of the server's view and definitely not in the same place so it fails to find it and fails to load, but if you perform the exact same operation on the server, it succeeds. This is because, when performing this operation on the server, the client and server are the same machine and have the same filesystem view. You can work around this issue in a few ways if you need to dynamically link the server to a client file. I suggest either: 1.) upload the file through TCP or an extended stored procedure and link to it from the directory path in the server's view, 2.) create a share and place files on the share that you want to push over to the server, specifying the share should give you a uniform location across client and server and effectively abstract out this detail.

Hope that helps,

John

Monday, March 19, 2012

Can MSDE 2000 be installed with Sql Server 6.5

I want to use MSDE 2000 Release A on an NT Server currently running MS SQL
Server 6.5
Will the installation of MSDE cause issues for SQL Server 6.5? or vice versa?
(We are not ready to throw 6.5 out just yet ...)
Hoppy
hi Andrew,
"Andrew H" <ahopton@.dataaction_com_au> ha scritto nel messaggio
news:5CFDD7F8-5A12-41A1-8579-0F46F7227300@.microsoft.com
> I want to use MSDE 2000 Release A on an NT Server currently running
> MS SQL Server 6.5
> Will the installation of MSDE cause issues for SQL Server 6.5? or
> vice versa?
> (We are not ready to throw 6.5 out just yet ...)
you can have a look at
http://msdn.microsoft.com/library/de...setup_9zcl.asp
and following..
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.9.1 - DbaMgr ver 0.55.1
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply

Wednesday, March 7, 2012

can i use scm to change to sa password

for some reason i changed my sqlserver sa password as 'newpassword', i try to find a way to resolve the sqlserveragent settings , in connection tab, i choose 'sqlserver authority',
i try the command below to changed the sa pwd:

>scm -Action 7 -Service sqlserveragent -Pwd newpassword
>net start sqlserveragent
but the modify of scm is not commit although the message tell me that modify is successful.
can I use SCM to modify sqlserveragent settings?

Hi,

to change the SQL Server Agent password , first you have to change the password for a User which is used to start SQL Server Agent service and then go to Start->Settings->Control Panel->Administrative Tools-> Services->Select services ->Open it->go to Log On->and then change your new password here too.

Hemantgiri S. Goswami

|||

We can use windows authority to start mssqlserveragent and log the sqlserver instance,and windows authority+sql authority also,

windows authority to start sqlserveragent service, sql authority or windows authority to log the sqlserver instance and run service

i use sql authority to log the sqlserver instance(setting in connection option),after change the sa password,i want to use code to change the sqlserveragent settings,such as connection login user (sa) password.Can I do it?

|||

How possible is it to have this done through t-sql statements? I would like to do this with sql scripts and not using Enterprise manager to change the sql server agent's connection parameters (username and password)

Someone shed some light on this.

Cheers

|||i do not use T-SQL,but SQLSERVER tools named SCM,you can find this file in the installed directory|||

I will not recommand for T-SQL

Thanks

Faiz Farazi

www.databasetimes.net

Best learning center for Microsoft

http://www.lascomp.com

|||But, is there a way to do it through t-sql was my question. If so how to do that?|||

Yes you can use SP_PASSWORD statement and BOL defines that:

This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. Use ALTER LOGIN instead.

|||

Please read my question again. I think it was misread. I didn't want to know how to change the password... I wanted to know using t-sql how to change the connection parameters for SQL server Agent (username and password) that shows up on SQL server Agent Properties >> connection Tab >> that uses a local system account... which in this case I wanted to change it to use SA and its password or any other that has got proper permissions. Hope this explains.

|||

Hi,

Any success with your query? Have a similar requirement and have been looking around for an answer. No success yet :-(

can i use scm to change to sa password

for some reason i changed my sqlserver sa password as 'newpassword', i try to find a way to resolve the sqlserveragent settings , in connection tab, i choose 'sqlserver authority',
i try the command below to changed the sa pwd:

>scm -Action 7 -Service sqlserveragent -Pwd newpassword
>net start sqlserveragent
but the modify of scm is not commit although the message tell me that modify is successful.
can I use SCM to modify sqlserveragent settings?

Hi,

to change the SQL Server Agent password , first you have to change the password for a User which is used to start SQL Server Agent service and then go to Start->Settings->Control Panel->Administrative Tools-> Services->Select services ->Open it->go to Log On->and then change your new password here too.

Hemantgiri S. Goswami

|||

We can use windows authority to start mssqlserveragent and log the sqlserver instance,and windows authority+sql authority also,

windows authority to start sqlserveragent service, sql authority or windows authority to log the sqlserver instance and run service

i use sql authority to log the sqlserver instance(setting in connection option),after change the sa password,i want to use code to change the sqlserveragent settings,such as connection login user (sa) password.Can I do it?

|||

How possible is it to have this done through t-sql statements? I would like to do this with sql scripts and not using Enterprise manager to change the sql server agent's connection parameters (username and password)

Someone shed some light on this.

Cheers

|||i do not use T-SQL,but SQLSERVER tools named SCM,you can find this file in the installed directory|||

I will not recommand for T-SQL

Thanks

Faiz Farazi

www.databasetimes.net

Best learning center for Microsoft

http://www.lascomp.com

|||But, is there a way to do it through t-sql was my question. If so how to do that?|||

Yes you can use SP_PASSWORD statement and BOL defines that:

This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. Use ALTER LOGIN instead.

|||

Please read my question again. I think it was misread. I didn't want to know how to change the password... I wanted to know using t-sql how to change the connection parameters for SQL server Agent (username and password) that shows up on SQL server Agent Properties >> connection Tab >> that uses a local system account... which in this case I wanted to change it to use SA and its password or any other that has got proper permissions. Hope this explains.

|||

Hi,

Any success with your query? Have a similar requirement and have been looking around for an answer. No success yet :-(

can i use scm to change to sa password

for some reason i changed my sqlserver sa password as 'newpassword', i try to find a way to resolve the sqlserveragent settings , in connection tab, i choose 'sqlserver authority',
i try the command below to changed the sa pwd:

>scm -Action 7 -Service sqlserveragent -Pwd newpassword
>net start sqlserveragent
but the modify of scm is not commit although the message tell me that modify is successful.
can I use SCM to modify sqlserveragent settings?

Hi,

to change the SQL Server Agent password , first you have to change the password for a User which is used to start SQL Server Agent service and then go to Start->Settings->Control Panel->Administrative Tools-> Services->Select services ->Open it->go to Log On->and then change your new password here too.

Hemantgiri S. Goswami

|||

We can use windows authority to start mssqlserveragent and log the sqlserver instance,and windows authority+sql authority also,

windows authority to start sqlserveragent service, sql authority or windows authority to log the sqlserver instance and run service

i use sql authority to log the sqlserver instance(setting in connection option),after change the sa password,i want to use code to change the sqlserveragent settings,such as connection login user (sa) password.Can I do it?

|||

How possible is it to have this done through t-sql statements? I would like to do this with sql scripts and not using Enterprise manager to change the sql server agent's connection parameters (username and password)

Someone shed some light on this.

Cheers

|||i do not use T-SQL,but SQLSERVER tools named SCM,you can find this file in the installed directory
|||

I will not recommand for T-SQL

Thanks

Faiz Farazi

www.databasetimes.net

Best learning center for Microsoft

http://www.lascomp.com

|||But, is there a way to do it through t-sql was my question. If so how to do that?|||

Yes you can use SP_PASSWORD statement and BOL defines that:

This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. Use ALTER LOGIN instead.

|||

Please read my question again. I think it was misread. I didn't want to know how to change the password... I wanted to know using t-sql how to change the connection parameters for SQL server Agent (username and password) that shows up on SQL server Agent Properties >> connection Tab >> that uses a local system account... which in this case I wanted to change it to use SA and its password or any other that has got proper permissions. Hope this explains.

|||

Hi,

Any success with your query? Have a similar requirement and have been looking around for an answer. No success yet :-(

can i use scm to change to sa password

for some reason i changed my sqlserver sa password as 'newpassword', i try to find a way to resolve the sqlserveragent settings , in connection tab, i choose 'sqlserver authority',
i try the command below to changed the sa pwd:

>scm -Action 7 -Service sqlserveragent -Pwd newpassword
>net start sqlserveragent
but the modify of scm is not commit although the message tell me that modify is successful.
can I use SCM to modify sqlserveragent settings?

Hi,

to change the SQL Server Agent password , first you have to change the password for a User which is used to start SQL Server Agent service and then go to Start->Settings->Control Panel->Administrative Tools-> Services->Select services ->Open it->go to Log On->and then change your new password here too.

Hemantgiri S. Goswami

|||

We can use windows authority to start mssqlserveragent and log the sqlserver instance,and windows authority+sql authority also,

windows authority to start sqlserveragent service, sql authority or windows authority to log the sqlserver instance and run service

i use sql authority to log the sqlserver instance(setting in connection option),after change the sa password,i want to use code to change the sqlserveragent settings,such as connection login user (sa) password.Can I do it?

|||

How possible is it to have this done through t-sql statements? I would like to do this with sql scripts and not using Enterprise manager to change the sql server agent's connection parameters (username and password)

Someone shed some light on this.

Cheers

|||i do not use T-SQL,but SQLSERVER tools named SCM,you can find this file in the installed directory
|||

I will not recommand for T-SQL

Thanks

Faiz Farazi

www.databasetimes.net

Best learning center for Microsoft

http://www.lascomp.com

|||But, is there a way to do it through t-sql was my question. If so how to do that?|||

Yes you can use SP_PASSWORD statement and BOL defines that:

This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. Use ALTER LOGIN instead.

|||

Please read my question again. I think it was misread. I didn't want to know how to change the password... I wanted to know using t-sql how to change the connection parameters for SQL server Agent (username and password) that shows up on SQL server Agent Properties >> connection Tab >> that uses a local system account... which in this case I wanted to change it to use SA and its password or any other that has got proper permissions. Hope this explains.

|||

Hi,

Any success with your query? Have a similar requirement and have been looking around for an answer. No success yet :-(

Friday, February 24, 2012

can i update GUIDS in sysmergepubliction and sysmergeAricles in sqlserver 2005 ?

Hi fellows ,

there is a senerio where i want to update GUIDS in columns "pubid" and "artid" generate in sysmergepubliction and sysmergeAricles respectivly in sqlserver 2005 ?

2nd is there any easy way to generate scripts of triggers of all replicated tables in subscriber at one .

You should not be updating the GUIDs (pubid and artid) manually in the system tables. Almost all of the replication working is based on these IDs and editing of it is neither recommended nor supported.

You should be able to use the UI to gerenate scripts for all the objects.

Can I tell when SQL Server was upgraded?

Unusal question but I am trying to find out the date an instance of SQL
Server was upgraded from 7.0 to 2000.
It was probably about 6 months ago and I am trying to pin it down to a
specific date.
I thought that maybe the creation date of system tables in msdb or Master
would give me a clue but they all seem to be 8/6/2000 which is definitely
not correct.
The logs have long since recycled.
Does anyone have any other ideas?Wild guess, but search for iss files (the install directory for your
instance). I'm thinking that the upgrade will produce an ISS file and the
date for this can be the answer. My machine shows 2002-08-06 for my sp1
instance and 2003-03-22 for my sp3 instance. Note that the machine was most
probably installed after sp1 was released but before sp3 ...
Tibor Karaszi, SQL Server MVP
Archive at:
http://groups.google.com/groups?oi=...ublic.sqlserver
"DaveF" <davef@.comcast.net> wrote in message
news:efck5Xj%23DHA.2808@.TK2MSFTNGP10.phx.gbl...
> Unusal question but I am trying to find out the date an instance of SQL
> Server was upgraded from 7.0 to 2000.
> It was probably about 6 months ago and I am trying to pin it down to a
> specific date.
> I thought that maybe the creation date of system tables in msdb or Master
> would give me a clue but they all seem to be 8/6/2000 which is definitely
> not correct.
> The logs have long since recycled.
> Does anyone have any other ideas?
>
>|||You can also try looking for sqlstp.log which I think is in c:\winnt by
default.
HTH
Jasper Smith (SQL Server MVP)
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"DaveF" <davef@.comcast.net> wrote in message
news:efck5Xj%23DHA.2808@.TK2MSFTNGP10.phx.gbl...
> Unusal question but I am trying to find out the date an instance of SQL
> Server was upgraded from 7.0 to 2000.
> It was probably about 6 months ago and I am trying to pin it down to a
> specific date.
> I thought that maybe the creation date of system tables in msdb or Master
> would give me a clue but they all seem to be 8/6/2000 which is definitely
> not correct.
> The logs have long since recycled.
> Does anyone have any other ideas?
>
>