It does a great job of importing from Excel. See www.dataDefractor.com for more info.
Tuesday, March 27, 2012
Can not find installable ISAM
can not drop user from database
I can not delete user from a database in sql2005 beta 3.
the message errror is :
TITLE: SQL Server Management Studio
-
Drop failed for User 'Amministratore'. (Microsoft.SqlServer.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft SQL Server&ProdVer=9.00.0981.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Drop+User&LinkId=20476
-
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
-
The database principal owns a schema and cannot be dropped. (Microsoft SQL Server, Error: 15138)
in sql 2000 I can delete the user very easy, but in sql 2005 I don't understant How to do it.
In SQL Server 2005, schemas are real entities. You cannot drop a user that owns schemas; you first have to either drop the schemas or change their owner to be another user.
Thanks
Laurentiu
The previous answer is helpful. I am just elaborating for newbies in SQL 2005.
1) Expand Schemas(should be like a folder under <yourdatabase> -> Security) .
2) Delete the unwanted "userSchema".
3) Then, go back to the User(a folder like thing) and delete it.
Hi,
I am having the same problem. When i went to delete the schema..i got the error message "drop failed for schema"
Cannot drop schema 'wch1' because it is being referenced by object 'Alert_List'. (.Net SqlClient Data Provider)
any suggestions?
|||Before dropping a schema, it must be empty. Looks like in your case, you still have an object in the schema: Alert_List. You may either choose to drop this object first or you may choose to move it to another schema (using ALTER SCHEMA TRANSFER). When the schema will be empty, you will be able to drop it.
Thanks
Laurentiu
You can query the catalogs. For example, you can execute the following query:
select * from sys.objects where schema_id = schema_id('s')
to find out the objects that reside in schema 's'.
Thanks
Laurentiu
I also had this problem.I was not able to find out which Schema that the login owned.I do not know of a stored proc function that will list ownership of schemas given an owner.Maybe someone can add that to this thread.
I was able to see which schemas were owned by the login by viewing the properties of each schema and seeing who what listed as the owner.
Example:
I opened the properties window of schema db_datareader and notices that the owner was User1.I changed the owner to be db_datareader and then was able to drop user1.
Regards,
DataSort
|||Schemas are owned by users, not by logins. In SQL Server, logins and users are not the same thing.
To find out the schemas owned by a user, you can run the following query:
select * from sys.schemas where principal_id = user_id('user_name')
Thanks
Laurentiu
can not drop user from database
I can not delete user from a database in sql2005 beta 3.
the message errror is :
TITLE: SQL Server Management Studio
-
Drop failed for User 'Amministratore'. (Microsoft.SqlServer.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft SQL Server&ProdVer=9.00.0981.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Drop+User&LinkId=20476
-
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
-
The database principal owns a schema and cannot be dropped. (Microsoft SQL Server, Error: 15138)
in sql 2000 I can delete the user very easy, but in sql 2005 I don't understant How to do it.
In SQL Server 2005, schemas are real entities. You cannot drop a user that owns schemas; you first have to either drop the schemas or change their owner to be another user.
Thanks
Laurentiu
The previous answer is helpful. I am just elaborating for newbies in SQL 2005.
1) Expand Schemas(should be like a folder under <yourdatabase> -> Security) .
2) Delete the unwanted "userSchema".
3) Then, go back to the User(a folder like thing) and delete it.
Hi,
I am having the same problem. When i went to delete the schema..i got the error message "drop failed for schema"
Cannot drop schema 'wch1' because it is being referenced by object 'Alert_List'. (.Net SqlClient Data Provider)
any suggestions?
|||Before dropping a schema, it must be empty. Looks like in your case, you still have an object in the schema: Alert_List. You may either choose to drop this object first or you may choose to move it to another schema (using ALTER SCHEMA TRANSFER). When the schema will be empty, you will be able to drop it.
Thanks
Laurentiu
You can query the catalogs. For example, you can execute the following query:
select * from sys.objects where schema_id = schema_id('s')
to find out the objects that reside in schema 's'.
Thanks
Laurentiu
I also had this problem.I was not able to find out which Schema that the login owned.I do not know of a stored proc function that will list ownership of schemas given an owner.Maybe someone can add that to this thread.
I was able to see which schemas were owned by the login by viewing the properties of each schema and seeing who what listed as the owner.
Example:
I opened the properties window of schema db_datareader and notices that the owner was User1.I changed the owner to be db_datareader and then was able to drop user1.
Regards,
DataSort
|||Schemas are owned by users, not by logins. In SQL Server, logins and users are not the same thing.
To find out the schemas owned by a user, you can run the following query:
select * from sys.schemas where principal_id = user_id('user_name')
Thanks
Laurentiu
can not drop user from database
I can not delete user from a database in sql2005 beta 3.
the message errror is :
TITLE: SQL Server Management Studio
-
Drop failed for User 'Amministratore'. (Microsoft.SqlServer.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft SQL Server&ProdVer=9.00.0981.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Drop+User&LinkId=20476
-
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
-
The database principal owns a schema and cannot be dropped. (Microsoft SQL Server, Error: 15138)
in sql 2000 I can delete the user very easy, but in sql 2005 I don't understant How to do it.
In SQL Server 2005, schemas are real entities. You cannot drop a user that owns schemas; you first have to either drop the schemas or change their owner to be another user.
Thanks
Laurentiu
The previous answer is helpful. I am just elaborating for newbies in SQL 2005.
1) Expand Schemas(should be like a folder under <yourdatabase> -> Security) .
2) Delete the unwanted "userSchema".
3) Then, go back to the User(a folder like thing) and delete it.
Hi,
I am having the same problem. When i went to delete the schema..i got the error message "drop failed for schema"
Cannot drop schema 'wch1' because it is being referenced by object 'Alert_List'. (.Net SqlClient Data Provider)
any suggestions?
|||Before dropping a schema, it must be empty. Looks like in your case, you still have an object in the schema: Alert_List. You may either choose to drop this object first or you may choose to move it to another schema (using ALTER SCHEMA TRANSFER). When the schema will be empty, you will be able to drop it.
Thanks
Laurentiu
You can query the catalogs. For example, you can execute the following query:
select * from sys.objects where schema_id = schema_id('s')
to find out the objects that reside in schema 's'.
Thanks
Laurentiu
I also had this problem.I was not able to find out which Schema that the login owned.I do not know of a stored proc function that will list ownership of schemas given an owner.Maybe someone can add that to this thread.
I was able to see which schemas were owned by the login by viewing the properties of each schema and seeing who what listed as the owner.
Example:
I opened the properties window of schema db_datareader and notices that the owner was User1.I changed the owner to be db_datareader and then was able to drop user1.
Regards,
DataSort
|||Schemas are owned by users, not by logins. In SQL Server, logins and users are not the same thing.
To find out the schemas owned by a user, you can run the following query:
select * from sys.schemas where principal_id = user_id('user_name')
Thanks
Laurentiu
can not drop user from database
I can not delete user from a database in sql2005 beta 3.
the message errror is :
TITLE: SQL Server Management Studio
-
Drop failed for User 'Amministratore'. (Microsoft.SqlServer.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft SQL Server&ProdVer=9.00.0981.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Drop+User&LinkId=20476
-
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
-
The database principal owns a schema and cannot be dropped. (Microsoft SQL Server, Error: 15138)
in sql 2000 I can delete the user very easy, but in sql 2005 I don't understant How to do it.
In SQL Server 2005, schemas are real entities. You cannot drop a user that owns schemas; you first have to either drop the schemas or change their owner to be another user.
Thanks
Laurentiu
The previous answer is helpful. I am just elaborating for newbies in SQL 2005.
1) Expand Schemas(should be like a folder under <yourdatabase> -> Security) .
2) Delete the unwanted "userSchema".
3) Then, go back to the User(a folder like thing) and delete it.
Hi,
I am having the same problem. When i went to delete the schema..i got the error message "drop failed for schema"
Cannot drop schema 'wch1' because it is being referenced by object 'Alert_List'. (.Net SqlClient Data Provider)
any suggestions?
|||Before dropping a schema, it must be empty. Looks like in your case, you still have an object in the schema: Alert_List. You may either choose to drop this object first or you may choose to move it to another schema (using ALTER SCHEMA TRANSFER). When the schema will be empty, you will be able to drop it.
Thanks
Laurentiu
You can query the catalogs. For example, you can execute the following query:
select * from sys.objects where schema_id = schema_id('s')
to find out the objects that reside in schema 's'.
Thanks
Laurentiu
I also had this problem.I was not able to find out which Schema that the login owned.I do not know of a stored proc function that will list ownership of schemas given an owner.Maybe someone can add that to this thread.
I was able to see which schemas were owned by the login by viewing the properties of each schema and seeing who what listed as the owner.
Example:
I opened the properties window of schema db_datareader and notices that the owner was User1.I changed the owner to be db_datareader and then was able to drop user1.
Regards,
DataSort
|||Schemas are owned by users, not by logins. In SQL Server, logins and users are not the same thing.
To find out the schemas owned by a user, you can run the following query:
select*fromsys.schemaswhere principal_id =user_id('user_name')
Thanks
Laurentiu
can not drop user from database
I can not delete user from a database in sql2005 beta 3.
the message errror is :
TITLE: SQL Server Management Studio
-
Drop failed for User 'Amministratore'. (Microsoft.SqlServer.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft SQL Server&ProdVer=9.00.0981.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Drop+User&LinkId=20476
-
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
-
The database principal owns a schema and cannot be dropped. (Microsoft SQL Server, Error: 15138)
in sql 2000 I can delete the user very easy, but in sql 2005 I don't understant How to do it.
In SQL Server 2005, schemas are real entities. You cannot drop a user that owns schemas; you first have to either drop the schemas or change their owner to be another user.
Thanks
Laurentiu
The previous answer is helpful. I am just elaborating for newbies in SQL 2005.
1) Expand Schemas(should be like a folder under <yourdatabase> -> Security) .
2) Delete the unwanted "userSchema".
3) Then, go back to the User(a folder like thing) and delete it.
Hi,
I am having the same problem. When i went to delete the schema..i got the error message "drop failed for schema"
Cannot drop schema 'wch1' because it is being referenced by object 'Alert_List'. (.Net SqlClient Data Provider)
any suggestions?
|||Before dropping a schema, it must be empty. Looks like in your case, you still have an object in the schema: Alert_List. You may either choose to drop this object first or you may choose to move it to another schema (using ALTER SCHEMA TRANSFER). When the schema will be empty, you will be able to drop it.
Thanks
Laurentiu
You can query the catalogs. For example, you can execute the following query:
select * from sys.objects where schema_id = schema_id('s')
to find out the objects that reside in schema 's'.
Thanks
Laurentiu
I also had this problem.I was not able to find out which Schema that the login owned.I do not know of a stored proc function that will list ownership of schemas given an owner.Maybe someone can add that to this thread.
I was able to see which schemas were owned by the login by viewing the properties of each schema and seeing who what listed as the owner.
Example:
I opened the properties window of schema db_datareader and notices that the owner was User1.I changed the owner to be db_datareader and then was able to drop user1.
Regards,
DataSort
|||Schemas are owned by users, not by logins. In SQL Server, logins and users are not the same thing.
To find out the schemas owned by a user, you can run the following query:
select * from sys.schemas where principal_id = user_id('user_name')
Thanks
Laurentiu
sql
Can not drop a member from a role
But I can not drop a user from a role. I did it from Management Studio.
It didn't give any error message but even I refresh the db, I can still
see same user in the role.
Then I've tried sp_droprolemember 'X','Y' but same result. Does not
give any error message, looks like it did it. But user is still in the
role.
Even I'm server admin, I can not do it. I'll be happy if someone can
help me to solve the issue.
Thx
AvniCheck out sp_change_users_login. Run it to find the mismatched users, as
well as to correct the problem. Then, drop the role member.
--
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
.
<avni.cengel@.gmail.com> wrote in message
news:1141984205.157637.62570@.u72g2000cwu.googlegroups.com...
I've just changed server from SQL2000 to SQL2005 (by backup/restore).
But I can not drop a user from a role. I did it from Management Studio.
It didn't give any error message but even I refresh the db, I can still
see same user in the role.
Then I've tried sp_droprolemember 'X','Y' but same result. Does not
give any error message, looks like it did it. But user is still in the
role.
Even I'm server admin, I can not do it. I'll be happy if someone can
help me to solve the issue.
Thx
Avni
Can not drop a member from a role
But I can not drop a user from a role. I did it from Management Studio.
It didn't give any error message but even I refresh the db, I can still
see same user in the role.
Then I've tried sp_droprolemember 'X','Y' but same result. Does not
give any error message, looks like it did it. But user is still in the
role.
Even I'm server admin, I can not do it. I'll be happy if someone can
help me to solve the issue.
Thx
AvniCheck out sp_change_users_login. Run it to find the mismatched users, as
well as to correct the problem. Then, drop the role member.
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
.
<avni.cengel@.gmail.com> wrote in message
news:1141984205.157637.62570@.u72g2000cwu.googlegroups.com...
I've just changed server from SQL2000 to SQL2005 (by backup/restore).
But I can not drop a user from a role. I did it from Management Studio.
It didn't give any error message but even I refresh the db, I can still
see same user in the role.
Then I've tried sp_droprolemember 'X','Y' but same result. Does not
give any error message, looks like it did it. But user is still in the
role.
Even I'm server admin, I can not do it. I'll be happy if someone can
help me to solve the issue.
Thx
Avni
Can not drop a member from a role
But I can not drop a user from a role. I did it from Management Studio.
It didn't give any error message but even I refresh the db, I can still
see same user in the role.
Then I've tried sp_droprolemember 'X','Y' but same result. Does not
give any error message, looks like it did it. But user is still in the
role.
Even I'm server admin, I can not do it. I'll be happy if someone can
help me to solve the issue.
Thx
Avni
Check out sp_change_users_login. Run it to find the mismatched users, as
well as to correct the problem. Then, drop the role member.
Tom
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
..
<avni.cengel@.gmail.com> wrote in message
news:1141984205.157637.62570@.u72g2000cwu.googlegro ups.com...
I've just changed server from SQL2000 to SQL2005 (by backup/restore).
But I can not drop a user from a role. I did it from Management Studio.
It didn't give any error message but even I refresh the db, I can still
see same user in the role.
Then I've tried sp_droprolemember 'X','Y' but same result. Does not
give any error message, looks like it did it. But user is still in the
role.
Even I'm server admin, I can not do it. I'll be happy if someone can
help me to solve the issue.
Thx
Avni
sql
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.
sqlCan 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.
Thursday, March 22, 2012
Can not connect to non-default instance from remote computer
After that I installed SQL2000 with instance name "SQL2K". Then I installed
SP4.
I can'not connect to SQL2K instance from remote machine. But if I log on at
machine on which SQL Server installed I can connect to instance.
And I can connect to default instance (SQL2005) from remote machine.
How to solve this problem?
Is the SQL Server Browser service running? It helps resolve names of named
instances to the port number. Since SQL Server 2005 is the default instance,
it is probably using port 1433. Therefore SQL Server 2000 must be using some
other port, but you don't know which port, but the SQL Server Browser
service will know.
Rick Byham
MCDBA, MCSE, MCSA
Lead Technical Writer,
Microsoft, SQL Server Books Online
This posting is provided "as is" with
no warranties, and confers no rights.
"Alexey Rokhin" <ar@.hotmail.com> wrote in message
news:%23PF4wc16FHA.1416@.TK2MSFTNGP09.phx.gbl...
>I installed SQL2005 as default instance.
> After that I installed SQL2000 with instance name "SQL2K". Then I
> installed SP4.
> I can'not connect to SQL2K instance from remote machine. But if I log on
> at machine on which SQL Server installed I can connect to instance.
> And I can connect to default instance (SQL2005) from remote machine.
> How to solve this problem?
>
Can not connect to non-default instance from remote computer
After that I installed SQL2000 with instance name "SQL2K". Then I installed
SP4.
I can'not connect to SQL2K instance from remote machine. But if I log on at
machine on which SQL Server installed I can connect to instance.
And I can connect to default instance (SQL2005) from remote machine.
How to solve this problem?Is the SQL Server Browser service running? It helps resolve names of named
instances to the port number. Since SQL Server 2005 is the default instance,
it is probably using port 1433. Therefore SQL Server 2000 must be using some
other port, but you don't know which port, but the SQL Server Browser
service will know.
--
Rick Byham
MCDBA, MCSE, MCSA
Lead Technical Writer,
Microsoft, SQL Server Books Online
This posting is provided "as is" with
no warranties, and confers no rights.
"Alexey Rokhin" <ar@.hotmail.com> wrote in message
news:%23PF4wc16FHA.1416@.TK2MSFTNGP09.phx.gbl...
>I installed SQL2005 as default instance.
> After that I installed SQL2000 with instance name "SQL2K". Then I
> installed SP4.
> I can'not connect to SQL2K instance from remote machine. But if I log on
> at machine on which SQL Server installed I can connect to instance.
> And I can connect to default instance (SQL2005) from remote machine.
> How to solve this problem?
>
Tuesday, March 20, 2012
Can not Backups on SQL2005
Can not Backups.No Error!
The Code:
Code Snippet
static void Main(string[] args)
{
try
{
SqlConnection Connection = new SqlConnection(@."Data Source=SUPER-9ZT4OE2OQ;Initial Catalog=DataBase;Persist Security Info=True;User ID=tj;password=tj");
Server server = new Server(new ServerConnection(Connection));
Backup bak = new Backup();
bak.Action = BackupActionType.Database;
bak.Database = "DataBase";
BackupDevice backupDevice = new BackupDevice(server, "Full_Backup");
backupDevice.PhysicalLocation = @."\\192.168.2.13\DatabaseBak\over.remoteBak";
backupDevice.BackupDeviceType = BackupDeviceType.Disk;
bak.Devices.AddDevice("Full_Backup", DeviceType.File);
bak.Incremental = false;
bak.SqlBackup(server);
}
catch (Exception)
{
throw;
}
}
Any help is highly appreciated
Thanks.
Try changing the line
bak.Devices.AddDevice(xxx)
to
bak.Devices.Add(xxx)
Here's the example (in VB.Net) from BOL:
'Connect to the local, default instance of SQL Server.
Dim srv As Server
srv = New Server
'Reference the AdventureWorks database.
Dim db As Database
db = srv.Databases("AdventureWorks")
'Define a Backup object variable.
Dim bk As New Backup
'Specify the type of backup, the description, the name, and the database to be backed up.
bk.Action = BackupActionType.Database
bk.Database = "AdventureWorks"
'Declare a BackupDeviceItem by supplying the backup device file name in the constructor, and the type of device is a file.
Dim bdi As BackupDeviceItem
bdi = New BackupDeviceItem("Test_Full_Backup1", DeviceType.File)
'Add the device to the Backup object.
bk.Devices.Add(bdi)
'Run SqlBackup to perform the full database backup on the instance of SQL Server.
bk.SqlBackup(srv)
Can not Backups on SQL2005
Can not Backups.No Error!
The Code:
Code Snippet
static void Main(string[] args)
{
try
{
SqlConnection Connection = new SqlConnection(@."Data Source=SUPER-9ZT4OE2OQ;Initial Catalog=DataBase;Persist Security Info=True;User ID=tj;password=tj");
Server server = new Server(new ServerConnection(Connection));
Backup bak = new Backup();
bak.Action = BackupActionType.Database;
bak.Database = "DataBase";
BackupDevice backupDevice = new BackupDevice(server, "Full_Backup");
backupDevice.PhysicalLocation = @."\\192.168.2.13\DatabaseBak\over.remoteBak";
backupDevice.BackupDeviceType = BackupDeviceType.Disk;
bak.Devices.AddDevice("Full_Backup", DeviceType.File);
bak.Incremental = false;
bak.SqlBackup(server);
}
catch (Exception)
{
throw;
}
}
Any help is highly appreciated
Thanks.
Try changing the line
bak.Devices.AddDevice(xxx)
to
bak.Devices.Add(xxx)
Here's the example (in VB.Net) from BOL:
'Connect to the local, default instance of SQL Server.
Dim srv As Server
srv = New Server
'Reference the AdventureWorks database.
Dim db As Database
db = srv.Databases("AdventureWorks")
'Define a Backup object variable.
Dim bk As New Backup
'Specify the type of backup, the description, the name, and the database to be backed up.
bk.Action = BackupActionType.Database
bk.Database = "AdventureWorks"
'Declare a BackupDeviceItem by supplying the backup device file name in the constructor, and the type of device is a file.
Dim bdi As BackupDeviceItem
bdi = New BackupDeviceItem("Test_Full_Backup1", DeviceType.File)
'Add the device to the Backup object.
bk.Devices.Add(bdi)
'Run SqlBackup to perform the full database backup on the instance of SQL Server.
bk.SqlBackup(srv)
Wednesday, March 7, 2012
Can I use my own Stored Procedure template with SQL2005?
When I go to create a new stored procedure, function, etc. I get a default template... is there anyway to replace this template with one of my own? One that will already have the important information pre-populated (the stuff I always end up having to type in, like company name, etc.).
Hi,
in SQL Server Management Studio, choose View -> Template Explorer. (Or Ctrl + Alt + T). There you can manage templates. Edit them whatsoever.