Showing posts with label uploading. Show all posts
Showing posts with label uploading. Show all posts

Friday, March 30, 2012

Problem with Bulk Upload. Uploads twice.

When I run the following stored procedure I get these results. My file has
24 rows in it. However I am uploading it twice for some reason.
Stored Procedure:
CREATE PROCEDURE [dbo].[dsp_Manual_Import]
(
@.PathFileName varchar(50),
@.SQL varchar(2000)
)
AS
SET @.SQL = "BULK INSERT dbo.dtbl_Manual_Process FROM '"+@.PathFileName+"'
WITH (FIELDTERMINATOR = ',') "
EXEC (@.SQL)
return
GO
Results:
(24 row(s) affected)
(24 row(s) affected)
Stored Procedure: ILVS.dbo.dsp_Manual_Import
Return Code = 0Have you confirmed the duplicate rows were inserted by running a query
against the table afterward?
Are there any triggers on the table, perhaps it is inserting to an audit
table?
"meverts" <meverts@.discussions.microsoft.com> wrote in message
news:29839035-56E2-46E4-814F-C473CEA2E99D@.microsoft.com...
> When I run the following stored procedure I get these results. My file
> has
> 24 rows in it. However I am uploading it twice for some reason.
>
> Stored Procedure:
> CREATE PROCEDURE [dbo].[dsp_Manual_Import]
> (
> @.PathFileName varchar(50),
> @.SQL varchar(2000)
> )
> AS
>
> SET @.SQL = "BULK INSERT dbo.dtbl_Manual_Process FROM '"+@.PathFileName+"'
> WITH (FIELDTERMINATOR = ',') "
> EXEC (@.SQL)
>
> return
> GO
> Results:
> (24 row(s) affected)
>
> (24 row(s) affected)
> Stored Procedure: ILVS.dbo.dsp_Manual_Import
> Return Code = 0|||Yes I checked the table and it is importing twice. There are no triggers.
"JT" wrote:

> Have you confirmed the duplicate rows were inserted by running a query
> against the table afterward?
> Are there any triggers on the table, perhaps it is inserting to an audit
> table?
> "meverts" <meverts@.discussions.microsoft.com> wrote in message
> news:29839035-56E2-46E4-814F-C473CEA2E99D@.microsoft.com...
>
>|||Another concern is that I only am importing 24 records, and it is reporting
48.
"JT" wrote:

> Have you confirmed the duplicate rows were inserted by running a query
> against the table afterward?
> Are there any triggers on the table, perhaps it is inserting to an audit
> table?
> "meverts" <meverts@.discussions.microsoft.com> wrote in message
> news:29839035-56E2-46E4-814F-C473CEA2E99D@.microsoft.com...
>
>|||That's strange. Just as an experiment, try the following and confirm if they
all behave the same way.
#1 Execute dsp_Manual_Import manually from Query Analyzer instead of from
your application.
#2 Execute the same bulk insert command from Query Analyzer instead of
from within the stored procedure.
#3 Execute a similar bulk insert command against a different table.
"meverts" <meverts@.discussions.microsoft.com> wrote in message
news:F28E3D8A-5386-4173-998C-5865E2866C23@.microsoft.com...
> Another concern is that I only am importing 24 records, and it is
> reporting 48.
> "JT" wrote:
>

Wednesday, March 7, 2012

Problem viewing the site after uploading

HI,

I have upladed my application to my remote server but then I get an error message. I am a beginner so any help would be appreciated and if possible explain the solution to me in a simpler format. Here is the error message:

Server Error in '/' Application.


Anerror has occurred while establishing a connection to the server. Whenconnecting to SQL Server 2005, this failure may be caused by the factthat under the default settings SQL Server does not allow remoteconnections. (provider: SQL Network Interfaces, error: 26 - ErrorLocating Server/Instance Specified)

Description:Anunhandled exception occurred during the execution of the current webrequest. Please review the stack trace for more information about theerror and where it originated in the code.

Exception Details:System.Data.SqlClient.SqlException:An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by thefact that under the default settings SQL Server does not allow remoteconnections. (provider: SQL Network Interfaces, error: 26 - ErrorLocating Server/Instance Specified)

Source Error:

The source code that generated this unhandled exception can only beshown when compiled in debug mode. To enable this, please follow one ofthe below steps, then request the URL:

1. Add a "Debug=true" directive at the top of the file that generated the error. Example:

<%@. Page Language="C#" Debug="true" %
or:

2) Add the following section to the configuration file of your application:

<configuration>
<system.web>
<compilation debug="true"/>
</system.web>
</configuration
Note that this second technique will cause all files within a givenapplication to be compiled in debug mode. The first technique willcause only that particular file to be compiled in debug mode.

Important:Running applications in debug mode does incur a memory/performanceoverhead. You should make sure that an application has debuggingdisabled before deploying into production scenario.

Thanks in advance.

In sql 2005 you have to enable remoteconnection to access the DB from other machine. To enable Remote connection in SQL 20005 follow these steps

Under SQL2005 program menu follow configuration Tools =>SQL Server Surface Area Configuration => Select Server Surface Area Configuration for Services and Connections.

It will lead to a window with a treeview select Remote connections.Then Select Local and Remote Connections.

Thats it, now you can connect your SQL Server without any problem

Hope this will help you

Monday, February 20, 2012

Problem uploading data into SQL Server with SSIS

Hi

I designed a package in SSIS that loads data from an Excel source into a oledb SQL database table.

The problem I have is that two of the columns that are supposed to be nvarchar type columns sometimes contain numerical strings. These values causes an error when 'Allow Null' is not set and loads as NULL if 'Allow Null' is set.

How can I force these values into the table?

I have a script transformation object in the package with this code:

If IsNumeric(Row.OCCode) Then

Row.ItemCode = CStr(Row.OCCode)

Else

Row.ItemCode = Row.OCCode

End If

ItemCode is of type unicode string and the column in the SQL DB Table it's mapped to is of type nvarchar

What is the source data type set to for those columns in the source connection?|||

I don't know how to check that, but the input columns into the transformation from the source are unicode strings.

I Also tried Forcing the Excel columns to Text.

|||In the source, the columns are set to Unicode string [DT_WSTR]|||Yeah, I don't understand what NULLs have to do with numeric data appearing in a string field. Can you shed more light on this?|||

It seems impossible to upload Text and numeric values into one Text column in the SQL database. The excel source picks up the source data as unicode string if its alphanumeric values and Numeric type when it's numeric value. if I make all the source columns in the source Unicode String it stops the running package as soon as it comes accross a numeric value with this Error Message:

There was an error with input column "ItemDescription" (889) on input "OLE DB Destination Input" (248). The column status returned was: "The value violated the integrity constraints for the column

If I make the column accept NULL values in the database, the package completes the data load, but make all the numeric values NULL.

I can enter data manually into this database to take numeric values in the nvarchar field, but I don't know how to set the SSIS package to upload the numeric values as Text.

|||Take a look here:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1277733&SiteID=1|||

I managed to upload the data, thanks. The link you added mentioned that numerical strings in the excel file need to be re-entered after the column format is changed to Text. Seeing that I had 54000 rows, I had to perform a text-function operation on all the relative cells. Something like =trim(A2) and then copy these cells back to the original columns as values.

Thanks

|||The important thing in that link was the setting of the IMEX parameter.|||

Yeah I saw the code, but don't know where to add it or how to change the IMEX property. I had to get the data in.

It will help a lot if you can explain where to change this property. I can change the registry entries.

Problem uploading .rdl

The report server cannot process the report. The data source connection information has been deleted

I want to make a copy of a report. I go into report properties on the SSRS, click edit and download the .rdl to my computer.

I then upload the report, using a different name.

I then get the above error.

If I copy the report to the same location as the shared data source, and the above error disappears.

But now the report doesn't work - no parameters in the dropdown lists.

My question is : Why does a copy of a report, uploaded to the SSRS, not work, when the original is sitting right next to it, with the same rdl definitin, in a working state?

Are all the datasets using a single shared data source? Check that no private data sources are being used. After re-uploading the report with a different name, go to the properties page in report manager and in the data sources section make sure that you check all the datasources being used. Repoint it to the shared datasource and retype any connection strings and usernames and passwords for the data sources. I think for security reasons these are ommitted when you export the RDL.|||

Adam,

You are right. I checked the Data Sources, and there were two shared data sources that were marked invalid. However, I notice that the parameters have also been messed up. In the original report, there was no default parameter specified, whereas the new report (copied and uploaded) indicates a default parameter, which happens to be an invalid value. Because the dropdown boxes for the other parameters are linked, these dropdown boxes don't populate. My reasoning says that the uploaded .rdl should be the same as the copy I downloaded. I can see that it has been changed when referencing Data Sources. Why is there this difference in the parameters? Is this "by design"?
Question : Why does the parameter default value change when I upload the .rdl using a different name?

Question: How do I fix the problem?

|||

I notice that the new report (copy) has two problems with the parameters:

1. Parameter is no longer marked "hidden", but is marked "prompt the user"

2. Parameter contains an invalid default value.

I have changed the parameter so that it is now marked "hidden", and so that the default value is the same as the original report (which was empty). The report now works.

Perhaps somebody has an answer to the problem below (repeated from previous post):

Question : Why does the parameter default value change when I upload the .rdl using a different name?