Showing posts with label error. Show all posts
Showing posts with label error. Show all posts

Friday, March 30, 2012

How to continue package execution during error?

We have a package that loads the data from several excel files into database in a forloop.

Everything works files until the package hits the bad file.

My goal is to continue the loop to process the rest of the files by skipping the bad file and error. In each task OnError I am creating custom error message to send an error/ sucess summary email out at end of the process.

How can force the for loop to continue when there is an error?

Is there any way to reset the errors?

Thanks

R

The behavior is mostly controlled by three properties: MaxErrorCount, FailPackageOnFailure and FailParentOnFailure. You can increas error count and set "fail" properties to false to make package continue inspite of an error.

how to continue on error

How can I cause my insert statement to skip over (without failing) rows
where there's a primary key constraint violation?

I've got a case where daily I insert >500k rows of daily data, where
the data is date and time stamped. So, for example, I have an insert
statement with constraint: WHERE date >= '5/20/05' AND date <
'5/21/05'. That takes care of one day's data (5/20).

However, the next day's data (5/21) will still have some time stamps
from the previous day. Therefore the statement needs to be something
like WHERE date >= '5/20/05' AND date <= '5/21/05'. The 5/20 data is
already loaded but I need to take the 5/21 data which just happens to
contain just a few rows of data marked 5/20 and insert it without
generating a primary key error from all the other 5/20 rows that are
already inserted.

-DaveINSERT INTO TargetTable (key_col, ...)
SELECT S.key_col, ...
FROM SourceTable AS S
LEFT JOIN TargetTable AS T
ON S.key_col = T.key_col
WHERE T.key_col IS NULL
AND S.date >= '20050520' AND date < '20050522'

--
David Portas
SQL Server MVP
--|||The easy way is to limit the insert query to 11:59 59 of the previous
day. Then you tell your users, "this report contains all the data from
yesterday" In fact, if you're doing a report of some kind, this is
really the best way to do it because otherwise, you have incomplete
(and therefore bad) data for the current day.

Another way is to delete yesterday's data right before you run the
insert.|||Should the join run very slowly? If I do the insert with a standard
insert query it takes about 7 minutes. With the join query it runs and
doesn't seem to be able to finish. If I run the query on dates with no
data it finishes ok. Is my join incorrect since I can't use S.keyrow?

insert into final(keyRow, cell, recordDate, high_set )

SELECT CONVERT(CHAR(16),dateadd(hh,datepart(hh, .access_time),
S.record_date),20)+'|'+CONVERT(CHAR(3), S.bts_id)+'-'+CONVERT(CHAR(1),
S.sector_id)+'-'+CONVERT(CHAR(3), S.carrier_id) AS keyRow,
(CONVERT(CHAR(3), S.bts_id)+'-'+CONVERT(CHAR(1),
S.sector_id)+'-'+CONVERT(CHAR(3), S.carrier_id)) AS cell,
CONVERT(CHAR(16),dateadd(hh,datepart(hh, S.access_time),
S.record_date),20)as recordDate, SUM(S.high_set_int) AS high_set

from SourceTable AS S
LEFT JOIN TargetTable AS T
ON keyRow = T.keyRow

WHERE T.keyRow IS NULL
AND S.record_date >= '5/06/2005' AND S.record_date < '5/07/2005' AND
convert (char(8), S.access_time,108) != '00:00:00'

GROUP BY CONVERT(CHAR(16),dateadd(hh,datepart(hh, S.access_time),
S.record_date),20),
CONVERT(CHAR(16),dateadd(hh,datepart(hh, S.access_time),
S.record_date),20)+'|'+
CONVERT(CHAR(3), S.bts_id)+'-'+CONVERT(CHAR(1),
S.sector_id)+'-'+CONVERT(CHAR(3), S.carrier_id)

ORDER BY CONVERT(CHAR(16),dateadd(hh,datepart(hh, S.access_time),
S.record_date),20),
CONVERT(CHAR(16),dateadd(hh,datepart(hh, S.access_time),
S.record_date),20)+'|'+CONVERT(CHAR(3), S.bts_id)+'-'+
CONVERT(CHAR(1), S.sector_id)+'-'+CONVERT(CHAR(3), S.carrier_id),
S.cell|||
christopher.secord@.gmail.com wrote:
> The easy way is to limit the insert query to 11:59 59 of the previous
> day. Then you tell your users, "this report contains all the data from
> yesterday" In fact, if you're doing a report of some kind, this is
> really the best way to do it because otherwise, you have incomplete
> (and therefore bad) data for the current day.

Yes, I agree but the way the data is generated results in "today's"
data flat file containing some of yesterday's data. So although 99% of
yesterday's data is already in the db, the last little bit needs be
added for completeness. It's not that the nearly all users can't use
the 99% data for their purposes but still the missing 1% needs to be
added for later complete, accurate reports.

> Another way is to delete yesterday's data right before you run the
> insert.

This puts the problem back 1 day because I would still need to add
yesterday's data which is in its own flat file which contains data from
the day before yesterday.

-David|||David Portas wrote:
> INSERT INTO TargetTable (key_col, ...)
> SELECT S.key_col, ...
> FROM SourceTable AS S
> LEFT JOIN TargetTable AS T
> ON S.key_col = T.key_col
> WHERE T.key_col IS NULL
> AND S.date >= '20050520' AND date < '20050522'

I'm thinking maybe the best thing to do is add another column to my
table that uniquely identifies the data from a particular day. Some of
the data from the particular flat file will be from the day before but
it won't matter because I'll use the new field in the where criteria
instead of the actual record dates.

Also thought about using NOT EXISTS somehow.

-Dave|||Make sure you have indexes on the columns that are being joined.|||(wireless200@.yahoo.com) writes:
> Should the join run very slowly? If I do the insert with a standard
> insert query it takes about 7 minutes. With the join query it runs and
> doesn't seem to be able to finish. If I run the query on dates with no
> data it finishes ok. Is my join incorrect since I can't use S.keyrow?

I don't understand that last question. What do you mean, you cannot
use S.keyrow?

A clustered index on S.record_date would be a good thing.

I would also replace the LEFT JOIN with NOT EXISTS. Not because this
is faster, but because expresses what you mean.

Does the target table have an IDENTITY column? Else there is no reason at
all to have the ORDER BY clause. Removing that could also gain some
performance.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

Wednesday, March 28, 2012

how to connect to ssis service - The RPC server is unavailable err

Hi
I am trying to connect to ssis service on remote machine using the sql 2005
management studio
I get the following error :
TITLE: Connect to Server
Cannot connect to <servername>.
Connect to SSIS Service on machine "<servername>" failed:
The RPC server is unavailable.
What do I miss please help
Best regards
Meron FridmanDid you figure out a solution ' I have the same problem
--
homebre
----
homebrew's Profile: http://www.dbtalk.net/m5
View this thread: http://www.dbtalk.net/t29008|||I've got the same problem in a two-node active/active environment.
Anyone got any further info?
"homebrew" wrote:
> Did you figure out a solution ' I have the same problem.
>
> --
> homebrew
> ---
> homebrew's Profile: http://www.dbtalk.net/m55
> View this thread: http://www.dbtalk.net/t290084
> .
>|||I found out that one of our developers (developer #1) wasn't having an
problems, and that he had used a different disk to install on hi
desktop. So then developer #2 used his disk, and her problem went away
I had already put in a call to Microsoft, and we tested my RPC port
and they seemed fine. So I think I got a bad disk ... perhaps som
file is corrupted ?
Then he had another utility for me to try, but I haven't bothered yet
since I'm pretty sure it's the disk, and not something on my desktop
--
homebre
----
homebrew's Profile: http://www.dbtalk.net/m5
View this thread: http://www.dbtalk.net/t29008sql

how to connect to ssis service - The RPC server is unavailable err

Hi
I am trying to connect to ssis service on remote machine using the sql 2005
management studio
I get the following error :
TITLE: Connect to Server
Cannot connect to <servername>.
Connect to SSIS Service on machine "<servername>" failed:
The RPC server is unavailable.
What do I miss please help
Best regards
Meron Fridman
Did you figure out a solution ? I have the same problem.
homebrew
homebrew's Profile: http://www.dbtalk.net/m55
View this thread: http://www.dbtalk.net/t290084

how to connect to ssis service - The RPC server is unavailable err

Hi
I am trying to connect to ssis service on remote machine using the sql 2005
management studio
I get the following error :
TITLE: Connect to Server
Cannot connect to <servername>.
Connect to SSIS Service on machine "<servername>" failed:
The RPC server is unavailable.
What do I miss please help
Best regards
Meron FridmanDid you figure out a solution ' I have the same problem.
homebrew
---
homebrew's Profile: http://www.dbtalk.net/m55
View this thread: http://www.dbtalk.net/t290084|||I found out that one of our developers (developer #1) wasn't having any
problems, and that he had used a different disk to install on his
desktop. So then developer #2 used his disk, and her problem went away.
I had already put in a call to Microsoft, and we tested my RPC ports
and they seemed fine. So I think I got a bad disk ... perhaps some
file is corrupted ?
Then he had another utility for me to try, but I haven't bothered yet,
since I'm pretty sure it's the disk, and not something on my desktop.
homebrew
---
homebrew's Profile: http://www.dbtalk.net/m55
View this thread: http://www.dbtalk.net/t290084

Monday, March 26, 2012

How to connect to sql server 2000 (asp.net)

hi everybody, i got this error in my code.

Server Error in '/' Application.


SQL Server does not exist or access denied.

Source Error:

 
Line 12:       Dim SQLConn As SqlConnection = New SqlConnection()
Line 13:                SQLConn.ConnectionString = ConfigurationSettings.AppSettings("ConnectionString")
Line 14:                SQLConn.Open()
Line 15:       
Line 16:       cmdLath = New SqlCommand ( _

my web.config

<configuration>

<appSettings>

<addkey="ConnectionString" value="DataSource=xxx;UID=xxx;pwd=xxx" />

<addkey="ConnectionString" value="Server=xxx.xxx.x.x;database=xxx;UID=xxx;pwd=xxx;Trusted_Connection=True"/>

</appSettings>

<system.web>

<sessionState cookieless="false" timeout="20"/>

<customErrorsmode="Off"/>

</system.web>

</configuration>

what seems to be a problem, please help me??Is your connection string correct (server address, username, password, etc.)? Does the user your authenticating as have the correct permissions on the database?

Ryan|||i ran into this problem a few weeks ago as well, like the previous poster stated, you have to make sure they have an account in the sql server itself, not just a windows account. So the problem isn't with your code (assuming no spelling errors or the such) but with the sql server authenticating the user name and password. Hope that helps.|||Besides the suggestions given above, make sure you have SQL Server Authentication configured to be Mixed mode. Checkthis for the configuration.|||To Strongtypes,

Yes, I write the correct server, database, username and password. basically i use sa account with password but it didn't work. I used sql server authentication mixed mode.|||To Darkempire and Alvin,

Thanks for the reply, You know I've done a lot of codes in my asp.net but unfortunately it appears errors in my webpage. This is my setup, my sql server 2000 is installed on other machine with the domain controller running windows server 2003. I have this local pc with my asp.net with web server(iis). I think that my web server does not locate my sql server database or my connection string is wrong but if I'm going to used my dreamweavermx to fetch data to my sql server database it will show up perfectly but when i code an asp.net and run in my localhost, bang errorrs.. please help me|||

Let's do a connection testing on teh .NET client machine: new a '.udl' file e.g. test.udl, then double click to edit it->switch to Provider tab and choose 'SQL Native Client' (which is the default provider when you add connectionstring element in your web.config)->click next to switch to Connection tab->entering connection information including login and pasword (the same as you connect to the SQL Server in DreamWeaver)->click Test Connection. If this succeeds, then the SQL Native Client provider is OK; otherwise there's something wrong with the SQL Native Client provider, so you need to change another provider.

To learn more about connection strings using different providers, you can visit:

www.connectionstrings.com

sql

How to connect to a server (sql server 2005

Hi Everyone

I'm trying to connect to a server using SQL Server Management studio but I have an error message saying "an error has occurred while establishing a connection to the server" error 1231

I have no knowledge about SQL server 2005 and SQL Server Management studio.

I presume I need to create a server first (but how?)

Could you tell what I need to do do connect to a server?

Many thanks in advance
EmilYou can either setup your own SMS Gateway using a GSM modem connected to a PC, or you can connect to an SMS Gateway provider like http://www.clickatell.com through the Internet, or you can use a combination of both. There are open source gateways like http://www.kannel.org and also commercial gateways like http://www.visualtron.com.

Regards,
Joshua
SMS Server@.Expert

how to connect to a local sql server on your laptop?

i have problems connecting to the local server on my laptop. i ahve used the following code but it gives me an error saying login flaied for user "sa" or "sekhar".

i tried using the username and password i use to log onto my computer. but it doesnt work.
can anyone tell me how to do it?

the code is typed is

connection = new sqlconnection("server=localhost;uid=sekhar;pwd=sekhar;database=chandu")
..................
.............................
........................
connection.open()..............i have all the next statements correct.
my username is sekhar and the password is sekhar too but it gives me an error.
somebody help me

Thank you

sekhartry using server=(local)

and whether you need the password or not depends on how the SQL Server is set up. does the users view show a user called 'sekhar'? no? when you right click the server node and go to properties->security, does it show windows auth only, or Windows and SQL Server auth?

Friday, March 23, 2012

How to connect SQL Server From Pocket PC Device

Dear members

I want to connect SQL Server database from pocket pc device

but it gives an error than "Either the sql database does not exist or access denied

My Code is

SqlConnection conn=new SqlConnection("Data Source=OurServer;initial catalog=Resident;user id = sa;password = sa);

conn.Open();

If anybody knows the problem please send some information

Regards

Bijaya

The error suggests that connectivity doesn't exist between the pocket pc device and SQL or that the server isn't running/listening on the desired protocol.

Does the same code run successfully on a desktop PC? If so try verifing that the pocket pc has network connectivity and access to the SQL machine.

Hope this helps.

|||

Thanks for reply

Now the above code can connect SQL Server 2003 installed in Windows 2000 professional machine.But it can not connect to the SQL Server installed in Windows XP machine.

what is the problem behind it.Please give some information

Regards Bijaya

|||

This blog is a great source for connection troubleshooting tips:
http://blogs.msdn.com/sql_protocols

In this case if SQL Server 2005 is running on Windows XP SP2 then you may need to add an exception to the Windows firewall for the service. The blog goes into detail on exactly how to accomplish this.

Hope this helps.

Wednesday, March 21, 2012

how to connect asp.net to sql server 2k

i have this error in my asp.net

>Server Error in '/' Application.
>------------------------
>SQL Server does not exist or access denied.
>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: SQL Server does not exist or access denied.
>Source Error:
>
>Line 23: Dim sText As String = "SELECT employeeid, firstname, lastname FROM Employees"
>Line 24: Dim cmd As SqlDataAdapter= New SqlDataAdapter(sText, sConn)
>Line 25: cmd.Fill(ds, "EmpTable")
>Line 26:
>Line 27: Session("MyData") = ds
>
>Source File: c:\inetpub\wwwroot\FormViewer.aspx Line: 25

and my connection string is :

>"server=localhost;uid=sa;Initial Catalog=Northwind;"

i tried a lot of codes but it doesn't work in sql server 2k but in mysql server it perfectly run. i installed my web server in my local machine with .net framework but my sql server 2k is installed in other machine with the domain controller setup. how im going to connect to my sql server 2k using asp.net codes. i learn some ideas that it better to code the connection string in web.config. is it ok? please please help me. im really out of mind.hi everybody, im a newbie in asp.net. my current language is vb/sqlserver2k. i have a problem in connecting asp.net to sql server2k because my sql server2k is installed in other machine and my web server is installed in my local machine together with my .net framework. i tried a lot of examples but none of this is working with application, it shows with an error "SQL Server does not exist or access denied."
can you give me a complete source step by step. i would really appreciate if anybody can help. thanks in advance|||Tryhttp://www.connectionstrings.com for connection string help. If you still can't get it working, is your SQL Server using SQL authentication or Windows authentication? What does your connection string look like (be sure not to post actual user names and passwords if you are using SQL authentication)?

Edit: I found your duplicate post on the same topic and joined it to this thread. Please do not post the same question multiple times. It only frustrates those who are trying to help you and dilutes the effort.|||how can i know what authentication am i using, sql authentication or windows authentication?
all i know that in my vb application i was using this connection string to connect to my sql server "provider=sqloledb;database=xxxx;server=xxxx;uid=xxx;pwd=xxxx" is that so simple in my vb but in asp.net i really don't know what is the correct connection. thanks anyway tmorton for your reply|||Use the connection string example under SQL Server, SqlConnection, Standard Security at connectionstrings.com.

You are using SQL authentication since you are using a user name and password to connect. If you were using Windows authentication there would be no user name or password; the credentials of the current user would be used.

Monday, March 12, 2012

How to Configure DSN with DataReader Source

Hi
I am not able configure DSN in SSIS, I tired with DataReader Source but its given error
" Check SQL Command Property"
Appriciate to you for Help

Errr....try checking the SQLCommand property. What is it set to?
What is a DSN in SSIS?

You have to provide more specific info if you really want people to help.

-Jamie|||

Hi Jamie

I made one DSN which pointing Excel Driver, But when Create Connection Manager for these DSN by using ADO.NET Connection Manager.
When i configure this connection manager in DataReader Source its give as error "check SQL Command property"
Here I am ot able to set SQL Commmand property
so please Help me to set the property with any example

|||If you are connecting to Excel, why give yourself the added grief of maintaining an external DSN? Use the OLE DB Provider for Jet and a file path. ODBC simply adds one more unnecessary layer of DLLs in the background.

-Doug|||Thanks Doug
I got it from OLE DB,Thanks again for your help

how to configue the reportserver?

hi,

I have recently start learning reporting service!

A problem is that when I try to run the report,

a error message like "report server can not be found" always occur

how can i solve it?

thx

There is probably something wrong in the configuration of your report server. Did you do a default install of report server? Were there any errors showing in the configuration tool? Is there anything useful in the log file?

Friday, March 9, 2012

How to concatenate constants and expressions in report field

I was receiving [BC30205] End of statement expected Error
when I tryed to concatenate:

=INT(AVG(Fields!HT.Value)/360) ":" &INT(AVG(Fields!HT.Value)/60)

Please hlp!
Thank you.

You must convert to a string type.

= CSTR(INT(AVG(Fields!HT.Value)/360))+":"+CSTR(INT(AVG(Fields!HT.Value)/60))

How to completely remove MSDE

I need to completly remove MSDE from my PC it was installed using Install Shield Express and when I try to uninstall, I get a Fatal error durring installation. There must be a way other than reformatting?

Thank you,If you can tell me what the error said, then I'll be in a position to help you. But If it said something about some file not be able to be deleted, make sure it (MSDE) isn't running.

Sunday, February 19, 2012

how to check whether the sql server is up

hi,
i'm working on a windows service in vb.net which will be started
automatically. but sometimes, on startup, it will show this error --
ERROR [08001] [Microsoft][ODBC SQL Server Driver][Shared Memory]SQL
Server does not exist or access denied.
I think this is because, my service uses an sql server connection, but
sql server starts only after my service.
plz help me out to check whether the sql server is up in vb.net code so
that if it is not started, v can wait for it to start.
thanx
vipinPing to the server.
CREATE TABLE #t_ip (ip varchar(255))
DECLARE @.PingSql varchar(1000)
SELECT @.PingSql = 'ping ' + '00.00.0.0'
INSERT INTO #t_ip EXEC master.dbo.xp_cmdshell @.PingSql
SELECT * FROM #t_ip
IF EXISTS (SELECT TOP 2 * FROM #t_ip WHERE IP = 'Request timed out' )
BEGIN
DROP TABLE #t_ip
RETURN
END
DROP TABLE #t_ip
<vipinhari@.gmail.com> wrote in message
news:1142402449.177773.136960@.j52g2000cwj.googlegroups.com...
> hi,
> i'm working on a windows service in vb.net which will be started
> automatically. but sometimes, on startup, it will show this error --
> ERROR [08001] [Microsoft][ODBC SQL Server Driver][Shared Memory]SQL
> Server does not exist or access denied.
> I think this is because, my service uses an sql server connection, but
> sql server starts only after my service.
> plz help me out to check whether the sql server is up in vb.net code so
> that if it is not started, v can wait for it to start.
> thanx
> vipin
>|||Uri,
That's fine but your snippet only check whether such workstation/server is
up, nothing about sql server/agent services.
--
current location: alicante (es)
"Uri Dimant" wrote:

> Ping to the server.
> CREATE TABLE #t_ip (ip varchar(255))
> DECLARE @.PingSql varchar(1000)
> SELECT @.PingSql = 'ping ' + '00.00.0.0'
> INSERT INTO #t_ip EXEC master.dbo.xp_cmdshell @.PingSql
> SELECT * FROM #t_ip
> IF EXISTS (SELECT TOP 2 * FROM #t_ip WHERE IP = 'Request timed out' )
> BEGIN
> DROP TABLE #t_ip
> RETURN
> END
> DROP TABLE #t_ip
>
> <vipinhari@.gmail.com> wrote in message
> news:1142402449.177773.136960@.j52g2000cwj.googlegroups.com...
>
>|||Hi,
if you don=B4t wanna use SMO to check this, simply build a snippet of
code connection to the server and encapsulate this with a try catch
block.
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
--|||Using the .Status property of the SQLDMO.SQLServer object, you can test the
status of a SQL Server. Also of interest are the .Start, .Pause, .Continue,
and .Stop method calls.
http://www.devx.com/vb2themax/Tip/18459
Discuss with the DBA or network admin why the server would occasionally not
be running when needed.
<vipinhari@.gmail.com> wrote in message
news:1142402449.177773.136960@.j52g2000cwj.googlegroups.com...
> hi,
> i'm working on a windows service in vb.net which will be started
> automatically. but sometimes, on startup, it will show this error --
> ERROR [08001] [Microsoft][ODBC SQL Server Driver][Shared Memory]SQL
> Server does not exist or access denied.
> I think this is because, my service uses an sql server connection, but
> sql server starts only after my service.
> plz help me out to check whether the sql server is up in vb.net code so
> that if it is not started, v can wait for it to start.
> thanx
> vipin
>