Showing posts with label tablename. Show all posts
Showing posts with label tablename. Show all posts

Thursday, March 29, 2012

Cannot remove replication

I don't have a SQL 7.0 box at work anymore, but if it
also exists on SQL 7.0, please try using
sp_MSunmarkreplinfo which takes a tablename as a parameter
HTH,
Paul Ibison (SQL Server MVP)
[vbcol=seagreen]Before updatnig system tables, I would recommend making sure you've dropped
the distributor and publisher. In EM from Tools...Replication...configure
publishing subscribers and distributors. Make sure there are no selections
(uncheck all boxes).
Colleen
"Paul Ibison" wrote:

> I don't have a SQL 7.0 box at work anymore, but if it
> also exists on SQL 7.0, please try using
> sp_MSunmarkreplinfo which takes a tablename as a parameter
> HTH,
> Paul Ibison (SQL Server MVP)
>
>
>

Cannot remove replication

I don't have a SQL 7.0 box at work anymore, but if it
also exists on SQL 7.0, please try using
sp_MSunmarkreplinfo which takes a tablename as a parameter
HTH,
Paul Ibison (SQL Server MVP)
[vbcol=seagreen]
Before updatnig system tables, I would recommend making sure you've dropped
the distributor and publisher. In EM from Tools...Replication...configure
publishing subscribers and distributors. Make sure there are no selections
(uncheck all boxes).
Colleen
"Paul Ibison" wrote:

> I don't have a SQL 7.0 box at work anymore, but if it
> also exists on SQL 7.0, please try using
> sp_MSunmarkreplinfo which takes a tablename as a parameter
> HTH,
> Paul Ibison (SQL Server MVP)
>
>
sql

Sunday, March 25, 2012

Cannot Reference Database.Tables Collection By TableName --?

I have been using SMO for a while with no issues... But I just installed the AdventureWorks sample (AdventureWorksDBCI), and when I try to reference a table by name I get a null value:

Code Snippet


db.Tables[7] //this works fine; I can access table props/methods


db.Tables["EmployeePayHistory"] //returns a null

a null value is returned. (not just tables ,but just about any SMO collection).This same syntax works great with many other databases.

This returns true, however:

Code Snippet

db.Tables[7].Name == "EmployeePayHistory" // returns true

So is there some kind of character encoding or something that I need to use when referencing one of these collection items by name?

Try with a schema also :

like this db.Tables["<schema>.EmployeePayHistory"]

that is : db.Tables["dbo.EmployeePayHistory"]

Check the schema name of EmployeePayHistory.

Thanks

Naras.

|||

Yes indeed, the schema was the issue.

I could not access the item in the collection using schema.tablename, but rather using this syntax:

Code Snippet

db.Tables["EmployeePayHistory","HumanResources"]

Thank you for your help!