Backup my known things and restoring it into DBA Learners.......
Wednesday, October 10, 2012
[Execute SQL Task] Error in SSIS Merge statement
[Execute SQL Task] Error: Executing the query
"EXEC PC_Procedure_name1
EXEC PC_Procedure_name2..." failed with the
following error: "The MERGE statement attempted to UPDATE or DELETE the
same row more than once. This happens when a target row matches more than one
source row. A MERGE statement cannot UPDATE/DELETE the same row of the target
table multiple times. Refine the ON clause to ensure a target row matches at
most one source row, or use the GROUP BY clause to group the source rows.".
Possible failure reasons: Problems with the query, "ResultSet"
property not set correctly, parameters not set correctly, or connection not
established correctly.
Resolution:
One of the options is presence of duplicates, before
running the merge statement, please try to check the duplicates by running
below query by combining more than 1 columns.
Scripts
for finding duplicates by combining n number of columns
SELECT
q.KEY_FIELD,
COUNT(*)
FROM
(
SELECT
--(column1 ,column2,coulmn3)
CAST(column1 AS VARCHAR)
+CASTcolumn2 AS VARCHAR)
+CAST(coulmn3 AS VARCHAR)
KEY_FIELD,*
FROM Sourcetablename
--where
CAST(column1 AS VARCHAR)+CAST+CASTcolumn2 AS VARCHAR)+CAST(coulmn3 AS -----VARCHAR)='12059754183842012-08-26
00:00:00'
) q
GROUP BY
q.key_field
ORDER BY
COUNT(*) desc
--307130
SELECT COUNT(1)
FROM sourcetablename
--10510844
--10510844
Then change the MERGE Statement
by adding one more column in the ON Clause to do perform merge.
[OLE DB Destination] Error in SSIS:
|
[OLE DB Destination [9]] Error: There was an error with input
column
|
|
SYSTEM_DATE_TIME (130) on input "OLE DB Destination
Input" (22). The column status returned was: "The
|
|
Value could not be converted because of a potential loss of
data."
|
|
Resolution:
|
|
Check any invalid date value in source csv file, if yes then,
change it to 01\01\1753.(Or try to change the
Invalid date value to
valid date value).
That’s all.
|
[SSIS.Pipeline] Error :
|
[SSIS.Pipeline] Warning: The output column "Columnname"
(127) on output "Flat File Source Output" (2)
and component "Flat
File Source" (1) is not subsequently used in the Data Flow task.
Removing this
unused output column can
increase Data Flow task performance.
|
|
Resolution:
|
Check the all columns in source table match with columns in destination
table, if not uncheck extra column
From the 'Available
External Columns' in the Flat file Source Editor by right clicking the Flat
file Source.
|
Database MAIL( sp_send_dbmail) Error in SQL2008 R2:
The mail could not be sent to the recipients because of
the mail server failure. (Sending Mail using Account 1 (2012-08-31T18:10:23).
Exception Message: Cannot send mails to mail server. (Mailbox unavailable. The
server response was: 5.7.1 Unable to relay).
While sending mail from SQL job through sp_send_dbmail
procedure in SQL2008R2, i am getting above error.2 identical emails are send (with same
distribution list and same body), with one minute of difference.
Resolution:
One of the email id in the recipients causing the above
issue. So I have resolved that issue by changing the wrong mail id in the
recipients list to correct mail id.
Eg .(if SMTP server related to your office smtp server.
Then sp_send_dbmail will not send mail to another office server mail id in the
recipients list.)
SSIS2008R2 Error: 0xC0209303 at Package:
When i trying to load data from MS access (MDB) to SQL ,i am
getting the below error.
Error: 0xC0209303 at Package, Connection manager "mdbfilename": SSIS Error Code
DTS_E_OLEDB_NOPROVIDER_64BIT_ERROR. The
requested OLE DB provider Microsoft.Jet.OLEDB.4.0 is not registered -- perhaps
no 64-bit provider is available. Error
code: 0x00000000.
An OLE DB record is available. Source: "Microsoft OLE DB Service
Components" Hresult:
0x80040154 Description: "Class not
registered".
Error: 0xC020801C at Data Flow Task mdbfilename, OLE DB Source [1]: SSIS Error Code
DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the
connection manager " mdbfilename
" failed with error code 0xC0209303. There may be error messages posted before this
with more information on why the AcquireConnection method call failed.
Error: 0xC0047017 at Data Flow Task mdbfilename,
SSIS.Pipeline: component "OLE DB Source" (1) failed validation and
returned error code 0xC020801C.
Resolution:
It seems that SSIS project are now on a 64 bit machine. And
that there is no 64 bit OLE DB provider Microsoft.Jet.OLEDB.4.0.So the fix
is in running this project under 32 bit modes
Go to the SSIS project properties page
à Then Click Debugging under configuration
properties
àSelect “Run64BitRuntime” property to false
àSave the project
->RUN Build again
àThen check the package runs to a successful
completion.
That's it.
How to find the SQLlogins have proper password except blank,samelogin name as password And ‘password’ as password?
--To find
the blank password set for any sql logins.
--PWDCOMPARE
Hashes a password and compares the hash to the hash of
an existing password. PWDCOMPARE can be used to search for
blank SQL Server login passwords or common weak passwords.
SELECT name FROM sys.sql_logins
WHERE PWDCOMPARE('', password_hash) = 1 ;
--To find the password set as like the same name of sql login name for
any sql logins.
SELECT name FROM sys.sql_logins
WHERE PWDCOMPARE(name, password_hash) = 1 ;
--To find
the password set as like 'password' for sql logins
SELECT name FROM sys.sql_logins
WHERE PWDCOMPARE('password', password_hash) = 1 ;
Hope you
can search for blank SQL Server login passwords or common weak passwords with
above query.
Subscribe to:
Posts (Atom)
MYSQL::Setting Validate_Password componet for MySQL Database to ensure password policy settings
Inadequate Password Settings for MySQL Database We observed that the `validate_password%` settings on hostname `<insert hostname>` a...
-
Scenario: I am looking to remove the characters value ‘SQL Server’ from the ‘SQL Server 9.00.4060.00’ in one column on the tablix...
-
When i trying to load data from MS access (MDB) to SQL ,i am getting the below error. Error: 0xC0209303 at Package, Connection mana...
-
Jobs failed with below error message. Error Message: Executed as user: XXXXXX-svc. Mail queued. [SQLSTATE 01000] (Message 0) File attachme...
