Please Check This Replication Error..
Jul 6, 2004
I tried to replicate between SVRPOS01 and SVRPOS02.
SVRPOS01 is publisher and distributor.
Replication is Merge replication.
But, after snapshot agent ran, the following error comes out and merge agent doesn't do merge replication.
When configure replication I choose option initialize schema.., and in SVRPOS02 I just create empty DB.
Most of time this works... but not in this time..
SVRPOS02 doesn't have data replicated...
Please reply any idea of following error, and solution if you have any..
Thank you.
<Error message>
The schema script '\SVRPOS01C$Program FilesMicrosoft SQL ServerMSSQLReplDatauncSVRPOS01_POS_POSPublicat ion20040706003309v_Item_Old_232.sch' could not be propagated to the subscriber.
<Error Detail>
The schema script '\SVRPOS01C$Program FilesMicrosoft SQL ServerMSSQLReplDatauncSVRPOS01_POS_POSPublicat ion20040706003309v_Item_Old_232.sch' could not be propagated to the subscriber.
(Source: Merge Replication Provider (Agent); Error number: -2147201001)
---------------------------------------------------------------------------------------------------------------
Unable to replicate a view or function because the referenced objects or columns are not present on the Subscriber.
(Source: SVRPOS02 (Agent); Error number: 0)
---------------------------------------------------------------------------------------------------------------
Invalid object name 'POSLOC.dbo.BARCODE_MATCH'.
(Source: SVRPOS02 (Data source); Error number: 208)
---------------------------------------------------------------------------------------------------------------
View 2 Replies
ADVERTISEMENT
Jan 5, 2007
I have tables that are replicated using transactional and merge replication. As a result I am unable to use automatic identity management as transactional replication doesn€™t seem to understand it.
Therefore I have implemented a version of the automatic mechanisms that seems to work in a hybrid environment. It is based on a central table that holds the maximum identity for each table that has been issued to date. Valid identity ranges are issued to each publisher and subscriber as needed in a similar way to the automatic mechanisms and tables are reseeded as needed.
I want to enforce the ranges in a similar way to the automatic mechanism using a check constraint similar to this:
alter table [dbo].[test1] with NOCHECK add CONSTRAINT repl_identity_range_48DF13ED_D503_4F5C_AED9_4E504D03E752 check NOT FOR REPLICATION (([id] > 10001 and [id] <= 20001) or ([id] > 50001 and [id] <= 70001))
This works OK on a client subscriber, but if the change is made on the publisher, then the alter statement itself is replicated out to all clients €“ which is not what is wanted. I have traced the automatic mechanisms using profiler and they issue an alter statement as above €“ following dropping of the constraint €“ but the check constraint isn€™t replicated. I can't see how this is achieved.
How do I stop the check constraint being replicated?
The article property schema option can be set to stop replicating check constraints, but this seems to have no effect. If the publication property replicate_ddl is set to 0 then I do see the behaviour that I want. However, I do need to be able to replicate most schema changes due to upgrades etc €“ so this doesn€™t look like a viable option €“ except possibly for the transactional publication.
Any help would be much appreciated
Thanks
aero1
View 4 Replies
View Related
May 25, 2004
Hi Everybody,
Can anybody tell me how to get the number of commands delivered per minute in case of Merge Replication with Publisher and subscribers.
This way, we can be sure that even if there is a latency (due to high volume transaction processing), replication is in good shape and things will catch up soon.
Also if there are any other similar measures which can be monitored to make sure that replication is going on fine, it would be great
Please let me know If anyone has got information on same.
View 1 Replies
View Related
May 14, 2015
How to check if web merge sync is working between a subscriber and publisher thru HTTPS ? SQL port 1433 at subscriber is blocked so no direct connection to subscriber.
View 2 Replies
View Related
Jul 20, 2005
DB-Library Error 10007: General SQL Server error: Check messages fromthe SQLServer.CREATE PROCEDURE [dbo].[spu_Import_Export_Image](@srvr varchar(50),@db varchar(50),@usr varchar(15),@pwd varchar(50),@tbl varchar(50),@col varchar(50),@mod varchar(1),@imgpath1 varchar(1000),@pk varchar(50))ASBEGINdeclare @path varchar(50)declare @whr varchar(200)declare @fil varchar(100)declare @cmd varchar(1000)declare @imgpath varchar(800)declare @ext varchar(5)--declare @pk varchar(50)declare @KeyValue varchar(8000)declare @image varchar(50)--declare @imgpath1 varchar(1000)declare @imgpath2 varchar(1000)declare @sellist varchar(2000)set @path = 'c: extCopy.exe'select @sellist = 'DECLARE curKey CURSOR FOR SELECT ' + @pk +' FROM '+ @tbl + ' ORDER BY ' + @pkexec (@sellist)OPEN curKeyFETCH NEXT FROM curKey INTO @KeyValueWHILE (@@fetch_status = 0)BEGINset @whr = '"where '+ @pk +' = "' + @KeyValueset @fil = @imgpath1 + '' + @KeyValue --+ @extset @cmd = @path + ' /S ' + @srvr + ' /D ' + @db + ' /U ' + @usr+ ' /P ' + @pwd+ ' /T ' + @tbl + ' /C ' + @col + ' /W ' + @whr + '/F ' + @fil+ ' /' + @modexec Master..xp_cmdShell @cmdFETCH NEXT FROM curKey INTO @KeyValueENDCLOSE curKeyDEALLOCATE curKeyENDGOAbove srcipt runs fine with image data type in one table but when irun for some other table it gives me Error MessageTEXTCOPY Version 1.0DB-Library version 8.00.194SQL Server 'WSQL01' Message 170: Line 1: Incorrect syntax near '99'.(Concerning line 1)DB-Library Error 10007: General SQL Server error: Check messages fromthe SQLServer.ERROR: Could not use database 'test1'NULL-----------Aslo it only runs on server console if i run it from workstation uingsame files and tables it gives me an error again. Can anybody help meand reply me at Join Bytes! asap.thnx,dharmesh
View 1 Replies
View Related
Jun 15, 2007
I'm getting this, after upgrading from 2000 to 2005.Replication-Replication Distribution Subsystem: agent (null) failed.The subscription to publication '(null)' has expired or does notexist.The only suggestions I've seen are to dump all subscriptions. Sincewe have several dozen publications to several servers, is there adecent way to script it all out, if that's the only suggestion?Thanks in advance.
View 3 Replies
View Related
Mar 6, 2007
Hello,I'm getting the following error message when I try add a row using aStored Procedure."The identity range managed by replication is full and must be updatedby a replication agent".I read up on the subject and have tried the following solutionsaccording to MSDN without any luck.(http://support.Microsoft.com/kb/304706 )sp_adjustpublisheridentityrange (http://msdn2.microsoft.com/en-us/library/aa239401(SQL.80).aspx ) has no effectFor Testing:I've reloaded everything from scratch, created the pulications from byrunning the sql scripts generated,created replication snapshots andstarted the agents.I've checked the current Identity values in the Agent Table:DBCC CHECKIDENT ('Agent', NORESEED)Checking identity information: current identity value '18606', currentcolumn value '18606'.I check the Table to make sure there will be no conflicts with theprimary key:SELECT AgentID FROM Agent ORDER BY AgentID DESC18603 is the largest AgentID in the table.Using the Table Article Properties in the Publications PropertiesDialog, I can see values of:Range Size at Publisher: 100,000Range Size at Subscribers: 100New range @ percentage: 80In my mind this means that the Publisher will assign a new range whenthe Current Indentity value goes over 80,000?The Identity range for this table cannot be exhausted! I'm not surewhat to try next.Please! any insight will be of great help!Regards,Bm
View 1 Replies
View Related
Oct 25, 2007
ls_SQL = ls_SQL + " WHERE "
+ "Convert(varchar(10),"
+ dataSet1.Tables["Model_Criteria"].Rows[i]["table_name"].ToString() + '.'
+ dataSet1.Tables["Model_Criteria"].Rows[i]["column_name"].ToString() + ")"
+ " " + dataSet1.Tables["Model_Criteria"].Rows[i]["relational_operator"].ToString() + " "+ '''
+ ls_Value+ '''+ " "
+ dataSet1.Tables["Model_Criteria"].Rows[i]["logical_operator"].ToString() + " ";
I stored this sql in a string and i want to check whether this string is error free or not (syntax).
how i can do it. Please help it's urgent.
View 10 Replies
View Related
Jun 5, 2008
my aspnetdb.mdf can,t created my remote connection settings in sql server is ok
and i get this folwing error :
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) 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. SQLExpress database file auto-creation error:
The connection string specifies a local Sql Server Express instance using a database location within the applications App_Data directory. The provider attempted to automatically create the application services database because the provider determined that the database does not exist. The following configuration requirements are necessary to successfully check for existence of the application services database and automatically create the application services database:
If the applications App_Data directory does not already exist, the web server account must have read and write access to the applications directory. This is necessary because the web server account will automatically create the App_Data directory if it does not already exist.
If the applications App_Data directory already exists, the web server account only requires read and write access to the applications App_Data directory. This is necessary because the web server account will attempt to verify that the Sql Server Express database already exists within the applications App_Data directory. Revoking read access on the App_Data directory from the web server account will prevent the provider from correctly determining if the Sql Server Express database already exists. This will cause an error when the provider attempts to create a duplicate of an already existing database. Write access is required because the web server accounts credentials are used when creating the new database.
Sql Server Express must be installed on the machine.
The process identity for the web server account must have a local user profile. See the readme document for details on how to create a local user profile for both machine and domain accounts.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace:
[SqlException (0x80131904): An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)]
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +115
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +346
System.Data.SqlClient.TdsParser.Connect(Boolean& useFailoverPartner, Boolean& failoverDemandDone, String host, String failoverPartner, String protocol, SqlInternalConnectionTds connHandler, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject, Boolean aliasLookup) +1093
System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +1083
System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +272
System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +351
System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup) +90
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +115
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +122
System.Data.SqlClient.SqlConnection.Open() +227
System.Web.Management.SqlServices.GetSqlConnection(String server, String user, String password, Boolean trusted, String connectionString) +110
[HttpException (0x80004005): Unable to connect to SQL Server database.]
System.Web.Management.SqlServices.GetSqlConnection(String server, String user, String password, Boolean trusted, String connectionString) +181
System.Web.Management.SqlServices.SetupApplicationServices(String server, String user, String password, Boolean trusted, String connectionString, String database, String dbFileName, SqlFeatures features, Boolean install) +167
System.Web.Management.SqlServices.Install(String database, String dbFileName, String connectionString) +46
System.Web.DataAccess.SqlConnectionHelper.CreateMdfFile(String fullFileName, String dataDir, String connectionString) +681
View 1 Replies
View Related
Jul 24, 2007
We have a report where we do a whole bunch of calculations.
Sometimes we get #div0 err,when you try to divide a number by 0, or NaN Error, when you are trying to divide 0 in the numerator.. Is there a tool, that can sopt check these errors on a report in reporting services, and generate a log that we can check daily for errs?Pl advise
View 6 Replies
View Related
Feb 29, 2008
WITH ProccessedYesNO AS
(
select ClaimNumber, Surname, FirstName, CASE WHEN New= 0 THEN 'Yes' ELSE 'No' END AS Processed
from EntryTable)
Select * from ProcessedYesNo Where Ignore_dupe='Yes';
why I am getting an syntex error I check the query it is ok atleast the inner query is running but when I apply the with
than I am getting Syntax error near 'WITH'
View 12 Replies
View Related
Aug 19, 2006
Hey Guys,
I just this day started using SQL sever 2005. I created a database and
then created a table. Then I started adding some fields. I wanted to
add a check constraint to one of the fields called state but I keep
getting the same error. I right click on the field while editing the
table and select check constraint. I then click add on the check
constraint dialogue and in the expression caption I input the
following:
<code>
@State In('CA', 'AZ', 'UT', 'CO')
</code>
I am using a book and have straight copied the above example from
the book. However when I input the check constraint I get the following
error;
"Error validating constraint 'ck_myfirstdatabase'
I have tried this with other fields and other types of check
constraints and I still get the same error. I have tried to delete the
database and recreate it. I have tried everything I can think of and I
cannot seem to get check constraints to work. I have no idea why I keep
getting this message. I have checked the
examples a
thousand times, the syntax is definately correct. This is getting
extremely annoying as I cannot continue unless I do this. I'm all out
of ideas. Can anyone please tell me
why it could not be working? Any ideas would be greatly appreciated.
View 1 Replies
View Related
May 29, 2015
I ran the below INSERT COMMAND and it resulted into the following error message.You can also see the table structure below.Those are the only two tables that reference the Artist table.
SET IDENTITY_INSERT dbo.ARTIST ON
INSERT INTO ARTIST
(ArtistID,LastName,FirstName,Nationality,DateOfBirth,DateDeceased)
VALUES(1, 'Miro', 'Joan', 'Spanish', 1893, 1983);
[code]....
View 5 Replies
View Related
Sep 24, 2007
Hi,
I am using a foreach file to loop through a folder and pick a file. Then populate a Sql table.
Now I want to check if the file is a mdb and then check if the mdb contains a table called "Schools". If any of these conditions fails, the file should be moved to the Error folder. If conditions pass, populate the Sql tables.
How do I do this? Please specify the components to use.
thanks
View 6 Replies
View Related
Feb 14, 2006
I am currently using VWD. I only run my web applications with the Cassini. However, as long as I want to hardcode with SqlConnection object, an error occurs. I did a little bit modification to the following codes which use SqlConnection and was quoted from the book "Professional ASP.NET 2.0", Wrox. <%@ Page Language="VB" %> <%@ Import Namespace="System.Data" %> <%@ Import Namespace="System.Data.SqlClient" %> <%@ Import Namespace="System.Configuration" %> <script runat="server"> Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) If Not Page.IsPostBack Then Dim MyConnection As SqlConnection Dim MyCommand As SqlCommand Dim MyReader As SqlDataReader MyConnection = New SqlConnection() MyConnection.ConnectionString = ConfigurationManager.ConnectionStrings("ASPNETDB").ConnectionString MyCommand = New SqlCommand() MyCommand.CommandText = "SELECT TOP 3 * FROM Paspnet_Users" MyCommand.CommandType = CommandType.Text MyCommand.Connection = MyConnection MyCommand.Connection.Open() MyReader = MyCommand.ExecuteReader(CommandBehavior.CloseConnection) gvCustomers.DataSource = MyReader gvCustomers.DataBind() MyCommand.Dispose() MyConnection.Dispose() End If End Sub </script> <html> <body> <form id="form1" runat="server"> <div> <asp:GridView ID="gvCustomers" runat="server"> </asp:GridView> </div> </form> </body> </html> The error: System.NullReferenceException was unhandled by user code Message="Object reference not set to an instance of an object." Source="App_Web_v1u8yf_l" StackTrace: at ASP.sqlconnectiontest_aspx.Page_Load(Object sender, EventArgs e) in F:My DocumentMy StudySITMT4Introduction to ASP.NetMeowMeowShoppingCartSQLconnectionTest.aspx:line 13 at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Please help me find out what's the problem. Thanks beforehand.
View 1 Replies
View Related
Oct 6, 2004
Hi all,
Just wondering what would be the normal or more efficient practice to insert/update a record.
1. Check for existence of primary record (using SELECT in stored procedure)
2. Capture error and handling
My problem is that I try to execute an stored procedure from a VB client.. but unable to capture the errors in SP, it just prompts the error and thats it, not responding to my "SELECT @err = @@ERROR" after the insert statement.
so now, I'm thinking of capturing the error on the client (which I am able to do) and handle it from there.. or to make sure that RI is enforced by 'searching' for Pks in the primary tables before executing the INSERT statement in my stored procedure.
Any advise would be appreciated..
Cyherus
View 2 Replies
View Related
Dec 24, 2007
I am getting "General network error. Check your documentation."
I am using .net 1.1 to connect sql server 2005 database at remote place.
.net code is running on windows xp and database(Dev database) is running on windows 2003 server.
below is my code.
conn = new SqlConnection("Persist Security Info=False; User ID=xxx; Password=pwd; database=WBWT; server=machinename; Connect Timeout=300; Max Pool Size=10");
conn.Open();
cmd = conn.CreateCommand();
cmd.CommandType = CommandType.StoredProcedure ;
cmd.CommandText = "TestForCollation";
SqlParameter param1 = new SqlParameter("@MESSAGE",SqlDbType.NVarChar, 100);
param1.Value= "Dhanaji";
param1.Direction = ParameterDirection.Input;
cmd.Parameters.Add( param1 );
SqlParameter param2 = new SqlParameter("@CATEGORY",SqlDbType.Char, 10);
param1.Value= "Patil";
param1.Direction = ParameterDirection.Input;
cmd.Parameters.Add( param2 );
adapter = new SqlDataAdapter((SqlCommand)cmd);
adapter.Fill(ds); // here it throws exception
When i use VARCHAR data type or Output parameter in stored procedure it gives this error.
For the stored procedure which has not any parameter or only input int parameter is executed sucessfully,
Same SP is excuted sucessfully on local machine. I need urgent help
Also same code works on another database at remote place(QA database)
Thanks
--Dhanaji
View 4 Replies
View Related
Mar 14, 2008
i need the t-sql statement for a check constraint that has a custom error message that shows the proper fromat for column entry.... i know its confusing...
example... if im using the authors table in the pubs database and the numbers in the au_id column reads xxx-xxxxxx where x represents numbers... what must i do so that the error message reads the proper format... ie. use proper format XXX-XXXXXX, is what i might want the error message to read.
thanks in advance
View 7 Replies
View Related
Aug 16, 2005
Hi,I am getting the following error (When i am trying to update the column thru windows service) Please let me know the solution for the following.The following error is comming only when i set CommandTimeout to infinity (Commandtimeout=0).General network error. Check your network documentation. Number 11 Procedure ConnectionRead (recv()). Class 20 State 0 Source .Net SqlClient Data Provider Server Line number 0 Thanks and Best RegardsNagaraju A
View 2 Replies
View Related
Jun 12, 2008
Can anyone help me, please.
I want my users to submit there email address and username to my Sql Database, but i want to prevent them from adding already existed usernames to my table.
I have a usernametextbox and emailtextbox and a Submit button.
How do i check in my table before Submiting?
Thanks!
View 4 Replies
View Related
Feb 2, 2015
Automated and manual backup done through SQL Management console are failing with error 23 - redundancy check failed.
This is a critical production db. Other db in same instance backs up ok.
Is there a way to fix this?
View 4 Replies
View Related
Jan 29, 2008
Hi i have installed sql server 2000 on xp window and facing error of connection failed, check sql server registration what it mean pleas guide me.
webmaster http://www.GlobalGuideLine.com
View 1 Replies
View Related
May 16, 2008
Hi gurus:
I met a very strange problem recently. I set up a database integrity check maintenance plan. But this job failed every time. I looked into the logs, the error message was that Databases that have a compatibility level of 70 (SQL Server version 7.0) will be skipped. I used the sp_helpdb to check the version of the databases included in my maintenance plan. The sp result shows that all the databases are above version 80....
Even more strange, i can successfully run the dbcc check query on each database.
Any comment and suggestion will be very appreciated.
View 1 Replies
View Related
May 22, 2002
I get this error in my Agent after starten to synchronise.
I see the access mdb been created and then deleted and renamed to
name_old.mdb
Do you have some help?
Richard
View 1 Replies
View Related
May 20, 2015
I have multiple ODBC connection and how to check all connection automatically during routine check by using batch file.
View 5 Replies
View Related
Jul 21, 2004
Hi, guys
I try to add some error check and transaction and rollback function on my insert stored procedure but I have an error "Error converting data type varchar to smalldatatime" if i don't use /*error check*/ code, everything went well and insert a row into contract table.
could you correct my code, if you know what is the problem?
thanks
My contract table DDL:
************************************************** ***
create table contract(
contractNum int identity(1,1) primary key,
contractDate smalldatetime not null,
tuition money not null,
studentId char(4) not null foreign key references student (studentId),
contactId int not null foreign key references contact (contactId)
);
My insert stored procedure is:
************************************************** *****
create proc sp_insert_new_contract
( @contractDate[smalldatetime],
@tuition [money],
@studentId[char](4),
@contactId[int])
as
if not exists (select studentid
from student
where studentid = @studentId)
begin
print 'studentid is not a valid id'
return -1
end
if not exists (select contactId
from contact
where contactId = @contactId)
begin
print 'contactid is not a valid id'
return -1
end
begin transaction
insert into contract
([contractDate],
[tuition],
[studentId],
[contactId])
values
(@contractDate,
@tuition,
@studentId,
@contactId)
/*Error Check */
if @@error !=0 or @@rowcount !=1
begin
rollback transaction
print ‘Insert is failed’
return -1
end
print ’New contract has been added’
commit transaction
return 0
go
View 1 Replies
View Related
Jan 22, 2007
Hi All,
I have a field 'Rowguid' of type uniqueidentifier in a table. This field is the last field in the table. In this case if I update a record through the application I don't get any error. Suppose if there are additional fields after the field Rowguid I get the error "Multiple-Step operation cannot be generated Check each status value"
For your reference I have used the following statement to add the RowGuid field
Alter table <tablename>
Add RowGuid uniqueidentifier ROWGUIDCOL NOT NULL Default (newid())
Can anyone please help me.
Thanks
Sathesh
View 3 Replies
View Related
Aug 7, 2015
In my SSIS Package I am using Script task to check whether file exists or not.
I am having 3 variable as below
User::V_Filepath >File path
User::V_GeographyLevelFileName >Filename
User::V_FileExistsFlg >Flag
Below is the code I am using for same
String filepath = Dts.Variables["User:V_Filepath"].Value.ToString() + Dts.Variables["User::V_GeographyLevelFileName"].Value.ToString();
if (
File.Exists(filepath)
)
{
Dts.Variables["User::V_FileExistsFlg"].Value = 1;
}
MessageBox.Show(filepath);
MessageBox.Show(Dts.Variables["User::V_FileExistsFlg"].Value.ToString());
Dts.TaskResult = (int)ScriptResults.Success;
But I am getting exception error.
Find the attached screenshot of error ....
View 4 Replies
View Related
Jan 17, 2013
I have been searching for a means to change the System Failure Error Check policy that comes as part of the Best Practice policies. I want to look back 24 hours. The WQL query shipped with the policy doesn't have a WHERE clause component that looks at TimeGenerated. That query looks like:
IsNull(ExecuteWql('Numeric', 'rootCIMV2', 'select EventCode from Win32_NTLogEvent where EventCode=6008 and Logfile="System"'), 0)
After searching for an example of how to do this and not finding any that are specific to PBM, I decided to fall back to a very basic approach - use wbemtest.exe to try out where clause additions and see how they work, then plug the result into the policy and see if it works. As a start, I tried the following query using wbemtest.exe:
select Event Code
from Win32_NTLogEvent
where EventCode = 6008
and Logfile = 'System'
and TimeGenerated > '20130101010000.000000–000'
This works great in wbemtest.exe. My next step was to plug this into the policy condition expression as follows: IsNull(ExecuteWql ('Numeric', 'rootCIMV2', 'select EventCode from Win32_NTLogEvent where EventCode=6008 and Logfile="System" and TimeGenerated > "20130101010000.000000–000"'), 0)
When I try to manually evaluate this policy in SSMS, I receive an "Invalid Query" error message.I assume that SWbemDateTime isn't available to use inside Policy Based Management policies. All the examples of how to handle the kind of dynamic date creation I have seen are for use in PowerShell, VBScript, or SSIS. I've played with using DateDiff, DateAdd, and GetDate inside the query string, with no success.
Why does the ExecuteWql above fail?Is it at all possible to dynamically generate a datetime (say, 24 hours ago) as part of the query string parameter of the ExecuteWql call?What might that look like?
View 2 Replies
View Related
Apr 19, 2006
I wanted to create a package to copy the objects from one database to another and replace those object if they already exist. Therefore, before the package executes you do not know whether all the objects exist on the target server or only some of them.
Using the 'Transfer SQL Server Objects Task' I have found that I cannot get this to execute cleanly by itself. If I set the 'DropObjectsFirst' to false then an error is thrown if the object exists and if I set it to true then an error is thrown if it does not exist.
In order to get round this I have had to create an 'Execute SQL Task' to list all the objects and then go through them dropping them on the target server in a for each loop before executing the 'Transfer SQL Server Objects Task' with 'Transfer SQL Server Objects Task' set to false.
However, is there a better way of achieving this or am I missing something in the 'Transfer SQL Server Objects Task'?
View 11 Replies
View Related
Jan 31, 2007
Hi,
I am using ATL COM library application. It is using sql data base for fetching the records. Some times, i get the following error. could you please let me know, why this happens? This is not reproduceble every time.
(Error! hr=80040e21, hrDesc=Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work
Here is the code to connect to database which i am using.
CDataSource db;
CDBPropSet dbinit(DBPROPSET_DBINIT);
dbinit.AddProperty(DBPROP_AUTH_INTEGRATED, OLESTR("SSPI"));
dbinit.AddProperty(DBPROP_INIT_CATALOG, (const char *)bDatabase);
dbinit.AddProperty(DBPROP_INIT_DATASOURCE, (const char *)bServer);
dbinit.AddProperty(DBPROP_INIT_LCID, (long)1033);
dbinit.AddProperty(DBPROP_INIT_PROMPT, (short)4);
dbinit.AddProperty(DBPROP_INIT_TIMEOUT, (short)150);
hr = db.Open(_T("SQLOLEDB.1"), &dbinit);
if (FatalError(hr, "db.Open", buf))
{
*iErrorCode = hr;
return S_OK;
}
Any help, appreciated.
Thanks,
Satish
View 1 Replies
View Related
Oct 9, 2007
When creating a replication publisher in the live server enviroment, the repicaltion displays an error saying
Could not obatin information about Windows NT group/user '........', error code 0x6e. (Microsoft SQL Server, Error: 15404)
When looking at the replication server, the error report says that the user is a System administrator on the Live Server but they do not exist on the replication server.
Why would this cause an error?
I appreciate your answer
Thanks
JC
View 6 Replies
View Related
Aug 10, 2000
Has anyone seen this error on the publisher when setting up replication?
"Distributor must be running in Per Seat (Named User) licensing mode to use this replication feature."
I am trying to replicate from Sql Server 7 to Oracle.
View 2 Replies
View Related