declare @sql char(500)
Select @sql = '"Insert Into T74ACCO Select * From tempdb..##Temp tp Where tp.' + @Key + ' not In (Select ' + @Key + ' From T74ACCO)"'
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?
hi, i have a question. is there a way to execute a string when there is a function in the string? here is an example. (try to run this at query analyzer)
Basically, I have a table with a column that stores mathematical formulas in string format. When my UDF is executed, it needs to select an appropriate formula from this table and evaluate it using values that are stored in local variables.
Look at the example below:
Suppose I have a string named @vcFormula that contains the following:"@dVar1 + @dVar2 / @dVar2"Now suppose I have a variable named @dVar1 that contains a value of 1.0, and variable @dVar2 contains a value of 2.5. I can use the REPLACE function to change my original string to look like this:"1.0 + 2.5 / 2.5"
Now I want to execute this string and find the numeric result, placing it in a variable named @dResult. The following works, but presents a problem:CREATE TABLE #Result (dResult decimal(20, 10))INSERT #Result EXEC('SELECT ' + @vcFormula)SELECT @dResult = dResult FROM #ResultThe problem with using this method comes from the fact that I need to be able to evaluate @vcFormula from within a user-defined function, but temporary tables are not allowed inside UDF's.
So I attempted to change the temporary table above into an instance of the TABLE data type. This didn't work either because EXEC cannot be used to populate instances of the TABLE data type. Then I came up with the bright idea to put the code above in a SP and call the SP from the UDF, but of course UDF's are not allowed to call SP's. Specifically, is there any way to execute a command/formula that is contained within a string other than by using EXEC?
where comment is varchar(1000). I map package variable User::Comment (type string) to parameter @Comment in SQL Task properties. But when length of User::Comment greater than 10 characters SSIS returns errors:
Error: 0x0 at Execute SQL Task 1: String or binary data would be truncated.
Error: 0xC002F210 at Execute SQL Task 1, Execute SQL Task: Executing the query "insert T (comment) values (@Comment)" failed with the following error: "The statement has been terminated.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
The similar messages from this forum suggest using the OLEDB connection. I try this method too, but get the same result.
Error: 0x0 at Execute SQL Task 1: String or binary data would be truncated.
Error: 0xC002F210 at Execute SQL Task 1, Execute SQL Task: Executing the query "insert T (comment) values (?)" failed with the following error: "The statement has been terminated.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
What is it? Is this a bug, I made a mistake or I have SQL Server old version?
I have SQL 2005 (Developer Edition) 09.00.3054 TIA, Max.
Hello to all, I have a problem with ms sql query. I hope that somebody can help me. i have a table "Relationships". There are two Fields (IDMember und RelationshipIDs) in this table. IDMember is the Owner ID (type: integer) und RelationshipIDs saves all partners of this Owner ( type: varchar(1000)). Example Datas for Table Relationships: IDMember Relationships . 3387 (2345, 2388,4567,....) 4567 (8990, 7865, 3387...) i wirte a query to check if there is Relationship between two members. Query: Declare @IDM int; Declare @IDO int; Set @IDM = 3387, @IDO = 4567; select * from Relationship where (IDMember = @IDM) and ( cast(@ID0 as char(100)) in (select Relationship .[RelationshipIDs] from Relationship where IDMember = @IDM))
But I get nothing by this query. Can Someone tell me where is the problem? Thanks
how to execute this stored procedure to decode a varchar hexadecimal string? My SQL syntax stills have faded with the sands of time... I want to do a select * from the users table and decode the Password field (but not update) in the process.
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?
Hi all, mister I want create a function but I get this error: Error Invalid use of side-effecting or time-dependent operator in 'EXECUTE STRING' within a function
I think in a function, cannot use temp tables, or calling exec or store procedures.
Which is the best solution for my issue ? develop store procedure ??
I have no idea to write a store procedure or only query to pass a string parameter more than 4000 characters into execute() and return result for FETCH and Cursor.
Link ( GroupID int , MemberID int ) Member ( MemberID int , MemberName varchar(50), GroupID varchar(255) )
The Link table contains the records showing which Member is in which Group. One particular Member can be in multiple Groups and also a particular Group may have multiple Members.
The Member table contains the Member's ID, Member's Name, and a Group ID field (that will contains comma-separated Groups ID, showing in which Groups the particular Member is in).
We have the Link table ready, and the Member table' with first two fields is also ready. What we have to do now is to fill the GroupID field of the Member table, from the Link Table.
For instance,
Read all the GroupID field from the Link table against a MemberID, make a comma-separated string of the GroupID, then update the GroupID field of the corresponding Member in the Member table.
Please help me with a sql query or procedures that will do this job. I am using SQL SERVER 2000.
FROM [Order Details] OD, Orders O, Products P, Categories C
WHERE OD.OrderID = O.OrderID
AND OD.ProductID = P.ProductID
AND P.CategoryID = C.CategoryID
AND C.CategoryName = @CategoryName
AND SUBSTRING(CONVERT(nvarchar(22), O.OrderDate, 111), 1, 4) = @OrdYear
GROUP BY ProductName
ORDER BY ProductName
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// From an ADO.NET 2.0 book, I copied the code of ConnectionPoolingForm to my VB 2005 Express. The following is part of the code:
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Drawing
Imports System.Text
Imports System.Windows.Forms
Imports System.Data
Imports System.Data.SqlClient
Imports System.Data.Common
Imports System.Diagnostics
Public Class ConnectionPoolingForm
Dim _ProviderFactory As DbProviderFactory = SqlClientFactory.Instance
Public Sub New()
' This call is required by the Windows Form Designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
'Force app to be available for SqlClient perf counting
Using cn As New SqlConnection()
End Using
InitializeMinSize()
InitializePerfCounters()
End Sub
Sub InitializeMinSize()
Me.MinimumSize = Me.Size
End Sub
Dim _SelectedConnection As DbConnection = Nothing
Sub lstConnections_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles lstConnections.SelectedIndexChanged
End Sub /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// I executed the code successfully and I got a box which asked for "Enter the query string". I typed in the following: EXEC dbo.SalesByCategory @Seafood. I got the following box: Query attempt failed. Must declare the scalar variable "@Seafood". I am learning how to enter the string for the "SQL query programed in the subQuery_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnQuery.Click" (see the code statements listed above). Please help and tell me what I missed and what I should put into the query string to get the information of the "Seafood" category out.
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 now have two SSIS package, "TESTING" and "LOADING". The "TESTING" package have an execute package task that call the "LOADING" package. When I want to execute the TESTING package, how can I setup the connection string so that I can edit the password of the database connected by the "LOADING" package?
I am using execute pacakge task to execute another package . I am giving the Connection string for the package to execute. It works fine in my development machine but when i try to run in another server after i deployed it. It looks for the datasource path of the DTSX file in the same location.
how do i set the path according to each server where the dtsx file is stored. or any other method of storing it like connection string.
if i store it in theparent package variable where should i point to...
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?
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 ...................