I have 2 sql serveres with merge replication of some tables in a DB. On each DB, there is user triggers on the replicated tables to alter tables not replicated. For some reason these triggers don't fire when rows is replicated. This worked fine on SQL server 7.0.
Ok guys I have a dts package that when I execute copies the contents of a csv file into a table called DataDump, which in turn fires off a trigger (on the datadump table) which selects the newly entered fields and inserts them into a table called ProjectLines as can be seen below INSERT ProjectLines(HalNum,OldHalNum,ProductDesc,Vendor,VendorNum,Brand,CutterReq,PhotoReq,Barcode) SELECT HalNum,OldHalNum,ProductDesc,Vendor,VendorNum,Brand,CutterReq,PhotoReq,Barcode FROM inserted
Right I have saved the dts package as a .bas file and then converted that into a c# class which again all works fine, but does not fire the trigger.
any ideas guys as I have tried everything. Currently impersonating the dbo account.
I had got the below error when I execute a DELETE SQL query in SSIS Execute SQL Task :
Error: 0xC002F210 at DelAFKO, Execute SQL Task: Executing the query "DELETE FROM [CQMS_SAP].[dbo].[AFKO]" failed with the following error: "The transaction log for database 'CQMS_SAP' is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
But my disk has large as more than 6 GB space, and I query the log_reuse_wait_desc column in sys.databases which return value as "NOTHING".
So this confused me, any one has any experience on this?
I am trying to create a stored procedure that will disable triggers on any given table. Basically I want to pass in a table name as a parameter and query the master table for all triggers that belong to that table...then disable them. I just don't know how to get a list of triggers that belong to a table?
i want to save the result of the query to a xml file .when any dml operations done on the table then the whole table must be appeared in the xml format in xml file.("Select * from Table_name").
Can any one help me out. this must be dont directly .not by using any of the tools. Suppose in sqlserver express we can do this by using 'bcp' tool.But i dont want that .Plzz Help me out.
Hi there. I have occasional sincronization error.-XSUBSYSTEM Merge -XSERVER MYSERVER -XCMDLINE 0 -XCancelEventHandle 000006E0 2006-12-22 14:55:00.833 Connecting to Subscriber 'Subscriber01' 2006-12-22 14:55:00.895 Connecting to Distributor 'Publisher01' 2006-12-22 14:55:02.974 Initializing 2006-12-22 14:55:03.083 Connecting to Publisher 'Publisher01' 2006-12-22 14:55:06.005 Retrieving publication information 2006-12-22 14:55:06.130 Retrieving subscription information. 2006-12-22 15:00:07.222 The merge process failed to execute a query because the query timed out. If this failure continues, increase the query timeout for the process. When troubleshooting, restart the synchronization with verbose history logging and specify an output file to which to write. 2006-12-22 15:00:07.456 Error converting data type nvarchar to numeric. 2006-12-22 15:00:07.800 Category:SQLSERVER Source: Subscriber01 Number: 8114 Message: Error converting data type nvarchar to numeric.
After manual syncronization it goes under control.
Could anybody explain the relationship between converting error and timed out query?
If this is poor connection's problem how can I increase the query timeout for the process?
This isn€™t an problem as such, it€™s more of a debate.
If a table needs a number of update triggers which do differing tasks, should these triggers be separated out or encapsulated into one all encompassing trigger. Speaking in terms of performance, it doesn€™t make much of an improvement doing either depending upon the tasks performed. I was wondering in terms of maintenance and best practice etc. My view is that if the triggers do totally differing tasks they should be a trigger each on their own.
I want to log/watch the query executed by the "Execute query Task". It's a query with different variables, the different variables i can see in one of the debug windows and these looks OK, but the query doesn't do what's expected. So i want to see the whole query, is that possible?
Query logging on the database server isn't an option. The server is an oracle server and the dba doesn't want to change this setting.
NOTE: I am using Brian Larsons book Delivering Business Intelligence with SQL Server 2005. I am stuck on page 588 - step 20. I am using Windows Vista Ultimate
Once all the Dimensions & attributes I have selected are dragged into the query area in MDX query builder no data is displayed. There is a message: "No rows found. Click to execute the query." - clicking does nothing.
I need some help.... I cannot execute any query from sql 2005, when I try to execute a query it stays executing and I never receive any result set. I uninstalled and re installed again SQL 2005 in my computer and also I installed the Service Pack and I am still getting the same. Could you please help me or advice on this situation?
I believe all of us use SQL Server Management Studio to execute query. As I encountered serious problem with this method, due to typo error by accident, I am wondering if we can run the .sql file from dos and supply parameters with it.Possible?
declare @sql char(500) Select @sql = '"Insert Into T74ACCO Select * From tempdb..##Temp tp Where tp.' + @Key + ' not In (Select ' + @Key + ' From T74ACCO)"'
I create some tables and I can't execute new query, I used to be able to do it, but I can't do it now. I'd like to find out that how can I do it again.
If I have serveral queries as shown below: ================================================== ========== USE XXX SELECT XX_ZZZZZ, XX_YYY, XX_XXX FROM ZZZ_ZZZZ_ZZZZ WHERE QQQQQQQQQQQQQ ='PGL'
USE XXX SELECT AAA_AAAAA_AAAA,AA_BBB, CC_DDD FROM SSSS_SSSSS_SSSSS WHERE FFF_FFFF ='A' ================================================== =========== Can anyone tell me if the queries execute concurrently or is it one after the other?
I try SP2 and cannot get the Execute SQL task to work as before.
In this example I use an OLEDB Microsoft Oracle provider.
The script uses a parameter like that
select Cast( decode(( select DECODE(TRUNC(c.END_DATE), TRUNC(SYSDATE),1,NULL) AS RESULT from one_stage.load_complete c where TRUNC(c.end_date) = TRUNC(sysdate) and c.name = ? and c.STATUS = 'SUCCEEDED') ,Null,0,1) as varchar(2)) AS Result from Dual
The script task is set to BypassPrepare = False
I note only one change, the addition of a parameter setting called Parameter Size set by default to -1
I tried different things like reading the new BOL, changing the Bypass prepare, Changing the Parameter Size and changing the ? , nothing works. the output variable is always set to a value of 0 which is the result of the query test if there is no match.
It looks like the input variable is no longer passed to the query parameter.
I am trying to execute a stored procedure in Query anaylzer for SQL server 2005. I am not sure I am doing it correctly though, because I am getting an error message. Here is the command I am typing: execute DetaHistoryGet(84,885,34,"EndDate") Here is the error message I get: Msg 102,Level 15, State 1, Line 1 Incorrect syntax near '84'
Here are a few lines from the stored procedure. I have not included it all here. CREATE PROCEDURE [dbo].[DetaHistoryGet] ( @MarketId decimal, @OwnerId decimal, @QuarterId decimal, @SortExp nvarchar(50) ) AS SET NOCOUNT ON
Hi All, I have a table which consists the leave details of an employee. I have the columns like paid leaves,sick leaves,personal leaves in the above table Problem : For eg: An employee joined on 21 May 2008. After 6 months i.e., 21 Nov 2008 I need to update the above columns (i e., increase the no.of leaves) So updation is to be done for every 6 months and for every 1 year. Can anyone say me how to execute the update query based on the duration. Thanks in advance.
Got some problem... how come i lost some space (hardisk) when execute query... (the query is listed below)
I want to know is it create some virtual tables or view when we execute query ??? N where's the location in our hardisk ??
thx
Listed Query --------------------- SELECT Absen.BranchID, Bran.BranchName, Bran.BranchNote, Absen.DepartmentID, Absen.SubDepartmentID, Dis.AfdelingID, Dis.WilayahID, Dis.KemandoranCivilID, TekCiv.KemandoranCivilName, Absen.DateAbsensi as TglAbsensi, Absen.AbsensiID, Absen.KaryawanID, Data.JabatanID1, Jab.JabatanName, Data.GolonganID FROM AMBranchMaster Bran RIGHT OUTER JOIN HRDataKaryawan Data LEFT OUTER JOIN HRDistribusiKaryawan Dis LEFT OUTER JOIN TEKMasterKemandoranCivil TekCiv ON Dis.KemandoranCivilID = TekCiv.KemandoranCivilID ON Data.KaryawanID = Dis.KaryawanID RIGHT OUTER JOIN HRAbsensiKaryawan Absen ON Data.KaryawanID = Absen.KaryawanID ON Bran.BranchID = Absen.BranchID LEFT OUTER JOIN HRMasterJabatan Jab ON Data.JabatanID1 = Jab.JabatanID Union SELECT Absen.BranchID, Bran.BranchName, Bran.BranchNote, Dis.DepartmentID, Absen.SubDepartmentID, Dis.AfdelingID, Dis.WilayahID, Dis.KemandoranCivilID, TekCiv.KemandoranCivilName, Absen.TglAbsensi as TglAbsensi, Absen.AbsensiID, Absen.KaryawanID, Data.JabatanID1, Jab.JabatanName, Data.GolonganID FROM AMBranchMaster Bran RIGHT OUTER JOIN HRDataKaryawan Data LEFT OUTER JOIN HRDistribusiKaryawan Dis LEFT OUTER JOIN TEKMasterKemandoranCivil TekCiv ON Dis.KemandoranCivilID = TekCiv.KemandoranCivilID ON Data.KaryawanID = Dis.KaryawanID RIGHT OUTER JOIN ADMAbsensiKaryawan Absen ON Data.KaryawanID = Absen.KaryawanID ON Bran.BranchID = Absen.BranchID LEFT OUTER JOIN HRMasterJabatan Jab ON Data.JabatanID1 = Jab.JabatanID UNION SELECT Absen.BranchID, Bran.BranchName, Bran.BranchNote, Dis.DepartmentID, Absen.SubDepartmentID, Dis.AfdelingID, Dis.WilayahID, Dis.KemandoranCivilID, TekCiv.KemandoranCivilName, Absen.TglAbsensi as TglAbsensi, Absen.AbsensiID, Absen.KaryawanID, Data.JabatanID1, Jab.JabatanName, Data.GolonganID FROM AMBranchMaster Bran RIGHT OUTER JOIN HRDataKaryawan Data LEFT OUTER JOIN HRDistribusiKaryawan Dis LEFT OUTER JOIN TEKMasterKemandoranCivil TekCiv ON Dis.KemandoranCivilID = TekCiv.KemandoranCivilID ON Data.KaryawanID = Dis.KaryawanID RIGHT OUTER JOIN ADMAbsensiBulananSite Absen ON Data.KaryawanID = Absen.KaryawanID ON Bran.BranchID = Absen.BranchID LEFT OUTER JOIN HRMasterJabatan Jab ON Data.JabatanID1 = Jab.JabatanID Union SELECT Absen.BranchID, Bran.BranchName, Bran.BranchNote, Dis.DepartmentID, Absen.SubDepartmentID, Dis.AfdelingID, Dis.WilayahID, Dis.KemandoranCivilID, TekCiv.KemandoranCivilName, Absen.DateAbsensi as TglAbsensi, Absen.AbsensiID, Absen.KaryawanID, Data.JabatanID1, Jab.JabatanName, Data.GolonganID FROM AMBranchMaster Bran RIGHT OUTER JOIN HRDataKaryawan Data LEFT OUTER JOIN HRDistribusiKaryawan Dis LEFT OUTER JOIN TEKMasterKemandoranCivil TekCiv ON Dis.KemandoranCivilID = TekCiv.KemandoranCivilID ON Data.KaryawanID = Dis.KaryawanID RIGHT OUTER JOIN HRAbsensiKaryawanNonStaf Absen ON Data.KaryawanID = Absen.KaryawanID ON Bran.BranchID = Absen.BranchID LEFT OUTER JOIN HRMasterJabatan Jab ON Data.JabatanID1 = Jab.JabatanID UNION SELECT Absen.BranchID, Bran.BranchName, Bran.BranchNote, Dis.DepartmentID, Absen.SubDepartmentID, Dis.AfdelingID, Dis.WilayahID, Dis.KemandoranCivilID, TekCiv.KemandoranCivilName, Absen.DateAbsensi as TglAbsensi, Absen.AbsensiID, Absen.KaryawanID, Data.JabatanID1, Jab.JabatanName, Data.GolonganID FROM AMBranchMaster Bran RIGHT OUTER JOIN HRDataKaryawan Data LEFT OUTER JOIN HRDistribusiKaryawan Dis LEFT OUTER JOIN TEKMasterKemandoranCivil TekCiv ON Dis.KemandoranCivilID = TekCiv.KemandoranCivilID ON Data.KaryawanID = Dis.KaryawanID RIGHT OUTER JOIN HRAbsensiKaryawanStaf Absen ON Data.KaryawanID = Absen.KaryawanID ON Bran.BranchID = Absen.BranchID LEFT OUTER JOIN HRMasterJabatan Jab ON Data.JabatanID1 = Jab.JabatanID UNION SELECT Absen.BranchID, Bran.BranchName, Bran.BranchNote, Dis.DepartmentID, Absen.SubDepartmentID, Dis.AfdelingID, Dis.WilayahID, Dis.KemandoranCivilID, TekCiv.KemandoranCivilName, Absen.TglAbsensi as TglAbsensi, Absen.AbsensiID, Absen.KaryawanID, Data.JabatanID1, Jab.JabatanName, Data.GolonganID FROM AMBranchMaster Bran RIGHT OUTER JOIN HRDataKaryawan Data LEFT OUTER JOIN HRDistribusiKaryawan Dis LEFT OUTER JOIN TEKMasterKemandoranCivil TekCiv ON Dis.KemandoranCivilID = TekCiv.KemandoranCivilID ON Data.KaryawanID = Dis.KaryawanID RIGHT OUTER JOIN LCAbsensiBulananSite Absen ON Data.KaryawanID = Absen.KaryawanID ON Bran.BranchID = Absen.BranchID LEFT OUTER JOIN HRMasterJabatan Jab ON Data.JabatanID1 = Jab.JabatanID UNION SELECT Absen.BranchID, Bran.BranchName, Bran.BranchNote, Dis.DepartmentID, Absen.SubDepartmentID, Dis.AfdelingID, Dis.WilayahID, Dis.KemandoranCivilID, TekCiv.KemandoranCivilName, Absen.TglAbsensi as TglAbsensi, Absen.AbsensiID, Absen.KaryawanID, Data.JabatanID1, Jab.JabatanName, Data.GolonganID FROM AMBranchMaster Bran RIGHT OUTER JOIN HRDataKaryawan Data LEFT OUTER JOIN HRDistribusiKaryawan Dis LEFT OUTER JOIN TEKMasterKemandoranCivil TekCiv ON Dis.KemandoranCivilID = TekCiv.KemandoranCivilID ON Data.KaryawanID = Dis.KaryawanID RIGHT OUTER JOIN LCAbsensiIndirect Absen ON Data.KaryawanID = Absen.KaryawanID ON Bran.BranchID = Absen.BranchID LEFT OUTER JOIN HRMasterJabatan Jab ON Data.JabatanID1 = Jab.JabatanID UNION ...................
Hello,Access XP, SQL Server 2000Is it possible to hide a SP under Queries in Access, yet still be ableto Execute it from Access?We hooked up a custom form to accept the input parameters (MS FeatureRequest!) for the Stored Procedure. We had two problems with MS's'Input Parameter' dialog: 1) We could not customize, 2) We continuallyreceived a message from Access stating, "The stored procedure executedsuccessfully but did not return records" ('SET NOCOUNT ON' gave nojoy).Below is the sample code we are using.TestInsert is the SPtxtName is a text box on the form@name is char(80)Private Sub cmdAdd_Enter()Dim cmd As New ADODB.CommandDim par As ParameterSet cmd.ActiveConnection = CurrentProject.Connectioncmd.CommandText = "TestInsert"cmd.CommandType = adCmdStoredProcSet par = cmd.CreateParameter("@name", adVarChar, _adParamInput, Len(txtName), txtName)cmd.Parameters.Append parcmd.ExecuteSet cmd = NothingEnd SubAny help would be appreciated. We successfully hid our Tables, andallowed access through Views. But we can't seem to find a good workaround here.ThanksJeffJeffrey Waltonnoloader
The database that I try to access in my query in the package gets restored in the same time when my package runs. If those two things clashs I get the error message. How do I make it retry in 5 minutes for example?
I am having some difficulties with a Execute SQL Task, I'll try to describe:
The task contains 2 queries:
UPDATE config SET last_timestamp_int=this_timestamp_int, this_timestamp_int=CAST(GETDATE() AS INT) WHERE company_id=?
SELECT last_timestamp_int AS last_timestamp_int, this_timestamp_int AS this_timestamp_int FROM config WHERE company_id=?
The ? reference to a variable set in Parameter Mapping, which has a initial string value set. Direction set to "Input", Datatype set to "varchar", and parametername to "0". The connectiontype is OLE DB. I have tried to set BypassPrepare to true, but that doesnt help.
The second query fetch 2 values which is stored in the task's Result Set, in two variables. Resultset is set to single row.
When I press Parse Query, I get an error:
"The query failed to parse. Parameter Information cannot be derived from SQL statements. Set parameter information before preparing command."
When I try to run the package, I get this error:
---
SSIS package "Package.dtsx" starting.
Error: 0xC002F210 at Store last timestamp in variable, Execute SQL Task: Executing the query "UPDATE config SET last_timestamp_int=this_timestamp_int, this_timestamp_int=CAST(GETDATE() AS INT) WHERE company_id=?
SELECT last_timestamp_int AS last_timestamp_int, this_timestamp_int AS this_timestamp_int FROM config WHERE company_id=?" failed with the following error: "No value given for one or more required parameters.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
Task failed: Store last timestamp in variable
Warning: 0x80019002 at Define global variables: The Execution method succeeded, but the number of errors raised (1) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.
Warning: 0x80019002 at Package: The Execution method succeeded, but the number of errors raised (1) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.
SSIS package "Package.dtsx" finished: Failure.
---
Can someone please help me identify, what it is I am doing wrong?
In the data flow task, i have thosands of rows flowing, now just before inserting these rows into a table, i want to delete some rows in the destination table. For this, if i use the oledb command, then it will run several times. I think a script can do it but I want to avoid it because it would be an inefficient affair.