Showing posts with label working. Show all posts
Showing posts with label working. Show all posts

Friday, March 30, 2012

Invoking a service on firing a trigger

Hi

Im trying to invoke a .Net service when a trigger is fired on a table in SQL Server 2000.

The service is working fine but I need to invoke it when the trigger is fired. How can I achieve this?

Hi!

At first, why do you think your problem is concern with SQL-NS? The second: does you question relate to SQL Server 2005? You have wrote, that the trigger on SQL Server 2000 invokes the service and the services works well.

Then, what do you mean by saying "invokes"? Does the trigger start the service or it just send a message to him?

Invoking a service on firing a trigger

Hi

Im trying to invoke a .Net service when a trigger is fired on a table in SQL Server 2000.

The service is working fine but I need to invoke it when the trigger is fired. How can I achieve this?

Hi!

At first, why do you think your problem is concern with SQL-NS? The second: does you question relate to SQL Server 2005? You have wrote, that the trigger on SQL Server 2000 invokes the service and the services works well.

Then, what do you mean by saying "invokes"? Does the trigger start the service or it just send a message to him?

Wednesday, March 28, 2012

Invalid working directory sp_adddistpublisher

Sam,
try using a non-administrative share, in the form of
\\computername\repldata.
Rgds,
Paul Ibison, SQL Server MVP,
www.replicationanswers.com/default.asp
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
I shared a directory \\computername\temp. Then put that as the working
directory and I still receive the working directory error.
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:0f7201c53b5b$75466ea0$a601280a@.phx.gbl...
> Sam,
> try using a non-administrative share, in the form of
> \\computername\repldata.
> Rgds,
> Paul Ibison, SQL Server MVP,
> www.replicationanswers.com/default.asp
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
|||Are you on workstation or professional? Sometimes these versions are
limited by the number of simultaneous share accesses.
Run a net stop server and net start server to see if this fixes the
problem.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
|||It still didn't work and I can access the directories when I type them in to
the explorer windows. I believe when I tried running the stored procedure in
query analyzer and it was sucessful. But when I run it from VB it does not
work. All other sp calls are working.
Again here is a repost of my last code section. It is very straightforward
but I don't understand why it works in QA and not VB:
Set cmd = New ADODB.Command
cmd.ActiveConnection = cn
cmd.CommandText = "sp_adddistpublisher"
cmd.CommandType = adCmdStoredProc
cmd.Parameters.Append cmd.CreateParameter("@.publisher", adVarChar,
adParamInput, 255)
cmd.Parameters.Append cmd.CreateParameter("@.distribution_db", adVarChar,
adParamInput, 255)
cmd.Parameters.Append cmd.CreateParameter("@.security_mode", adInteger,
adParamInput)
cmd.Parameters.Append cmd.CreateParameter("@.working_directory", adVarChar,
adParamInput, 255)
cmd.Parameters.Append cmd.CreateParameter("@.trusted", adVarChar,
adParamInput, 255)
cmd.Parameters.Append cmd.CreateParameter("@.thirdparty_flag", adInteger,
adParamInput)
cmd("@.publisher") = "BUSHWACKER"
cmd("@.distribution_db") = "distribution"
cmd("@.security_mode") = 1
cmd("@.working_directory") = "\\BUSHWACKER\C\temp"
cmd("@.trusted") = "false"
cmd("@.thirdparty_flag") = 0
cmd.Execute
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:opsov3eagkrj9kur@.hcottter-lap.ap.org...
> Are you on workstation or professional? Sometimes these versions are
> limited by the number of simultaneous share accesses.
> Run a net stop server and net start server to see if this fixes the
> problem.
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
|||Sam,
did you mean to post \\BUSHWACKER\C\temp? Surely it should be
\\BUSHWACKER\temp?
Rgds,
Paul Ibison
"Sam" <sam@.info.com> wrote in message
news:115gblqqpphh46c@.corp.supernews.com...
> It still didn't work and I can access the directories when I type them in
> to
> the explorer windows. I believe when I tried running the stored procedure
> in
> query analyzer and it was sucessful. But when I run it from VB it does
> not
> work. All other sp calls are working.
> Again here is a repost of my last code section. It is very straightforward
> but I don't understand why it works in QA and not VB:
> Set cmd = New ADODB.Command
> cmd.ActiveConnection = cn
> cmd.CommandText = "sp_adddistpublisher"
> cmd.CommandType = adCmdStoredProc
> cmd.Parameters.Append cmd.CreateParameter("@.publisher", adVarChar,
> adParamInput, 255)
> cmd.Parameters.Append cmd.CreateParameter("@.distribution_db", adVarChar,
> adParamInput, 255)
> cmd.Parameters.Append cmd.CreateParameter("@.security_mode", adInteger,
> adParamInput)
> cmd.Parameters.Append cmd.CreateParameter("@.working_directory", adVarChar,
> adParamInput, 255)
> cmd.Parameters.Append cmd.CreateParameter("@.trusted", adVarChar,
> adParamInput, 255)
> cmd.Parameters.Append cmd.CreateParameter("@.thirdparty_flag", adInteger,
> adParamInput)
> cmd("@.publisher") = "BUSHWACKER"
> cmd("@.distribution_db") = "distribution"
> cmd("@.security_mode") = 1
> cmd("@.working_directory") = "\\BUSHWACKER\C\temp"
> cmd("@.trusted") = "false"
> cmd("@.thirdparty_flag") = 0
> cmd.Execute
> "Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
> news:opsov3eagkrj9kur@.hcottter-lap.ap.org...
>
|||yes I used the \\bushwacker\temp in the actual stored procedure. Why does
it work there and not in the source code of vb.
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:#ytrEWUPFHA.3408@.TK2MSFTNGP14.phx.gbl...[vbcol=seagreen]
> Sam,
> did you mean to post \\BUSHWACKER\C\temp? Surely it should be
> \\BUSHWACKER\temp?
> Rgds,
> Paul Ibison
> "Sam" <sam@.info.com> wrote in message
> news:115gblqqpphh46c@.corp.supernews.com...
in[vbcol=seagreen]
procedure[vbcol=seagreen]
straightforward[vbcol=seagreen]
adVarChar,
>
|||Sam,
just to confirm, you previously posted up : cmd("@.working_directory") =
"\\BUSHWACKER\C\temp"
this looks like a copy and paste from a .NET application, and I can't
imagine you retyped it all, so did you later change it and remove the '\C'?
Assuming you have tried \\BUSHWACKER\temp ... I don't have .NET installed on
my virtual PC, but perhaps there is a way you could narrow down the issue.
Create a wrapper stored procedure that calls sp_adddistpublisher and check
it works in QA with no values for the parameters ie set up defaults to each
parameter in the wrapper procedure. Call this proicedure from .NET as you
have done without parameters and check this works. Then add just the wrapper
version of @.working_directory to the parameters collection and send it
through to call the real sp_adddistpublisher. At some stage in the above
process, it should become clearer what the issue is.
Rgds,
Paul Ibison
|||Yes the code I copy and pasted was the code I used after the initial
failure. Sorry for the confusion. I used \\BUSHWACKER\temp
in the code I was testing on before I posted to the newsgroup.
I will try what you have mentioned below. Its a very good idea. I assume
you want to see if its related to permissions or the sp call from vb thats
causing the error. Am I correct?
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:Ozeo#9qPFHA.532@.TK2MSFTNGP09.phx.gbl...
> Sam,
> just to confirm, you previously posted up : cmd("@.working_directory") =
> "\\BUSHWACKER\C\temp"
> this looks like a copy and paste from a .NET application, and I can't
> imagine you retyped it all, so did you later change it and remove the
'\C'?
> Assuming you have tried \\BUSHWACKER\temp ... I don't have .NET installed
on
> my virtual PC, but perhaps there is a way you could narrow down the issue.
> Create a wrapper stored procedure that calls sp_adddistpublisher and check
> it works in QA with no values for the parameters ie set up defaults to
each
> parameter in the wrapper procedure. Call this proicedure from .NET as you
> have done without parameters and check this works. Then add just the
wrapper
> version of @.working_directory to the parameters collection and send it
> through to call the real sp_adddistpublisher. At some stage in the above
> process, it should become clearer what the issue is.
> Rgds,
> Paul Ibison
>
|||Adding the stored procedure to a wrapper worked and when I add it to VB it
works as well.
Why won't it work directly though?
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:Ozeo#9qPFHA.532@.TK2MSFTNGP09.phx.gbl...
> Sam,
> just to confirm, you previously posted up : cmd("@.working_directory") =
> "\\BUSHWACKER\C\temp"
> this looks like a copy and paste from a .NET application, and I can't
> imagine you retyped it all, so did you later change it and remove the
'\C'?
> Assuming you have tried \\BUSHWACKER\temp ... I don't have .NET installed
on
> my virtual PC, but perhaps there is a way you could narrow down the issue.
> Create a wrapper stored procedure that calls sp_adddistpublisher and check
> it works in QA with no values for the parameters ie set up defaults to
each
> parameter in the wrapper procedure. Call this proicedure from .NET as you
> have done without parameters and check this works. Then add just the
wrapper
> version of @.working_directory to the parameters collection and send it
> through to call the real sp_adddistpublisher. At some stage in the above
> process, it should become clearer what the issue is.
> Rgds,
> Paul Ibison
>
|||Sam,
if you can send through the path as a parameter, then this is good news. I
don't know why the original didn't work, and am interested to find out. I'll
take a look when I get .NET installed.
Rgds,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)

Monday, March 26, 2012

invalid reconciler parameter

First of all... thanks for a great and interesting product... this is really nice...

I'm working with a winform app and pushing it out via click-once deployment (using the bootstrapper for SQLCompact as well)... the SQL install is fine, however when my app attempts to do anything with the db, i get an error "invalid reconciler parameter" error... some searching seems to indicate that this could be coming from the path being longer than 128chars... howeve, using click once, i'm not certain I can control the deployment location... I'm certain that there is a work around, but not sure what it is... any guidance?

As a note, running the app on the same machine using the output from VS (not installed via ClickOnce but simply running hte exe) works fine...

Thanks,

Rob

Just to close the loop on this thread... SSCE RTM'd today and this problem does not repro in the RTM bits.

thanks.

|||

I am having exactly the same problem but don't understand your response ? I have installed the latest versions of SQL Compact Edition including SDK, Server Tools, VS Tools and Runtime and I'm still getting the "invalid reconciler parameter" using ClickOnce.

Please help.

|||Rob how did you resolve this issue ?

sql

invalid reconciler parameter

First of all... thanks for a great and interesting product... this is really nice...

I'm working with a winform app and pushing it out via click-once deployment (using the bootstrapper for SQLCompact as well)... the SQL install is fine, however when my app attempts to do anything with the db, i get an error "invalid reconciler parameter" error... some searching seems to indicate that this could be coming from the path being longer than 128chars... howeve, using click once, i'm not certain I can control the deployment location... I'm certain that there is a work around, but not sure what it is... any guidance?

As a note, running the app on the same machine using the output from VS (not installed via ClickOnce but simply running hte exe) works fine...

Thanks,

Rob

Just to close the loop on this thread... SSCE RTM'd today and this problem does not repro in the RTM bits.

thanks.

|||

I am having exactly the same problem but don't understand your response ? I have installed the latest versions of SQL Compact Edition including SDK, Server Tools, VS Tools and Runtime and I'm still getting the "invalid reconciler parameter" using ClickOnce.

Please help.

|||Rob how did you resolve this issue ?

Invalid object name...

Hello all,
however, this is my first question to this news. I am working with RS SP1,
and have question. I have example procedure:
CREATE PROCEDURE GEGE_test_a
@.ord SQL_VARIANT AS
SET NOCOUNT ON
CREATE TABLE #table (ID SQL_VARIANT)
INSERT INTO #table(ID) VALUES (@.ord)
SELECT * FROM #table
DROP TABLE #table
GO
When I want add DataSet with this procedure (EXECUTE GEGE_test_a @.OrderID) I
get following error:
Could not generate a list of fields for the querry...
Invalid object name #table
Ofcourse, this procedure works good in Query Analyser. Anyone has idea, why
this is not working ?
--
Ing. Branislav GerzoI got it to work w/o a problem. However, I do see the same error if I enter
the (EXECUTE GEGE_test_a @.OrderID) statement in the dataset creation dialog
box while attempting to define the dataset it uses. Try actually executing
the procedure with a parameter or passing in a static value from the Generic
Query Designer data window once you've defined the dataset. If you use
static value like (EXECUTE GEGE_test_a '11'), simply change it after to use
your query parm.
--
-- "This posting is provided 'AS IS' with no warranties, and confers no
rights."
jhmiller@.online.microsoft.com
"Ing. Branislav Gerzo" <IngBranislavGerzo@.discussions.microsoft.com> wrote
in message news:0B87A6E5-C4C2-452E-A601-5B76C6DA3D75@.microsoft.com...
> Hello all,
> however, this is my first question to this news. I am working with RS SP1,
> and have question. I have example procedure:
> CREATE PROCEDURE GEGE_test_a
> @.ord SQL_VARIANT AS
> SET NOCOUNT ON
> CREATE TABLE #table (ID SQL_VARIANT)
> INSERT INTO #table(ID) VALUES (@.ord)
> SELECT * FROM #table
> DROP TABLE #table
> GO
> When I want add DataSet with this procedure (EXECUTE GEGE_test_a @.OrderID)
> I
> get following error:
> Could not generate a list of fields for the querry...
> Invalid object name #table
> Ofcourse, this procedure works good in Query Analyser. Anyone has idea,
> why
> this is not working ?
> --
> Ing. Branislav Gerzo|||Use a table ariable instead of the temp table:
ALTER PROCEDURE GEGE_test_a
@.ord SQL_VARIANT AS
SET NOCOUNT ON
DECLARE @.table TABLE(ID SQL_VARIANT)
INSERT INTO @.table(ID) VALUES (@.ord)
SELECT * FROM @.table
GO
--
Dejan Sarka, SQL Server MVP
Associate Mentor
www.SolidQualityLearning.com
"Ing. Branislav Gerzo" <IngBranislavGerzo@.discussions.microsoft.com> wrote
in message news:0B87A6E5-C4C2-452E-A601-5B76C6DA3D75@.microsoft.com...
> Hello all,
> however, this is my first question to this news. I am working with RS SP1,
> and have question. I have example procedure:
> CREATE PROCEDURE GEGE_test_a
> @.ord SQL_VARIANT AS
> SET NOCOUNT ON
> CREATE TABLE #table (ID SQL_VARIANT)
> INSERT INTO #table(ID) VALUES (@.ord)
> SELECT * FROM #table
> DROP TABLE #table
> GO
> When I want add DataSet with this procedure (EXECUTE GEGE_test_a @.OrderID)
I
> get following error:
> Could not generate a list of fields for the querry...
> Invalid object name #table
> Ofcourse, this procedure works good in Query Analyser. Anyone has idea,
why
> this is not working ?
> --
> Ing. Branislav Gerzo|||Dejan Sarka [DS], on Friday, October 29, 2004 at 17:17 (+0200)
contributed this to our collective wisdom:
DS> Use a table ariable instead of the temp table:
DS> ALTER PROCEDURE GEGE_test_a
DS> @.ord SQL_VARIANT AS
DS> SET NOCOUNT ON
DS> DECLARE @.table TABLE(ID SQL_VARIANT)
DS> INSERT INTO @.table(ID) VALUES (@.ord)
DS> SELECT * FROM @.table
DS> GO
thanks, I was afraid that someone will answer like this. Ofcourse,
this works, but my problem is, that in my situation I have to fill
@.table_var with result of another procedure. And I found this:
http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q305977&
A3:
1. Tables variables cannot be used in a INSERT EXEC or SELECT INTO
statement.
2. You cannot use the EXEC statement or the sp_executesql stored
procedure to run a dynamic SQL Server query that refers a table
variable, if the table variable was created outside the EXEC statement
or the sp_executesql stored procedure. Because table variables can be
referenced in their local scope only, an EXEC statement and a
sp_executesql stored procedure would be outside the scope of the table
variable. However, you can create the table variable and perform all
processing inside the EXEC statement or the sp_executesql stored
procedure because then the table variables local scope is in the EXEC
statement or the sp_executesql stored procedure.
Ofcourse, i'd like to use table variables, they are fast, they are
cool. But, how to fill them with result of another procedure ?
I can't cheat them in any way, I have only one idea for that -
procedure which fill @.tabl_var using cursors. But I hope there is
better way do this.
Dejan, please help.
--
...m8s, cu l8r, Brano.
[Alright, who g r e a s e d the tagline?.]|||John H. Miller [JHM], on Friday, October 29, 2004 at 11:14 (-0400)
typed the following:
JHM> I got it to work w/o a problem. However, I do see the same error if I
enter
JHM> the (EXECUTE GEGE_test_a @.OrderID) statement in the dataset creation
dialog
JHM> box while attempting to define the dataset it uses.
anyone knows, why this error occurs ? I can't use temp tables in my
procedures ?
JHM> Try actually executing
JHM> the procedure with a parameter or passing in a static value from the
Generic
JHM> Query Designer data window once you've defined the dataset. If you use
JHM> static value like (EXECUTE GEGE_test_a '11'), simply change it after to
use
JHM> your query parm.
No, it also doesn't work, I get the same message back. (could not
generate a list...). I really don't know why, it is known bug, or
what?
Thanks a lot. My all work stops on this :(((
--
...m8s, cu l8r, Brano.
[Applaflammaphobia: A vacation fear that the house will bu]

invalid object name..(my error message)

i'm working on an application using vs 2005, sql server2000, with c# asp.net

i can access many tables in my db that the dbo is the dbowner for them, but when i access few tables that the owner for them is dswebwork, i recieved an error says, invalid object name tbluser...which tbluser is table name...this is the error message in details....

Invalid object name 'tblUsers'.

Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:System.Data.SqlClient.SqlException: Invalid object name 'tblUsers'.

Source Error:

Line 57: string passWord = txtPassword.Text;Line 58:Line 59: Users users = new Users(Constants.DB_CONNECTION,Line 60: userName, passWord);Line 61:


Source File:e:\web works\Webworks\DSCWebWorks\LoginMaster.master.cs Line:59

Stack Trace:

[SqlException (0x80131904): Invalid object name 'tblUsers'.] System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +95 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +82 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +346 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +3244 System.Data.SqlClient.SqlDataReader.ConsumeMetaData() +52 System.Data.SqlClient.SqlDataReader.get_MetaData() +130 System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +371 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +1121 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +334 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +45 System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +162 System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) +35 System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) +32 System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +183 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +307 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) +151 WebWorksBO.DBElements.BaseDataSQLClient.FillDataset(DataSet dsToFill) in C:\Development\MyWebWorks20\WebWorksBO\DBElements\BaseDataSQLClient.cs:97 WebWorksBO.DBElements.dbUsers..ctor(String connStr, String loginname, String loginpassword) in C:\Development\MyWebWorks20\WebWorksBO\DBElements\dbUsers.cs:38 WebWorksBO.AppElements.Users..ctor(String connStr, String loginname, String loginpassword) in C:\Development\MyWebWorks20\WebWorksBO\AppElements\Users.cs:370 LoginMaster.LoginUser() in e:\web works\Webworks\DSCWebWorks\LoginMaster.master.cs:59 LoginMaster.imgbtnOK_Click(Object sender, ImageClickEventArgs e) in e:\web works\Webworks\DSCWebWorks\LoginMaster.master.cs:46 System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +102 System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +141 System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +31 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +32 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +72 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3840


so..i hope to help me...i need to deploy this project soon...

Append the owner to the table name, when you use it or change the owner to dbo

Select * from dswebwork.tblUsers

Friday, March 23, 2012

Invalid object name 'dbo.sysmergepublications'

I am working with SQL Server 2005 and having problems with the publisher.
After I installed SQL and setup my database, I setup the server as both the
distributor and the publisher. Then I setup a merge publication that worked
fine with SQL Mobile 2005, I didn't have any problems with synchronization
and everything seemed fine. I deleted that publication and went through the
New Publication Wizard to create a new publication, but at the end I get the
following message:
TITLE: New Publication Wizard
SQL Server could not create publication 'MRSTest'.
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch.
(Microsoft.SqlServer.ConnectionInfo)
Invalid object name 'dbo.sysmergepublications'.
Publication 'MRSTest' does not exist.
Changed database context to 'MRS'. (Microsoft SQL Server, Error: 208)
For help, click: http://go.microsoft.com/fwlink?
ProdName=Microsoft+SQL+Server&ProdVer=09.00.
1399&EvtSrc=MSSQLServer&EvtID=208&LinkId=20476
I looked and sure enough all those tables were gone out of my database under
System Tables. I found a stored procedure to recreated all those tables,
and although it did recreate them, it didn't fix the problem. I have trid
to disable Publisher but I get the following error:
TITLE: Publisher Properties
An error occurred while saving publication database.
Do you want to continue saving other changes?
For help, click: http://go.microsoft.com/fwlink?
ProdName=Microsoft+SQL+Server&ProdVer=9.00.1399.06 &EvtSrc=Microsoft.
SqlServer.Management.UI.
PubshrPropertiesErrorSR&EvtID=ErrorSavingPubDB&Lin kId=20476
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch.
(Microsoft.SqlServer.ConnectionInfo)
Invalid object name 'dbo.sysmergesubscriptions'.
Changed database context to 'MRS'. (Microsoft SQL Server, Error: 208)
For help, click: http://go.microsoft.com/fwlink?
ProdName=Microsoft+SQL+Server&ProdVer=09.00.
1399&EvtSrc=MSSQLServer&EvtID=208&LinkId=20476
This happened one other time when I deleted a publication and I ended up
reinstalling SQL. This is just a test database so it really isn't a big
deal, it's just time consuming. Could this be happening because I am in
there a lot changing the Publication and Article properties? I will be
moving this to a production server soon and although I doubt I will be
deleting any Publications, just in case I really need to know how to fix it.
Any help would really be appreciated in fixing this on my development server
along with how to prevent it from happening in the future.
Thanks,
Heather
Can you create a new publication with a different name?
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Heather B." <hbaker@.pro-merchnospam.com> wrote in message
news:975c64b3907e4dbb9353419093e55256@.ureader.com. ..
>I am working with SQL Server 2005 and having problems with the publisher.
> After I installed SQL and setup my database, I setup the server as both
> the
> distributor and the publisher. Then I setup a merge publication that
> worked
> fine with SQL Mobile 2005, I didn't have any problems with synchronization
> and everything seemed fine. I deleted that publication and went through
> the
> New Publication Wizard to create a new publication, but at the end I get
> the
> following message:
> TITLE: New Publication Wizard
> --
> SQL Server could not create publication 'MRSTest'.
> --
> ADDITIONAL INFORMATION:
> An exception occurred while executing a Transact-SQL statement or batch.
> (Microsoft.SqlServer.ConnectionInfo)
> --
> Invalid object name 'dbo.sysmergepublications'.
> Publication 'MRSTest' does not exist.
> Changed database context to 'MRS'. (Microsoft SQL Server, Error: 208)
> For help, click: http://go.microsoft.com/fwlink?
> ProdName=Microsoft+SQL+Server&ProdVer=09.00.
> 1399&EvtSrc=MSSQLServer&EvtID=208&LinkId=20476
> I looked and sure enough all those tables were gone out of my database
> under
> System Tables. I found a stored procedure to recreated all those tables,
> and although it did recreate them, it didn't fix the problem. I have trid
> to disable Publisher but I get the following error:
> TITLE: Publisher Properties
> --
> An error occurred while saving publication database.
> Do you want to continue saving other changes?
> For help, click: http://go.microsoft.com/fwlink?
> ProdName=Microsoft+SQL+Server&ProdVer=9.00.1399.06 &EvtSrc=Microsoft.
> SqlServer.Management.UI.
> PubshrPropertiesErrorSR&EvtID=ErrorSavingPubDB&Lin kId=20476
> --
> ADDITIONAL INFORMATION:
> An exception occurred while executing a Transact-SQL statement or batch.
> (Microsoft.SqlServer.ConnectionInfo)
> --
> Invalid object name 'dbo.sysmergesubscriptions'.
> Changed database context to 'MRS'. (Microsoft SQL Server, Error: 208)
> For help, click: http://go.microsoft.com/fwlink?
> ProdName=Microsoft+SQL+Server&ProdVer=09.00.
> 1399&EvtSrc=MSSQLServer&EvtID=208&LinkId=20476
> This happened one other time when I deleted a publication and I ended up
> reinstalling SQL. This is just a test database so it really isn't a big
> deal, it's just time consuming. Could this be happening because I am in
> there a lot changing the Publication and Article properties? I will be
> moving this to a production server soon and although I doubt I will be
> deleting any Publications, just in case I really need to know how to fix
> it.
>
> Any help would really be appreciated in fixing this on my development
> server
> along with how to prevent it from happening in the future.
> Thanks,
> Heather
|||No, it doesn't matter what I name it I cannot create another merge
publication. I can create a snapshot publication, but that doesn't really
help.
|||You shouldn't have to reinstall. You mention "I found a stored procedure to
recreated all those tables, and although it did recreate them, it didn't fix
the problem"
What was this proc and where did you find it?
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Heather B." <hbaker@.pro-merchnospam.com> wrote in message
news:04535b948bf74617a5bdfcf4fba91355@.ureader.com. ..
> No, it doesn't matter what I name it I cannot create another merge
> publication. I can create a snapshot publication, but that doesn't really
> help.
|||I found this in a forum somewhere, when I ran it all the tables seemed to be
there, but when I tried to create a new publication I still go an error.
This time it would say something about a field missing, I don't remember
which field but I do remember that I looked in the table and it was there.
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER procedure [dbo].[sp_MScreate_mergesystables] as
/* This is to make sure that the varbinary columns do not get padded */
set ANSI_PADDING off
DECLARE @.exist bit
DECLARE @.validsubs int
select @.exist = 1
begin tran
save transaction MScreate_mergesystables
exec dbo.sp_MScheckvalidsystables @.validsubs output
if @.validsubs = 0
exec dbo.sp_MSdrop_mergesystables
if not exists (select * from sysobjects where name = 'sysmergepublications')
begin
raiserror('Creating table sysmergepublications',0,1)
create table dbo.sysmergepublications
(publishersysname NOT NULL default @.@.servername,
publisher_dbsysname NOT NULL default db_name(),
namesysnameNOT NULL,
descriptionnvarchar(255) NULL,
retentionintNULL,
publication_type tinyintNULL,
pubid uniqueidentifier NOT NULL,
designmasteriduniqueidentifier NULL,
parentiduniqueidentifier NULL,
sync_modetinyintNULL,
allow_pushintNULL,
allow_pullintNULL,
allow_anonymousintNULL,
centralized_conflictsintNULL,
statustinyintNULL,
snapshot_readytinyintNULL,
enabled_for_internet bit NOT NULL default 0,
dynamic_filtersbitNOT NULL default 0,
-- portable snapshot support
snapshot_in_defaultfolder bit NOT NULL default
1,
alt_snapshot_folder nvarchar(255) NULL,
-- Pre/post - snapshot commands
pre_snapshot_script nvarchar(255) NULL,
post_snapshot_script nvarchar(255) NULL,
-- Snapshot compression
compress_snapshot bit NOT NULL default
0,
-- Post 7.0 Ftp support
ftp_address sysname NULL,
ftp_port int NOT NULL default
21,
ftp_subdirectory nvarchar(255) NULL,
ftp_login sysname NULL default
N'anonymous',
ftp_password nvarchar(524) NULL,
conflict_retentionintNULL,
keep_before_valuesintNULL default 0,
allow_subscription_copybit NULL default 0,
allow_synctoalternatebit NULL default 0,
validate_subscriber_infonvarchar(500)NULL,
ad_guidnamesysnameNULL,
backward_comp_levelintnot NULL default 10, --7.0 RTM
max_concurrent_mergeintnot NULL default 0,
max_concurrent_dynamic_snapshots int not NULL default
0
)
if @.@.ERROR <> 0
goto Error
CREATE UNIQUE NONCLUSTERED INDEX nc1sysmergepublications
ON sysmergepublications(pubid)
if @.@.ERROR <> 0
goto Error
exec dbo.sp_MS_marksystemobject sysmergepublications
if @.@.ERROR <> 0
goto Error
-- grant select on sysmergepublications to public
end
if not exists (select * from sysobjects where name = 'MSmerge_errorlineage')
begin
raiserror('Creating table MSmerge_errorlineage',0,1)
create table dbo.MSmerge_errorlineage (
tablenickint NOT NULL,
rowguiduniqueidentifier NOT NULL,
lineagevarbinary(255)
)
exec dbo.sp_MS_marksystemobject MSmerge_errorlineage
if @.@.ERROR <> 0
goto Error
create unique clustered index uc1errorlineage on
MSmerge_errorlineage(tablenick, rowguid)
if @.@.ERROR <> 0
goto Error
--grant select on MSmerge_errorlineage to public
end
-- this table exists at distribution/db and subscriber databse both
if not exists (select * from sysobjects where name =
'MSrepl_identity_range')
begin
raiserror('Creating table MSrepl_identity_range',0,1)
create table dbo.MSrepl_identity_range (
objidint not NULL primary key,
next_seedbigint NULL, --resource control
pub_rangebigint NULL, --publisher range
rangebigint NULL, -- set by sp_addmergearticle
max_identitybigint NULL, --resource control
thresholdintNULL,--in percentage, set by sp_addmergearticle
current_maxbigint NULL--max value for current check constraint,set
by sp_addmergearticle
)
exec dbo.sp_MS_marksystemobject MSrepl_identity_range
if @.@.ERROR <> 0
goto Error
--grant select on MSrepl_identity_range to public
end
if not exists (select * from sysobjects where name = 'sysmergearticles')
begin
raiserror('Creating table sysmergearticles',0,1)
create table dbo.sysmergearticles (
namesysnameNOT NULL,
type tinyint NULL,
objidintNOT NULL,
sync_objidintNOT NULL,
view_type tinyintNULL,
artiduniqueidentifierNOT NULL,
description nvarchar(255) NULL,
pre_creation_commandtinyintNULL,
pubiduniqueidentifier NOT NULL,
nicknameintNOT NULL,
column_trackingintNOT NULL,
statustinyintNULL,
conflict_tablesysnameNULL,
creation_scriptnvarchar(255)NULL,
conflict_scriptnvarchar(255)NULL,
article_resolvernvarchar(255)NULL,
ins_conflict_procsysnameNULL,
insert_procsysnameNULL,
update_procsysnameNULL,
select_procsysnameNULL,
schema_option binary(8) NULL,
destination_objectsysnameNOT NULL,
destination_ownersysnameNULL,
resolver_clsidnvarchar(50)NULL,
subset_filterclause nvarchar(1000) NULL,
missing_col_countintNULL,
missing_colsvarbinary(128)NULL,
excluded_colsvarbinary(128)NULL,
excluded_col_countintnot NULL default 0,
columns varbinary(128) NULL,
resolver_infonvarchar(255)NULL,
view_sel_procnvarchar(290)NULL,
gen_curintNULL,
vertical_partitionintnot NULL default 0,
identity_supportintnot NULL default 0,
before_image_objidintNULL,
before_view_objidintNULL,
verify_resolver_signature intNULL,
allow_interactive_resolverbitNOT NULL default 0,
fast_multicol_updateprocbitNOT NULL default 0,
check_permissionsintNOT NULL default 0,
maxversion_at_cleanupintNOT NULL default 1,
published_in_tran_pubbitNOT NULL default 0
-- Note: Please update sysmergeextendedarticlesview
whenever
-- there is a schema change in sysmergearticles
)
if @.@.error<>0
goto Error
else
begin
create unique clustered index uc1sysmergearticles
on sysmergearticles(artid, pubid)
if @.@.ERROR <> 0
goto Error
if not exists (select * from sysindexes where name =
'nc1sysmergearticles')
begin
create nonclustered index nc1sysmergearticles on
sysmergearticles(nickname)
if @.@.ERROR <> 0
return 1
end
end
exec dbo.sp_MS_marksystemobject sysmergearticles
if @.@.ERROR <> 0
goto Error
grant select(nickname,gen_cur,maxversion_at_cleanup) on sysmergearticles
to public
end
if not exists (select * from sysobjects where name =
'sysmergeschemaarticles')
begin
-- The extended merge articles table is for storing
-- schema only article information.
-- The current supported schema only articles are
-- stored procs and views.
raiserror('Creating table sysmergeschemaarticles',0,1)
create table dbo.sysmergeschemaarticles
( name sysname NOT NULL,
type tinyint NULL,
objid int NOT NULL,
artid uniqueidentifier NOT NULL,
description nvarchar(255) NULL,
pre_creation_command tinyint NULL,
pubid uniqueidentifier NOT NULL,
status tinyint NULL,
creation_script nvarchar(255) NULL,
schema_option binary(8) NULL,
destination_object sysname NOT NULL,
destination_owner sysname NULL
-- Note: Please update sysmergeextendedarticlesview
whenever
-- there is a schema change in sysmergeschemaarticles
)
if @.@.error<>0
goto Error
else
begin
create unique clustered index uc1sysmergeschemaarticles
on sysmergeschemaarticles(artid, pubid)
if @.@.ERROR <> 0
goto Error
end
exec dbo.sp_MS_marksystemobject sysmergeschemaarticles
if @.@.ERROR <> 0
goto Error
end
if exists (select * from sysobjects where name =
'sysmergeextendedarticlesview')
begin
drop view dbo.sysmergeextendedarticlesview
end
exec ('create view dbo.sysmergeextendedarticlesview
as
select name, type, objid, sync_objid, view_type, artid,
description, pre_creation_command, pubid,
nickname, column_tracking, status, conflict_table, creation_script,
conflict_script, article_resolver,
ins_conflict_proc, insert_proc, update_proc, select_proc,
schema_option, destination_object,
resolver_clsid, subset_filterclause, missing_col_count, missing_cols,
columns, resolver_info,
view_sel_proc, gen_cur, excluded_cols, excluded_col_count,
vertical_partition, identity_support,
destination_owner, before_image_objid, before_view_objid,
verify_resolver_signature,
allow_interactive_resolver, fast_multicol_updateproc,
check_permissions, maxversion_at_cleanup,
published_in_tran_pub
from sysmergearticles
union all
select name, type, objid, NULL, NULL, artid, description,
pre_creation_command, pubid,
NULL, NULL, status, NULL, creation_script, NULL, NULL,
NULL, NULL, NULL, NULL, schema_option, destination_object,
NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL,
destination_owner, NULL, NULL, NULL,
0, 0, 0, NULL, 0
from sysmergeschemaarticles
go')
if @.@.error <> 0
goto Error
exec dbo.sp_MS_marksystemobject sysmergeextendedarticlesview
if not exists (select * from sysobjectswhere name =
'sysmergesubscriptions')
begin
raiserror('Creating table sysmergesubscriptions',0,1)
create table dbo.sysmergesubscriptions
(
subid uniqueidentifier NOT NULL,
partnerid uniqueidentifier NOT NULL,
datasource_typeintNOT NULL,
datasource_pathnvarchar(255)NULL,
srvid intNOT NULL,
db_name sysname NOT NULL
constraint unique_pubsrvdb unique nonclustered (pubid, srvid,
db_name),
pubiduniqueidentifier NULL,
status tinyint NOT NULL,
subscriber_typeintNOT NULL,
subscription_typeintNOT NULL,
priorityrealNOT NULL,
sync_type tinyintNOT NULL,-- 1 = automatic 2 = no sync
descriptionnvarchar(255)NULL,
login_namesysnameNOT NULL,
last_validateddatetimeNULL,
subscriber_serversysnameNULL,
use_interactive_resolverbitNOT NULL default 0,
publicationsysname NULL,
distributorsysname NULL,
validation_levelintnot NULL default 0,
resync_genintnot NULL default -1,
attempted_validatedatetimeNULL,
last_sync_datedatetimeNULL,
last_sync_statusintNULL,
last_sync_summarysysnameNULL
)
if @.@.error<>0
goto Error
else
begin
create unique clustered index uc1sysmergesubscriptions
on sysmergesubscriptions (subid)
if @.@.ERROR<>0
goto Error
create index nc2sysmergesubscriptions on sysmergesubscriptions (srvid,
db_name)
if @.@.ERROR<>0
goto Error
end
exec dbo.sp_MS_marksystemobject sysmergesubscriptions
if @.@.ERROR <> 0
goto Error
--grant select on sysmergesubscriptions to public
end
if not exists (select * from sysobjectswhere name = 'MSmerge_replinfo')
begin
raiserror('Creating table MSmerge_replinfo',0,1)
create table dbo.MSmerge_replinfo
(
repid uniqueidentifier NOT NULL,
replnicknameintNOT NULL,
recgenint NULL,
recguiduniqueidentifier NULL,
sentgenint NULL,
sentguiduniqueidentifier NULL,
schemaversionint NULL,
schemaguiduniqueidentifier NULL,
merge_jobidbinary(16)NULL,
snapshot_jobidbinary(16)NULL
)
if @.@.ERROR <> 0
goto Error
else
begin
create unique clustered index uc1MSmerge_replinfo
on MSmerge_replinfo (repid)
if @.@.ERROR <> 0
goto Error
end
exec dbo.sp_MS_marksystemobject MSmerge_replinfo
if @.@.ERROR <> 0
goto Error
--grant select on MSmerge_replinfo to public
end
if not exists (select * from sysobjectswhere name = 'MSmerge_tombstone')
begin
raiserror('Creating table MSmerge_tombstone',0,1)
create table dbo.MSmerge_tombstone
(
rowguiduniqueidentifier rowguidcol NOT NULL,
tablenickintNOT NULL,
typetinyintNOT NULL,
lineagevarbinary(249)NOT NULL,
generationintNOT NULL,
reasonnvarchar(255)NOT NULL,
)
if @.@.ERROR <> 0
goto Error
else
begin
create unique clustered index uc1MSmerge_tombstone
on MSmerge_tombstone (tablenick DESC, rowguid)
if @.@.ERROR <> 0goto Error
create index nc2MSmerge_tombstone
on MSmerge_tombstone (generation)
if @.@.ERROR <> 0goto Error
end
exec dbo.sp_MS_marksystemobject MSmerge_tombstone
if @.@.ERROR <> 0
goto Error
--grant select on MSmerge_tombstone to public
end
if not exists (select * from sysobjectswhere name = 'MSmerge_contents')
begin
raiserror('Creating table MSmerge_contents',0,1)
create table dbo.MSmerge_contents
(
tablenickintNOT NULL,
rowguiduniqueidentifier rowguidcol NOT NULL,
generationintNOT NULL,
partchangegenintNULL,
joinchangegenintNULL,
lineagevarbinary(249)NOT NULL,
colv1varbinary(2048)NULL,
)
if @.@.ERROR <> 0
goto Error
else
begin
create unique clustered index uc1SycContents on
MSmerge_contents(tablenick, rowguid)
if @.@.ERROR <> 0 goto Error
create index nc2MSmerge_contents on MSmerge_contents(generation)
if @.@.ERROR <> 0 goto Error
create index nc3MSmerge_contents on MSmerge_contents(partchangegen)
if @.@.ERROR <> 0 goto Error
create index nc4MSmerge_contents on MSmerge_contents(rowguid)
if @.@.ERROR <> 0 goto Error
end
exec dbo.sp_MS_marksystemobject MSmerge_contents
if @.@.ERROR <> 0
goto Error
--grant select on MSmerge_contents to public
end
if not exists (select * from sysobjectswhere name = 'MSmerge_genhistory')
begin
raiserror('Creating table MSmerge_genhistory',0,1)
create table dbo.MSmerge_genhistory
(
guidsrc uniqueidentifier NOT NULL,
guidlocal uniqueidentifier NOT NULL,
pubiduniqueidentifier NULL,
generation intNOT NULL,
art_nickintNULL,
nicknamesvarbinary(1000)NOT NULL,
coldate datetimeNOT NULL
)
if @.@.ERROR <> 0
goto Error
create clustered index c1MSmerge_genhistory on
MSmerge_genhistory(generation)
if @.@.ERROR <> 0
goto Error
create unique index unc1MSmerge_genhistory on MSmerge_genhistory(guidsrc,
pubid)
if @.@.ERROR <> 0
goto Error
create index nc2MSmerge_genhistory on MSmerge_genhistory(guidlocal)
if @.@.ERROR <> 0
goto Error
CREATE INDEX nc4MSmerge_genhistory ON MSmerge_genhistory(coldate)
if @.@.ERROR <> 0
goto Error
exec dbo.sp_MS_marksystemobject MSmerge_genhistory
if @.@.ERROR <> 0
goto Error
--grant select on MSmerge_genhistory to public
end
if not exists (select * from sysobjectswhere name =
'MSmerge_delete_conflicts')
begin
raiserror('Creating table MSmerge_delete_conflicts',0,1)
create table dbo.MSmerge_delete_conflicts
(
tablenickintNOT NULL,
rowguiduniqueidentifier rowguidcol NOT NULL,
origin_datasourcenvarchar(255)NULL,
conflict_typeint NULL,
reason_codeint NULL,
reason_textnvarchar(720) NULL,
pubiduniqueidentifier NULL,
create_timedatetime not null default getdate()
)
if @.@.ERROR <> 0
goto Error
else
begin
create clustered index uc1MSmerge_delete_conflicts on
MSmerge_delete_conflicts(tablenick, rowguid)
if @.@.ERROR <> 0
goto Error
end
CREATE UNIQUE NONCLUSTERED INDEX nc1MSmerge_delete_conflicts
ON MSmerge_delete_conflicts(tablenick, rowguid, origin_datasource)
if @.@.ERROR <> 0
goto Error
exec dbo.sp_MS_marksystemobject MSmerge_delete_conflicts
if @.@.ERROR <> 0
goto Error
--grant select on MSmerge_delete_conflicts to public
end
if not exists (select * from sysobjectswhere name = 'sysmergeschemachange')
begin
raiserror('Creating table sysmergeschemachange',0,1)
create table dbo.sysmergeschemachange
(
pubiduniqueidentifier NOT NULL,
artiduniqueidentifier NULL,
schemaversion int NOT NULL,
schemaguid uniqueidentifier NOT NULL,
schematypeint NOT NULL,
schematextnvarchar(2000) NOT NULL
)
if @.@.ERROR <> 0
goto Error
else
begin
create unique clustered index schemachangeversion on
sysmergeschemachange(schemaversion, pubid)
if @.@.ERROR <> 0
goto Error
end
exec dbo.sp_MS_marksystemobject sysmergeschemachange
if @.@.ERROR <> 0
goto Error
--grant select on sysmergeschemachange to public
end
if not exists (select * from sysobjects where name =
'sysmergesubsetfilters')
begin
raiserror('Creating table sysmergesubsetfilters',0,1)
create table dbo.sysmergesubsetfilters (
filtername sysname NOT NULL,
join_filteridintidentity NOT NULL,
pubiduniqueidentifierNOT NULL,
artiduniqueidentifierNOT NULL,
art_nicknameintNOT NULL,
join_articlenamesysname NOT NULL,
join_nickname intNOT NULL,
join_unique_keyintNOT NULL,
expand_procsysnameNULL,
join_filterclause nvarchar(1000) NULL
)
if @.@.ERROR <> 0
goto Error
CREATE UNIQUE NONCLUSTERED INDEX nc1sysmergesubsetfilters
ON sysmergesubsetfilters(join_filterid, pubid)
if @.@.ERROR <> 0
goto Error
exec dbo.sp_MS_marksystemobject sysmergesubsetfilters
if @.@.ERROR <> 0
goto Error
--grant select on sysmergesubsetfilters to public
end
if @.@.error <> 0
goto Error
if not exists (select * from sysobjects where name =
'MSdynamicsnapshotviews')
begin
raiserror('Creating table MSdynamicsnapshotviews',0,1)
create table dbo.MSdynamicsnapshotviews (
dynamic_snapshot_view_name sysname primary key
)
if @.@.ERROR <> 0
goto Error
exec dbo.sp_MS_marksystemobject MSdynamicsnapshotviews
end
if not exists (select * from sysobjects where name =
'MSdynamicsnapshotjobs')
begin
raiserror('Creating table MSdynamicsnapshotjobs',0,1)
create table dbo.MSdynamicsnapshotjobs (
id int identity,
name sysname not null unique,
pubid uniqueidentifier not null,
job_id uniqueidentifier not null,
dynamic_filter_login sysname null,
dynamic_filter_hostname sysname null,
dynamic_snapshot_location nvarchar(255) not null
)
if @.@.ERROR <> 0
goto Error
exec dbo.sp_MS_marksystemobject MSdynamicsnapshotjobs
create unique clustered index uciMSdynamicsnapshotjobs on
dbo.MSdynamicsnapshotjobs(job_id, pubid)
if @.@.ERROR <> 0
goto Error
end
if @.@.error <> 0
goto Error
if not exists (select * from sysobjects where name =
'MSmerge_altsyncpartners')
begin
raiserror('Creating table MSmerge_altsyncpartners',0,1)
create table dbo.MSmerge_altsyncpartners (
subid uniqueidentifier not null,
alternate_subid uniqueidentifier not null,
descriptionnvarchar(255)NULL
)
if @.@.ERROR <> 0
goto Error
exec dbo.sp_MS_marksystemobject MSmerge_altsyncpartners
create unique clustered index uciMSmerge_altsyncpartners on
dbo.MSmerge_altsyncpartners(subid, alternate_subid)
if @.@.ERROR <> 0
goto Error
end
if exists (select * from master..sysobjects where type='P' and
name='sp_MScreatedebuginfrastructure')
begin
declare @.retval int
exec @.retval= dbo.sp_MScreatedebuginfrastructure
if @.@.ERROR <> 0 or @.retval <> 0 goto Error
end
commit transaction
return (0)
Error:
if @.@.trancount > 0
begin
ROLLBACK TRANSACTION MScreate_mergesystables
COMMIT TRANSACTION
end
RAISERROR (20008, 16, -1)
return (1)
|||This looks like its for SQL 2000 and not for SQL 2005. Do you have any
backups you can restore?
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Heather B." <hbaker@.pro-merchnospam.com> wrote in message
news:3758aadfdace47689a27696ac35b5ffd@.ureader.com. ..
>I found this in a forum somewhere, when I ran it all the tables seemed to
>be
> there, but when I tried to create a new publication I still go an error.
> This time it would say something about a field missing, I don't remember
> which field but I do remember that I looked in the table and it was there.
> set ANSI_NULLS ON
> set QUOTED_IDENTIFIER ON
> go
>
> ALTER procedure [dbo].[sp_MScreate_mergesystables] as
> /* This is to make sure that the varbinary columns do not get padded */
> set ANSI_PADDING off
> DECLARE @.exist bit
> DECLARE @.validsubs int
> select @.exist = 1
> begin tran
> save transaction MScreate_mergesystables
> exec dbo.sp_MScheckvalidsystables @.validsubs output
> if @.validsubs = 0
> exec dbo.sp_MSdrop_mergesystables
> if not exists (select * from sysobjects where name =
> 'sysmergepublications')
> begin
> raiserror('Creating table sysmergepublications',0,1)
> create table dbo.sysmergepublications
> ( publisher sysname NOT NULL default @.@.servername,
> publisher_db sysname NOT NULL default db_name(),
> name sysname NOT NULL,
> description nvarchar(255) NULL,
> retention int NULL,
> publication_type tinyint NULL,
> pubid uniqueidentifier NOT NULL,
> designmasterid uniqueidentifier NULL,
> parentid uniqueidentifier NULL,
> sync_mode tinyint NULL,
> allow_push int NULL,
> allow_pull int NULL,
> allow_anonymous int NULL,
> centralized_conflicts int NULL,
> status tinyint NULL,
> snapshot_ready tinyint NULL,
> enabled_for_internet bit NOT NULL default 0,
> dynamic_filters bit NOT NULL default 0,
> -- portable snapshot support
> snapshot_in_defaultfolder bit NOT NULL
> default
> 1,
> alt_snapshot_folder nvarchar(255) NULL,
> -- Pre/post - snapshot commands
> pre_snapshot_script nvarchar(255) NULL,
> post_snapshot_script nvarchar(255) NULL,
> -- Snapshot compression
> compress_snapshot bit NOT NULL
> default
> 0,
> -- Post 7.0 Ftp support
> ftp_address sysname NULL,
> ftp_port int NOT NULL
> default
> 21,
> ftp_subdirectory nvarchar(255) NULL,
> ftp_login sysname NULL default
> N'anonymous',
> ftp_password nvarchar(524) NULL,
> conflict_retention int NULL,
> keep_before_values int NULL default 0,
> allow_subscription_copy bit NULL default 0,
> allow_synctoalternate bit NULL default 0,
> validate_subscriber_info nvarchar(500) NULL,
> ad_guidname sysname NULL,
> backward_comp_level int not NULL default 10, --7.0 RTM
> max_concurrent_merge int not NULL default 0,
> max_concurrent_dynamic_snapshots int not NULL
> default
> 0
> )
> if @.@.ERROR <> 0
> goto Error
> CREATE UNIQUE NONCLUSTERED INDEX nc1sysmergepublications
> ON sysmergepublications(pubid)
> if @.@.ERROR <> 0
> goto Error
> exec dbo.sp_MS_marksystemobject sysmergepublications
> if @.@.ERROR <> 0
> goto Error
> -- grant select on sysmergepublications to public
> end
> if not exists (select * from sysobjects where name =
> 'MSmerge_errorlineage')
> begin
> raiserror('Creating table MSmerge_errorlineage',0,1)
> create table dbo.MSmerge_errorlineage (
> tablenick int NOT NULL,
> rowguid uniqueidentifier NOT NULL,
> lineage varbinary(255)
> )
> exec dbo.sp_MS_marksystemobject MSmerge_errorlineage
> if @.@.ERROR <> 0
> goto Error
> create unique clustered index uc1errorlineage on
> MSmerge_errorlineage(tablenick, rowguid)
> if @.@.ERROR <> 0
> goto Error
> --grant select on MSmerge_errorlineage to public
> end
> -- this table exists at distribution/db and subscriber databse both
> if not exists (select * from sysobjects where name =
> 'MSrepl_identity_range')
> begin
> raiserror('Creating table MSrepl_identity_range',0,1)
> create table dbo.MSrepl_identity_range (
> objid int not NULL primary key,
> next_seed bigint NULL, --resource control
> pub_range bigint NULL, --publisher range
> range bigint NULL, -- set by sp_addmergearticle
> max_identity bigint NULL, --resource control
> threshold int NULL, --in percentage, set by sp_addmergearticle
> current_max bigint NULL --max value for current check constraint,set
> by sp_addmergearticle
> )
> exec dbo.sp_MS_marksystemobject MSrepl_identity_range
> if @.@.ERROR <> 0
> goto Error
> --grant select on MSrepl_identity_range to public
> end
> if not exists (select * from sysobjects where name = 'sysmergearticles')
> begin
> raiserror('Creating table sysmergearticles',0,1)
>
> create table dbo.sysmergearticles (
> name sysname NOT NULL,
> type tinyint NULL,
> objid int NOT NULL,
> sync_objid int NOT NULL,
> view_type tinyint NULL,
> artid uniqueidentifier NOT NULL,
> description nvarchar(255) NULL,
> pre_creation_command tinyint NULL,
> pubid uniqueidentifier NOT NULL,
> nickname int NOT NULL,
> column_tracking int NOT NULL,
> status tinyint NULL,
> conflict_table sysname NULL,
> creation_script nvarchar(255) NULL,
> conflict_script nvarchar(255) NULL,
> article_resolver nvarchar(255) NULL,
> ins_conflict_proc sysname NULL,
> insert_proc sysname NULL,
> update_proc sysname NULL,
> select_proc sysname NULL,
> schema_option binary(8) NULL,
> destination_object sysname NOT NULL,
> destination_owner sysname NULL,
> resolver_clsid nvarchar(50) NULL,
> subset_filterclause nvarchar(1000) NULL,
> missing_col_count int NULL,
> missing_cols varbinary(128) NULL,
> excluded_cols varbinary(128) NULL,
> excluded_col_count int not NULL default 0,
> columns varbinary(128) NULL,
> resolver_info nvarchar(255) NULL,
> view_sel_proc nvarchar(290) NULL,
> gen_cur int NULL,
> vertical_partition int not NULL default 0,
> identity_support int not NULL default 0,
> before_image_objid int NULL,
> before_view_objid int NULL,
> verify_resolver_signature int NULL,
> allow_interactive_resolver bit NOT NULL default 0,
> fast_multicol_updateproc bit NOT NULL default 0,
> check_permissions int NOT NULL default 0,
> maxversion_at_cleanup int NOT NULL default 1,
> published_in_tran_pub bit NOT NULL default 0
> -- Note: Please update sysmergeextendedarticlesview
> whenever
> -- there is a schema change in sysmergearticles
> )
> if @.@.error<>0
> goto Error
> else
> begin
> create unique clustered index uc1sysmergearticles
> on sysmergearticles(artid, pubid)
> if @.@.ERROR <> 0
> goto Error
> if not exists (select * from sysindexes where name =
> 'nc1sysmergearticles')
> begin
> create nonclustered index nc1sysmergearticles on
> sysmergearticles(nickname)
> if @.@.ERROR <> 0
> return 1
> end
> end
> exec dbo.sp_MS_marksystemobject sysmergearticles
> if @.@.ERROR <> 0
> goto Error
> grant select(nickname,gen_cur,maxversion_at_cleanup) on sysmergearticles
> to public
> end
> if not exists (select * from sysobjects where name =
> 'sysmergeschemaarticles')
> begin
> -- The extended merge articles table is for storing
> -- schema only article information.
> -- The current supported schema only articles are
> -- stored procs and views.
> raiserror('Creating table sysmergeschemaarticles',0,1)
> create table dbo.sysmergeschemaarticles
> ( name sysname NOT NULL,
> type tinyint NULL,
> objid int NOT NULL,
> artid uniqueidentifier NOT NULL,
> description nvarchar(255) NULL,
> pre_creation_command tinyint NULL,
> pubid uniqueidentifier NOT NULL,
> status tinyint NULL,
> creation_script nvarchar(255) NULL,
> schema_option binary(8) NULL,
> destination_object sysname NOT NULL,
> destination_owner sysname NULL
> -- Note: Please update sysmergeextendedarticlesview
> whenever
> -- there is a schema change in sysmergeschemaarticles
> )
> if @.@.error<>0
> goto Error
> else
> begin
> create unique clustered index uc1sysmergeschemaarticles
> on sysmergeschemaarticles(artid, pubid)
> if @.@.ERROR <> 0
> goto Error
> end
> exec dbo.sp_MS_marksystemobject sysmergeschemaarticles
> if @.@.ERROR <> 0
> goto Error
> end
> if exists (select * from sysobjects where name =
> 'sysmergeextendedarticlesview')
> begin
> drop view dbo.sysmergeextendedarticlesview
> end
> exec ('create view dbo.sysmergeextendedarticlesview
> as
> select name, type, objid, sync_objid, view_type, artid,
> description, pre_creation_command, pubid,
> nickname, column_tracking, status, conflict_table, creation_script,
> conflict_script, article_resolver,
> ins_conflict_proc, insert_proc, update_proc, select_proc,
> schema_option, destination_object,
> resolver_clsid, subset_filterclause, missing_col_count, missing_cols,
> columns, resolver_info,
> view_sel_proc, gen_cur, excluded_cols, excluded_col_count,
> vertical_partition, identity_support,
> destination_owner, before_image_objid, before_view_objid,
> verify_resolver_signature,
> allow_interactive_resolver, fast_multicol_updateproc,
> check_permissions, maxversion_at_cleanup,
> published_in_tran_pub
> from sysmergearticles
> union all
> select name, type, objid, NULL, NULL, artid, description,
> pre_creation_command, pubid,
> NULL, NULL, status, NULL, creation_script, NULL, NULL,
> NULL, NULL, NULL, NULL, schema_option, destination_object,
> NULL, NULL, NULL, NULL, NULL, NULL,
> NULL, NULL, NULL, NULL, NULL, NULL,
> destination_owner, NULL, NULL, NULL,
> 0, 0, 0, NULL, 0
> from sysmergeschemaarticles
> go')
> if @.@.error <> 0
> goto Error
> exec dbo.sp_MS_marksystemobject sysmergeextendedarticlesview
> if not exists (select * from sysobjects where name =
> 'sysmergesubscriptions')
> begin
> raiserror('Creating table sysmergesubscriptions',0,1)
>
> create table dbo.sysmergesubscriptions
> (
> subid uniqueidentifier NOT NULL,
> partnerid uniqueidentifier NOT NULL,
> datasource_type int NOT NULL,
> datasource_path nvarchar(255) NULL,
> srvid int NOT NULL,
> db_name sysname NOT NULL
> constraint unique_pubsrvdb unique nonclustered (pubid, srvid,
> db_name),
> pubid uniqueidentifier NULL,
> status tinyint NOT NULL,
> subscriber_type int NOT NULL,
> subscription_type int NOT NULL,
> priority real NOT NULL,
> sync_type tinyint NOT NULL, -- 1 = automatic 2 = no sync
> description nvarchar(255) NULL,
> login_name sysname NOT NULL,
> last_validated datetime NULL,
> subscriber_server sysname NULL,
> use_interactive_resolver bit NOT NULL default 0,
> publication sysname NULL,
> distributor sysname NULL,
> validation_level int not NULL default 0,
> resync_gen int not NULL default -1,
> attempted_validate datetime NULL,
> last_sync_date datetime NULL,
> last_sync_status int NULL,
> last_sync_summary sysname NULL
> )
> if @.@.error<>0
> goto Error
> else
> begin
> create unique clustered index uc1sysmergesubscriptions
> on sysmergesubscriptions (subid)
> if @.@.ERROR<>0
> goto Error
> create index nc2sysmergesubscriptions on sysmergesubscriptions (srvid,
> db_name)
> if @.@.ERROR<>0
> goto Error
> end
> exec dbo.sp_MS_marksystemobject sysmergesubscriptions
> if @.@.ERROR <> 0
> goto Error
> --grant select on sysmergesubscriptions to public
> end
> if not exists (select * from sysobjects where name = 'MSmerge_replinfo')
> begin
> raiserror('Creating table MSmerge_replinfo',0,1)
> create table dbo.MSmerge_replinfo
> (
> repid uniqueidentifier NOT NULL,
> replnickname int NOT NULL,
> recgen int NULL,
> recguid uniqueidentifier NULL,
> sentgen int NULL,
> sentguid uniqueidentifier NULL,
> schemaversion int NULL,
> schemaguid uniqueidentifier NULL,
> merge_jobid binary(16) NULL,
> snapshot_jobid binary(16) NULL
> )
> if @.@.ERROR <> 0
> goto Error
> else
> begin
> create unique clustered index uc1MSmerge_replinfo
> on MSmerge_replinfo (repid)
> if @.@.ERROR <> 0
> goto Error
> end
> exec dbo.sp_MS_marksystemobject MSmerge_replinfo
> if @.@.ERROR <> 0
> goto Error
> --grant select on MSmerge_replinfo to public
> end
> if not exists (select * from sysobjects where name = 'MSmerge_tombstone')
> begin
> raiserror('Creating table MSmerge_tombstone',0,1)
> create table dbo.MSmerge_tombstone
> (
> rowguid uniqueidentifier rowguidcol NOT NULL,
> tablenick int NOT NULL,
> type tinyint NOT NULL,
> lineage varbinary(249) NOT NULL,
> generation int NOT NULL,
> reason nvarchar(255) NOT NULL,
> )
> if @.@.ERROR <> 0
> goto Error
> else
> begin
> create unique clustered index uc1MSmerge_tombstone
> on MSmerge_tombstone (tablenick DESC, rowguid)
> if @.@.ERROR <> 0 goto Error
> create index nc2MSmerge_tombstone
> on MSmerge_tombstone (generation)
> if @.@.ERROR <> 0 goto Error
> end
> exec dbo.sp_MS_marksystemobject MSmerge_tombstone
> if @.@.ERROR <> 0
> goto Error
> --grant select on MSmerge_tombstone to public
> end
> if not exists (select * from sysobjects where name = 'MSmerge_contents')
> begin
> raiserror('Creating table MSmerge_contents',0,1)
> create table dbo.MSmerge_contents
> (
> tablenick int NOT NULL,
> rowguid uniqueidentifier rowguidcol NOT NULL,
> generation int NOT NULL,
> partchangegen int NULL,
> joinchangegen int NULL,
> lineage varbinary(249) NOT NULL,
> colv1 varbinary(2048) NULL,
> )
> if @.@.ERROR <> 0
> goto Error
> else
> begin
> create unique clustered index uc1SycContents on
> MSmerge_contents(tablenick, rowguid)
> if @.@.ERROR <> 0 goto Error
> create index nc2MSmerge_contents on MSmerge_contents(generation)
> if @.@.ERROR <> 0 goto Error
> create index nc3MSmerge_contents on MSmerge_contents(partchangegen)
> if @.@.ERROR <> 0 goto Error
> create index nc4MSmerge_contents on MSmerge_contents(rowguid)
> if @.@.ERROR <> 0 goto Error
> end
> exec dbo.sp_MS_marksystemobject MSmerge_contents
> if @.@.ERROR <> 0
> goto Error
> --grant select on MSmerge_contents to public
> end
> if not exists (select * from sysobjects where name = 'MSmerge_genhistory')
> begin
> raiserror('Creating table MSmerge_genhistory',0,1)
> create table dbo.MSmerge_genhistory
> (
> guidsrc uniqueidentifier NOT NULL,
> guidlocal uniqueidentifier NOT NULL,
> pubid uniqueidentifier NULL,
> generation int NOT NULL,
> art_nick int NULL,
> nicknames varbinary(1000) NOT NULL,
> coldate datetime NOT NULL
> )
> if @.@.ERROR <> 0
> goto Error
> create clustered index c1MSmerge_genhistory on
> MSmerge_genhistory(generation)
> if @.@.ERROR <> 0
> goto Error
> create unique index unc1MSmerge_genhistory on MSmerge_genhistory(guidsrc,
> pubid)
> if @.@.ERROR <> 0
> goto Error
> create index nc2MSmerge_genhistory on MSmerge_genhistory(guidlocal)
> if @.@.ERROR <> 0
> goto Error
> CREATE INDEX nc4MSmerge_genhistory ON MSmerge_genhistory(coldate)
> if @.@.ERROR <> 0
> goto Error
> exec dbo.sp_MS_marksystemobject MSmerge_genhistory
> if @.@.ERROR <> 0
> goto Error
> --grant select on MSmerge_genhistory to public
> end
> if not exists (select * from sysobjects where name =
> 'MSmerge_delete_conflicts')
> begin
> raiserror('Creating table MSmerge_delete_conflicts',0,1)
> create table dbo.MSmerge_delete_conflicts
> (
> tablenick int NOT NULL,
> rowguid uniqueidentifier rowguidcol NOT NULL,
> origin_datasource nvarchar(255) NULL,
> conflict_type int NULL,
> reason_code int NULL,
> reason_text nvarchar(720) NULL,
> pubid uniqueidentifier NULL,
> create_time datetime not null default getdate()
> )
> if @.@.ERROR <> 0
> goto Error
> else
> begin
> create clustered index uc1MSmerge_delete_conflicts on
> MSmerge_delete_conflicts(tablenick, rowguid)
> if @.@.ERROR <> 0
> goto Error
> end
> CREATE UNIQUE NONCLUSTERED INDEX nc1MSmerge_delete_conflicts
> ON MSmerge_delete_conflicts(tablenick, rowguid, origin_datasource)
> if @.@.ERROR <> 0
> goto Error
> exec dbo.sp_MS_marksystemobject MSmerge_delete_conflicts
> if @.@.ERROR <> 0
> goto Error
> --grant select on MSmerge_delete_conflicts to public
> end
> if not exists (select * from sysobjects where name =
> 'sysmergeschemachange')
> begin
> raiserror('Creating table sysmergeschemachange',0,1)
> create table dbo.sysmergeschemachange
> (
> pubid uniqueidentifier NOT NULL,
> artid uniqueidentifier NULL,
> schemaversion int NOT NULL,
> schemaguid uniqueidentifier NOT NULL,
> schematype int NOT NULL,
> schematext nvarchar(2000) NOT NULL
> )
> if @.@.ERROR <> 0
> goto Error
> else
> begin
> create unique clustered index schemachangeversion on
> sysmergeschemachange(schemaversion, pubid)
> if @.@.ERROR <> 0
> goto Error
> end
> exec dbo.sp_MS_marksystemobject sysmergeschemachange
> if @.@.ERROR <> 0
> goto Error
> --grant select on sysmergeschemachange to public
> end
> if not exists (select * from sysobjects where name =
> 'sysmergesubsetfilters')
> begin
> raiserror('Creating table sysmergesubsetfilters',0,1)
>
> create table dbo.sysmergesubsetfilters (
> filtername sysname NOT NULL,
> join_filterid int identity NOT NULL,
> pubid uniqueidentifier NOT NULL,
> artid uniqueidentifier NOT NULL,
> art_nickname int NOT NULL,
> join_articlename sysname NOT NULL,
> join_nickname int NOT NULL,
> join_unique_key int NOT NULL,
> expand_proc sysname NULL,
> join_filterclause nvarchar(1000) NULL
> )
> if @.@.ERROR <> 0
> goto Error
> CREATE UNIQUE NONCLUSTERED INDEX nc1sysmergesubsetfilters
> ON sysmergesubsetfilters(join_filterid, pubid)
> if @.@.ERROR <> 0
> goto Error
> exec dbo.sp_MS_marksystemobject sysmergesubsetfilters
> if @.@.ERROR <> 0
> goto Error
> --grant select on sysmergesubsetfilters to public
> end
> if @.@.error <> 0
> goto Error
> if not exists (select * from sysobjects where name =
> 'MSdynamicsnapshotviews')
> begin
> raiserror('Creating table MSdynamicsnapshotviews',0,1)
> create table dbo.MSdynamicsnapshotviews (
> dynamic_snapshot_view_name sysname primary key
> )
> if @.@.ERROR <> 0
> goto Error
> exec dbo.sp_MS_marksystemobject MSdynamicsnapshotviews
> end
> if not exists (select * from sysobjects where name =
> 'MSdynamicsnapshotjobs')
> begin
> raiserror('Creating table MSdynamicsnapshotjobs',0,1)
> create table dbo.MSdynamicsnapshotjobs (
> id int identity,
> name sysname not null unique,
> pubid uniqueidentifier not null,
> job_id uniqueidentifier not null,
> dynamic_filter_login sysname null,
> dynamic_filter_hostname sysname null,
> dynamic_snapshot_location nvarchar(255) not null
> )
> if @.@.ERROR <> 0
> goto Error
> exec dbo.sp_MS_marksystemobject MSdynamicsnapshotjobs
> create unique clustered index uciMSdynamicsnapshotjobs on
> dbo.MSdynamicsnapshotjobs(job_id, pubid)
> if @.@.ERROR <> 0
> goto Error
>
> end
> if @.@.error <> 0
> goto Error
> if not exists (select * from sysobjects where name =
> 'MSmerge_altsyncpartners')
> begin
> raiserror('Creating table MSmerge_altsyncpartners',0,1)
> create table dbo.MSmerge_altsyncpartners (
> subid uniqueidentifier not null,
> alternate_subid uniqueidentifier not null,
> description nvarchar(255) NULL
> )
> if @.@.ERROR <> 0
> goto Error
> exec dbo.sp_MS_marksystemobject MSmerge_altsyncpartners
> create unique clustered index uciMSmerge_altsyncpartners on
> dbo.MSmerge_altsyncpartners(subid, alternate_subid)
> if @.@.ERROR <> 0
> goto Error
>
> end
>
> if exists (select * from master..sysobjects where type='P' and
> name='sp_MScreatedebuginfrastructure')
> begin
> declare @.retval int
> exec @.retval= dbo.sp_MScreatedebuginfrastructure
> if @.@.ERROR <> 0 or @.retval <> 0 goto Error
> end
> commit transaction
> return (0)
> Error:
> if @.@.trancount > 0
> begin
> ROLLBACK TRANSACTION MScreate_mergesystables
> COMMIT TRANSACTION
> end
> RAISERROR (20008, 16, -1)
> return (1)
|||No, this was just a test/develope server so I can set it back up by
reinstalling SQL. But this is the second time it's happened, I can
duplicate it easily, I would just like to find out what's causing it so that
it doesn't happen on our production server.
|||Then definitely post something to reproduce it. I've hit this same thing
several times in the past and hav never been able to reliably reproduce it.
I can get it to reoccur, but not reproduce when I want it to. It is related
to doing many cycles of putting replication in and taking it back out. I've
always fixed this by going in and explicitly recreating the table(s). BOL
has all of the column definitions listed.
Mike
http://www.solidqualitylearning.com
Disclaimer: This communication is an original work and represents my sole
views on the subject. It does not represent the views of any other person
or entity either by inference or direct reference.
"Heather B." <hbaker@.pro-merchnospam.com> wrote in message
news:0a44768a00d845729724b964d5f84646@.ureader.com. ..
> No, this was just a test/develope server so I can set it back up by
> reinstalling SQL. But this is the second time it's happened, I can
> duplicate it easily, I would just like to find out what's causing it so
> that
> it doesn't happen on our production server.
|||Try running this stored procedure against each database that you have
deleted merge replication from:
Use [Your DataBase Name]
EXEC sp_removedbreplication
Go
|||Try running the following against every database where you have deleted
Merge Replication:
Use [DataBaseName]
EXEC sp_removedbreplication
go
*** Sent via Developersdex http://www.codecomments.com ***
sql

Wednesday, March 21, 2012

Invalid non-ASCII character conversion over JDBC to Solaris client

Hi,

I'm working on a database conversion from Sybase to SQL Server 2005 and have hit a wall with a character conversion problem when reading non-ASCII characters (encrypted password) via JDBC.

My application runs on Solaris and accesses a SQL Server 2005 database via the Microsoft JDBC driver. The server was unfortunately specified as having a SQL_Latin1_General_CP1_CI_AS collation at installation time, and the database being accessed has taken this default. After creation the data was migrated across via DTS.

The invalid character is a dagger '?'. When read over JDBC it is converted to a question mark '?'.

In my original environment a Sybase database was accessed via JDBC driver from Solaris and the correct value was returned. The Sybase database used Latin1_General_BIN as it's collation. By way of experimentation I have modified the default collation sequence within the SQL Server 2005 database, and created a new table to hold the password. I am then able to correctly return strings containing this character from within SQL Server Management Studio, but the same problem still exists when accessing it via JDBC.

I am not sure where to focus my investigation and would be grateful for any useful pointers/advice. To me it looks like it's a JDBC driver issue as with the change in collation it works from a non-JDBC client.

Many thanks

Alistair

Just to make sure we are on the same page, are you using the Microsoft 2005 Jdbc driver?

http://msdn.microsoft.com/data/ref/jdbc/

We have just shipped the June community tech preview of this driver if you want to play with the latest and greatest:

http://www.microsoft.com/downloads/details.aspx?familyid=f914793a-6fb4-475f-9537-b8fcb776befd&displaylang=en

The Microsoft 2000 Jdbc driver is not supported here. If you are using the latest driver do you have some code that inserts the invalid data into the database and then returns it incorrectly? I would be happy to take a look at this.

|||

Thank you for the reply. I have been using the 2005 driver, but have managed to resolve the problem by changing the column data type to a binary rather than varchar.

Out of interest do you have any idea when the new driver will go on general release?

|||

Glad to hear you got this working!

We are currently working on shipping the v1.1 release of the 2005 JDBC driver, of course I can't promise anything but we are targetting an August release date.

|||

Hi,

Please can you update me on the shipping date for the v1.1 release of the 2005 JDBC driver? Is it likely to be within the next couple of weeks?

Regards,

Alistair

|||

Hi Alistair,

Yes, the v1.1 release should be available within the next couple of weeks. It may even be available as early as next week.

Thank you,

--David Olix

JDBC Development

sql

Invalid non-ASCII character conversion over JDBC to Solaris client

Hi,

I'm working on a database conversion from Sybase to SQL Server 2005 and have hit a wall with a character conversion problem when reading non-ASCII characters (encrypted password) via JDBC.

My application runs on Solaris and accesses a SQL Server 2005 database via the Microsoft JDBC driver. The server was unfortunately specified as having a SQL_Latin1_General_CP1_CI_AS collation at installation time, and the database being accessed has taken this default. After creation the data was migrated across via DTS.

The invalid character is a dagger '?'. When read over JDBC it is converted to a question mark '?'.

In my original environment a Sybase database was accessed via JDBC driver from Solaris and the correct value was returned. The Sybase database used Latin1_General_BIN as it's collation. By way of experimentation I have modified the default collation sequence within the SQL Server 2005 database, and created a new table to hold the password. I am then able to correctly return strings containing this character from within SQL Server Management Studio, but the same problem still exists when accessing it via JDBC.

I am not sure where to focus my investigation and would be grateful for any useful pointers/advice. To me it looks like it's a JDBC driver issue as with the change in collation it works from a non-JDBC client.

Many thanks

Alistair

Just to make sure we are on the same page, are you using the Microsoft 2005 Jdbc driver?

http://msdn.microsoft.com/data/ref/jdbc/

We have just shipped the June community tech preview of this driver if you want to play with the latest and greatest:

http://www.microsoft.com/downloads/details.aspx?familyid=f914793a-6fb4-475f-9537-b8fcb776befd&displaylang=en

The Microsoft 2000 Jdbc driver is not supported here. If you are using the latest driver do you have some code that inserts the invalid data into the database and then returns it incorrectly? I would be happy to take a look at this.

|||

Thank you for the reply. I have been using the 2005 driver, but have managed to resolve the problem by changing the column data type to a binary rather than varchar.

Out of interest do you have any idea when the new driver will go on general release?

|||

Glad to hear you got this working!

We are currently working on shipping the v1.1 release of the 2005 JDBC driver, of course I can't promise anything but we are targetting an August release date.

|||

Hi,

Please can you update me on the shipping date for the v1.1 release of the 2005 JDBC driver? Is it likely to be within the next couple of weeks?

Regards,

Alistair

|||

Hi Alistair,

Yes, the v1.1 release should be available within the next couple of weeks. It may even be available as early as next week.

Thank you,

--David Olix

JDBC Development

Invalid non-ASCII character conversion over JDBC to Solaris client

Hi,

I'm working on a database conversion from Sybase to SQL Server 2005 and have hit a wall with a character conversion problem when reading non-ASCII characters (encrypted password) via JDBC.

My application runs on Solaris and accesses a SQL Server 2005 database via the Microsoft JDBC driver. The server was unfortunately specified as having a SQL_Latin1_General_CP1_CI_AS collation at installation time, and the database being accessed has taken this default. After creation the data was migrated across via DTS.

The invalid character is a dagger '?'. When read over JDBC it is converted to a question mark '?'.

In my original environment a Sybase database was accessed via JDBC driver from Solaris and the correct value was returned. The Sybase database used Latin1_General_BIN as it's collation. By way of experimentation I have modified the default collation sequence within the SQL Server 2005 database, and created a new table to hold the password. I am then able to correctly return strings containing this character from within SQL Server Management Studio, but the same problem still exists when accessing it via JDBC.

I am not sure where to focus my investigation and would be grateful for any useful pointers/advice. To me it looks like it's a JDBC driver issue as with the change in collation it works from a non-JDBC client.

Many thanks

Alistair

Just to make sure we are on the same page, are you using the Microsoft 2005 Jdbc driver?

http://msdn.microsoft.com/data/ref/jdbc/

We have just shipped the June community tech preview of this driver if you want to play with the latest and greatest:

http://www.microsoft.com/downloads/details.aspx?familyid=f914793a-6fb4-475f-9537-b8fcb776befd&displaylang=en

The Microsoft 2000 Jdbc driver is not supported here. If you are using the latest driver do you have some code that inserts the invalid data into the database and then returns it incorrectly? I would be happy to take a look at this.

|||

Thank you for the reply. I have been using the 2005 driver, but have managed to resolve the problem by changing the column data type to a binary rather than varchar.

Out of interest do you have any idea when the new driver will go on general release?

|||

Glad to hear you got this working!

We are currently working on shipping the v1.1 release of the 2005 JDBC driver, of course I can't promise anything but we are targetting an August release date.

|||

Hi,

Please can you update me on the shipping date for the v1.1 release of the 2005 JDBC driver? Is it likely to be within the next couple of weeks?

Regards,

Alistair

|||

Hi Alistair,

Yes, the v1.1 release should be available within the next couple of weeks. It may even be available as early as next week.

Thank you,

--David Olix

JDBC Development

Monday, March 19, 2012

Invalid Export DLL or export format

I have read a lot about this error and all the suggestions put in place in order to have it working to no avail.We have a Visual Basic 6 application and we are able to export reports to Word,PDF or EXCEl through Report viewer, however for sometime we have had problems exporting to PDF on Terminal Server 2000, now that we upgraded to TS 2003 none of the exports work,exporting to pdf or excel gives an error as discribed in the subject and to word just doesn't happen, no error is thrown.

I have made sure I have all the appropriate dll in c\windows\crystal. the only thing that strikes me as strange is, I have found a post informing we should have all of those dll files under c\program files\common files\crystal decisions\2.0\bin and there is the need to have files in MergeModules as well, however those folders do not exist on the TS where Crystal Reports 8.5 was installed.

I have crystal installed on my own pc and i have all of those folders but since exporting locally on our pcs is not the problem but on the Terminal Server I can't connect if that could be the problem, but person that I helping with this refuses to create those folders because he thinks they are not needed.

Would somebody know are those folders that are getting created when Crystal is istalled and if i should just create them myself.

Hope somebody can help because i am really stuck.

ThanksYou need to create Setup from the Package and Deployment wiward and add all the necessary files/dlls so that they will be copied to the corresponding directories in the system where set up is run

Invalid Descriptor Index

I have a Sql Server 2000 SP3 Publisher that performs merge replication with a group of MSDE 2000 SP3 subscribers.
Everything was working fine. I had to make changes to the publication and reinit the subscribers. Some subscribers are working fine. Others are getting an error. The error is
The process could not enumerate changes at the 'Subscriber'.
The process could not enumerate changes at the 'Subscriber'.
(Source: Merge Replication Provider (Agent); Error number: -2147200999)
------
Invalid Descriptor Index
(Source: XXXXXXXX(Data source); Error number: 0)
------
Anyone know what might cause this? And the solution for it?
90 % of the failure to enumerat changes errors can be cleared by restarting the agent.
In your case the invalid descriptor index is unusual and points to an ODBC error. SQL Server replication uses ODBC to communicate between servers.
There are some reports that you can clear this error by rearranging your columns returned in your results set.
It sounds like this might be a bug.
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
|||"There are some reports that you can clear this error by rearranging your columns returned in your results set."
I can't rearrange anything since its setup from replication itself. Its wierd because some subscribers to go through fine, others are failing with the error.
|||Is this error a transient error for these subscribers? Are these subscribers at the same MDAC, sp, hot fix level for that the successful subscribers are at?
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html

Friday, March 9, 2012

Invalid Class String

Hi,

I'm working on both VWDEE and VBEE and, in each, when I try to add a database diagram I get the following message (after the 'Do you want to create required objects' prompt) 'Invalid Class String'.

Any ideas?

Hi,

Do you use SQLServer2000? Do you have the SQLServer 2000 SP4 isntalled? If so, replace the SP4 with SP3a and have a try.

Thanks.

|||

Hi,

The SQL I have is the default express edition that you get with VWD Express Edition, although it shows up in the program menu as 2005 (After installing SQL Server Management Studio Express).

I tried the advice of Salmontraining, in as much as I reinstalled all the express products, and now it works.

So, if you can't get your database diagrams to work, go to control panel/add remove programs and uninstall/reinstall VWD or any of the other Express applications, SQL should be reinstalled automatically.

Wednesday, March 7, 2012

Invalid attribute/identifier error

HI ,
My application is working fine with SQL Server 2000 ; but when I
change the back end to Oracle 9i it gives an error "Invalid
attribute/identifier" .
Any help would be appreciated .
Thanks ,
Sujay
Hi
SQL Server and Oracle use different dialects of SQL so it is highly unlikely
that the application will work without significant change, even if you have
used ANSI standard SQL the features may not always be fully supported by
either system.
You do not say how far you the application has got, if it is not connecting
then the connection string may be incorrect, if you can track it down to a
specific statement, then run the query in SQL*Plus to see what happens.
John
<ghosh.sujay@.gmail.com> wrote in message
news:1110899405.355947.41090@.f14g2000cwb.googlegro ups.com...
> HI ,
> My application is working fine with SQL Server 2000 ; but when I
> change the back end to Oracle 9i it gives an error "Invalid
> attribute/identifier" .
> Any help would be appreciated .
> Thanks ,
> Sujay
>

Invalid attribute/identifier error

HI ,
My application is working fine with SQL Server 2000 ; but when I
change the back end to Oracle 9i it gives an error "Invalid
attribute/identifier" .
Any help would be appreciated .
Thanks ,
SujayHi
SQL Server and Oracle use different dialects of SQL so it is highly unlikely
that the application will work without significant change, even if you have
used ANSI standard SQL the features may not always be fully supported by
either system.
You do not say how far you the application has got, if it is not connecting
then the connection string may be incorrect, if you can track it down to a
specific statement, then run the query in SQL*Plus to see what happens.
John
<ghosh.sujay@.gmail.com> wrote in message
news:1110899405.355947.41090@.f14g2000cwb.googlegroups.com...
> HI ,
> My application is working fine with SQL Server 2000 ; but when I
> change the back end to Oracle 9i it gives an error "Invalid
> attribute/identifier" .
> Any help would be appreciated .
> Thanks ,
> Sujay
>

Friday, February 24, 2012

Interview a Database Administer for MBA Class

Hello, I am a graduate student at Baker College and am working on my MBA. I
am taking a database fundamentals class about how to utilize database
technologies to optimize success in business environments. My homework this
wend is to interview a database administrator/programmer and learn a
little about what they do on a daily basis. If anyone would please fill out
this short form I would greatly appreciate it.
Matt Anderson
Baker College Student in class BUS 562
Which type of projects are you currently working on?
What preparation did you have for this work?
Which parts do you enjoy/not enjoy?
How closely do you work with the end users?
What software programs are in use?
What issues (ie security) do you deal with?
What do you see in the future on this area?Hi Matt,
I'm currently getting my MBA at George Fox University in Portland, Oregon so
I feel your pain....:-)
Answers Below:
> Which type of projects are you currently working on?
I Currently work on large eFinance client software implementations. Banking
customers purchase our software, I"m an engineer\DBA that helps implement
and customize per client.
> What preparation did you have for this work?
Requires excellent .NET skills and Database Admin and Architecture skills

> Which parts do you enjoy/not enjoy?
I enjoy the custom implementations. Dont enjoy cutover events where we are
usually up and working on rolling new system into production from a friday
night to a saturday mid day (all nighters)...

> How closely do you work with the end users?
I dont typcially work with end users who are the Banks On-Line Banking
customers.

> What software programs are in use?
Microsoft .NET and SQL Server 2000

> What issues (ie security) do you deal with?
Security is a huge issue in online banking and efinance. Loss of data,
fraudulant activity, Phishing, etc are all very significant threats.

> What do you see in the future on this area?
This industry is growing and security will be a primary area of growth.
hope this helps,
Cheers,
Greg Jackson
PDX, Oregon|||"pdxJaxon" <GregoryAJackson@.Hotmail.com> wrote in message
news:ejqDvJ%23OGHA.984@.tk2msftngp13.phx.gbl...
> Hi Matt,
>

> hope this helps,
> Cheers,
> Greg Jackson
> PDX, Oregon
>
It does! Thanks!
Matt

interrupt backup job

Hi,
If you stop a db full backup job in the middle of process,
will this mess up your db or server?
working on sql server 2000.
thanks!!
JJHi,
Dont worry, Nothing will happen.
Thanks
Hari
MCDBA
"JJ Wang" <anonymous@.discussions.microsoft.com> wrote in message
news:04a901c3ab35$bb0be080$a501280a@.phx.gbl...
> Hi,
> If you stop a db full backup job in the middle of process,
> will this mess up your db or server?
> working on sql server 2000.
> thanks!!
> JJ

Sunday, February 19, 2012

Interrogating lock information...

I'm working on a PB / OLE DB / SQL2000 application architecture. Here is my requirement:

I need to find out if/how I can interrogate a SQL2000 database for its locking information, with a fairly high degree of granularity. That is to say I'd want to extract the following info:

TABLE LOCK:
--> The name of the table thats locked. (this I can get from SYS tables...)

PAGE LOCK:
--> The table and the row or range of rows that are locked.

ROW LOCK:
--> The table and the row (RId or physical key) that is locked.

My understanding is that rows that are locked as part of a page lock, or a row that is rowlocked, is managed internally within the DBMS. Any one of the three lock types will register e.g. on the SYSLOCKS table, but only specifies the name of the locked object (i.e. table name, index, etc...).

Is my only real solution to create my own custom locking info table(s)? I don't strongly favor that sort of solution, because the code to properly manage such a table would be pretty ambitious to write, and prone to corruption at some point no matter how well we build it.

Are there any inventive solutions out there?All the tools to do that are at your finguretips, - PerfMon, DBCC, Profiler, and QA. Look into sp_lock stored procedure that will point you to master.dbo.syslocks and master.dbo.syslockinfo. Look into perfmon counters as well as various profiler templates.