Showing posts with label source. Show all posts
Showing posts with label source. Show all posts

Wednesday, March 28, 2012

Problem in Datatype Date Convertion

Hi,

My source is flat file and my destination is SQL SERVER 2005 using SSIS TOOL.

In my source file i got a date column which is in ISO standards ex: 20050131

I have taken source flat file data type as database date [DT_DBDATE] and in

destination table i declared data type as datetime.

When i start debugging i am getting an error saying that data conversion is not possible.

Can you please help me out how to solve the problem, what data types do i need to take in source and destination and is there any necessity of using Data Conversion Transformation.

If, so please tell me how to do.

With Regards

Satish

What is the full error message? It should tell you in which component the error is occurring.

-Jamie

sql

Wednesday, March 21, 2012

problem importing access field into mssql

having a problem with one single field
its coming up with the error message "data for source column 2 ('general
notes') is too large for the specified buffer size"
how would i fix this ?
thanks
mark
"Julie" <anonymous@.discussions.microsoft.com> wrote in message
news:e07f01c43c15$e5c4db80$a101280a@.phx.gbl...
> What medium are you using to transfer the data and from
> what source.
> Do the field sizes of the to and from match ?
> J
>
im converting from access using DTS - this is the only field i've had
trouble with
the original field is a memo field which im trying to transfer into a sql
nvarchar field with 2000 chars - there is a lot of data in the original
source tho - and its not nice data!
cheers
mark
|||Try NTEXT as destination field instead of NVARCHAR one
"mark" <mark@.remove.com> wrote in message news:1Q4qc.90$LH3.0@.newsfe1-win...
> "Julie" <anonymous@.discussions.microsoft.com> wrote in message
> news:e07f01c43c15$e5c4db80$a101280a@.phx.gbl...
> im converting from access using DTS - this is the only field i've had
> trouble with
> the original field is a memo field which im trying to transfer into a sql
> nvarchar field with 2000 chars - there is a lot of data in the original
> source tho - and its not nice data!
|||Hello,
According to the Access help a memo field can store up to
65000 + character.
The nvarchar(2000) can store up to 1000 characters (look
up unicode in BOL). Try changing the SQL Server datatype
to a text or binary.
J

>--Original Message--
>"Julie" <anonymous@.discussions.microsoft.com> wrote in
message
>news:e07f01c43c15$e5c4db80$a101280a@.phx.gbl...
>im converting from access using DTS - this is the only
field i've had
>trouble with
>the original field is a memo field which im trying to
transfer into a sql
>nvarchar field with 2000 chars - there is a lot of data
in the original
>source tho - and its not nice data!
>cheers
>mark
>
>.
>
|||"Julie" <anonymous@.discussions.microsoft.com> wrote in message
news:e12301c43c1d$dbca1a70$a101280a@.phx.gbl...
> Hello,
> According to the Access help a memo field can store up to
> 65000 + character.
> The nvarchar(2000) can store up to 1000 characters (look
> up unicode in BOL). Try changing the SQL Server datatype
> to a text or binary.
> J
>
thanks everyone for the help, converting to ntext did the trick!
mark

problem importing access field into mssql

having a problem with one single field
its coming up with the error message "data for source column 2 ('general
notes') is too large for the specified buffer size"
how would i fix this ?
thanks
markWhat medium are you using to transfer the data and from
what source.
Do the field sizes of the to and from match ?
J
>--Original Message--
>having a problem with one single field
>its coming up with the error message "data for source
column 2 ('general
>notes') is too large for the specified buffer size"
>how would i fix this ?
>thanks
>mark
>
>.
>|||"Julie" <anonymous@.discussions.microsoft.com> wrote in message
news:e07f01c43c15$e5c4db80$a101280a@.phx.gbl...
> What medium are you using to transfer the data and from
> what source.
> Do the field sizes of the to and from match ?
> J
>
im converting from access using DTS - this is the only field i've had
trouble with
the original field is a memo field which im trying to transfer into a sql
nvarchar field with 2000 chars - there is a lot of data in the original
source tho - and its not nice data!
cheers
mark|||Try NTEXT as destination field instead of NVARCHAR one
"mark" <mark@.remove.com> wrote in message news:1Q4qc.90$LH3.0@.newsfe1-win...
> "Julie" <anonymous@.discussions.microsoft.com> wrote in message
> news:e07f01c43c15$e5c4db80$a101280a@.phx.gbl...
> > What medium are you using to transfer the data and from
> > what source.
> >
> > Do the field sizes of the to and from match ?
> >
> > J
> >
> im converting from access using DTS - this is the only field i've had
> trouble with
> the original field is a memo field which im trying to transfer into a sql
> nvarchar field with 2000 chars - there is a lot of data in the original
> source tho - and its not nice data!|||Hello,
According to the Access help a memo field can store up to
65000 + character.
The nvarchar(2000) can store up to 1000 characters (look
up unicode in BOL). Try changing the SQL Server datatype
to a text or binary.
J
>--Original Message--
>"Julie" <anonymous@.discussions.microsoft.com> wrote in
message
>news:e07f01c43c15$e5c4db80$a101280a@.phx.gbl...
>> What medium are you using to transfer the data and from
>> what source.
>> Do the field sizes of the to and from match ?
>> J
>im converting from access using DTS - this is the only
field i've had
>trouble with
>the original field is a memo field which im trying to
transfer into a sql
>nvarchar field with 2000 chars - there is a lot of data
in the original
>source tho - and its not nice data!
>cheers
>mark
>
>.
>|||"Julie" <anonymous@.discussions.microsoft.com> wrote in message
news:e12301c43c1d$dbca1a70$a101280a@.phx.gbl...
> Hello,
> According to the Access help a memo field can store up to
> 65000 + character.
> The nvarchar(2000) can store up to 1000 characters (look
> up unicode in BOL). Try changing the SQL Server datatype
> to a text or binary.
> J
>
thanks everyone for the help, converting to ntext did the trick!
marksql

problem importing access field into mssql

having a problem with one single field
its coming up with the error message "data for source column 2 ('general
notes') is too large for the specified buffer size"
how would i fix this ?
thanks
mark"Julie" <anonymous@.discussions.microsoft.com> wrote in message
news:e07f01c43c15$e5c4db80$a101280a@.phx.gbl...
> What medium are you using to transfer the data and from
> what source.
> Do the field sizes of the to and from match ?
> J
>
im converting from access using DTS - this is the only field i've had
trouble with
the original field is a memo field which im trying to transfer into a sql
nvarchar field with 2000 chars - there is a lot of data in the original
source tho - and its not nice data!
cheers
mark|||Try NTEXT as destination field instead of NVARCHAR one
"mark" <mark@.remove.com> wrote in message news:1Q4qc.90$LH3.0@.newsfe1-win...
> "Julie" <anonymous@.discussions.microsoft.com> wrote in message
> news:e07f01c43c15$e5c4db80$a101280a@.phx.gbl...
> im converting from access using DTS - this is the only field i've had
> trouble with
> the original field is a memo field which im trying to transfer into a sql
> nvarchar field with 2000 chars - there is a lot of data in the original
> source tho - and its not nice data!|||Hello,
According to the Access help a memo field can store up to
65000 + character.
The nvarchar(2000) can store up to 1000 characters (look
up unicode in BOL). Try changing the SQL Server datatype
to a text or binary.
J

>--Original Message--
>"Julie" <anonymous@.discussions.microsoft.com> wrote in
message
>news:e07f01c43c15$e5c4db80$a101280a@.phx.gbl...
>im converting from access using DTS - this is the only
field i've had
>trouble with
>the original field is a memo field which im trying to
transfer into a sql
>nvarchar field with 2000 chars - there is a lot of data
in the original
>source tho - and its not nice data!
>cheers
>mark
>
>.
>|||"Julie" <anonymous@.discussions.microsoft.com> wrote in message
news:e12301c43c1d$dbca1a70$a101280a@.phx.gbl...
> Hello,
> According to the Access help a memo field can store up to
> 65000 + character.
> The nvarchar(2000) can store up to 1000 characters (look
> up unicode in BOL). Try changing the SQL Server datatype
> to a text or binary.
> J
>
thanks everyone for the help, converting to ntext did the trick!
mark

Tuesday, March 20, 2012

Problem exporting data using Excel destination (wrong format)

Hi there,

I have designed a package that works perfectly well, exporting data to an excel file from an ole db source. The problem is that in the excel destination file, columns of data that originally were numbers, are formatted as text. It would be just annoying if it weren't because I use those figures in a pivot table that operates with them.

Any idea on how to tell Excel that those columns are numbers?

Thx in advance

What is the original data type in the OLE DB source of those columns? If they are strings you may need tu use the Data Conversion transformation. Does the excel file already exists? if so, what are the format of the columns?

I run a quick test loading 100 rows od AdventureWorks.Sales.SalesOrderDetail table into an Excel file and all the data types mapped fine. The only thing is that I used the Excel Destination in BIDS to create the file and the destination tab using the 'Name of the excel sheet' -->New... button; it generated an statement like:

CREATE TABLE `Excel Destination` (
`SalesOrderID` INTEGER,
`SalesOrderDetailID` INTEGER,
`CarrierTrackingNumber` NVARCHAR(25),
`OrderQty` SMALLINT,
`ProductID` INTEGER,
`SpecialOfferID` INTEGER,
`UnitPrice` MONEY,
`UnitPriceDiscount` MONEY,
`LineTotal` NUMERIC (38,6),
`rowguid` UNIQUEIDENTIFIER,
`ModifiedDate` DATETIME
)

I only had to adjust the Numeric data type precision and I worked just fine.

Rafael Salas

|||

Thx for your answer Rafael.

The numeric data from the ole db data source is in four-byte signed int [DT_I4]. I have a data conversion between the ole db data source and the excel destination and I've tried to both leave the numeric fields unchanged and "convert" them into the same type. Regarding the excel file, I use a template pre-formatted that i copy into a new file through a system file task in the control flow. I've tried several formatting in the columns (general, numeric, etc...) to no avail...

I've also tried in the excel destination to create the worksheets in which I export the data through that "new button" and with a command very similar to the one you posted, with type for the numeric columns as INTEGER. If it worked for you I'm really confused then :/, I was beginning to think it could be a bug in excel.

Thx again

|||

Loslor,

I just looked into the details of mi excel destination file and compared how the data types from BIDS got mapped. I found that all my DT_I4, DT_I2, DT_WSTR and Numeric in BDIS have 'general' when I looked into the format of the cells in the Excel file. I also used the data in the excel file to build a pivot table and worked fine. Are you getting the same behavior?

CREATE TABLE `Excel Destination` (
`SalesOrderID` INTEGER, --> mapped from an DT_I4 in the dataflow; loaded in excel as 'General' (when opening the execel file and look a the format of the cell)
`SalesOrderDetailID` INTEGER,

`CarrierTrackingNumber` NVARCHAR(25), --> mapped from an DT_WSTR in the dataflow; loaded in excel as 'General' (when opening the execel file and look a the format of the cell)
`OrderQty` SMALLINT, --> mapped from an DT_I2 in the dataflow; loaded in excel as 'General' (when opening the execel file and look a the format of the cell)
`ProductID` INTEGER,
`SpecialOfferID` INTEGER,
`UnitPrice` MONEY, --> mapped from an DT_CY in the dataflow; loaded in excel as 'Currency' (when opening the execel file and look a the format of the cell)
`UnitPriceDiscount` MONEY,
`LineTotal` NUMERIC (38,6), --> mapped from a Numeric in the dataflow; loaded in excel as 'General' (when opening the execel file and look a the format of the cell)
`rowguid` UNIQUEIDENTIFIER,--> mapped from an DT_DBTIMESTAMP in the dataflow; loaded in excel as 'Date' (when opening the execel file and look a the format of the cell)
`ModifiedDate` DATETIME
)

Rafael Salas

|||

Hi again,

Yes, my excell is doing the same. After exporting the data, all the cells have the format "General", though they are still treated as text. In fact, the numeric columns display a warning saying that "The number in the cell is formatted as text or preceded by apostrophe" (the last thing obviously being not true) and asks me if i want to reformat the cells, wich sounds a bit like a joke to me. The pivot table is still not getting right the data.

Thx Rafael

|||

Then it seems there is an issue in how excel treats the format 'general' in your side. As I told you I was able to generate the Pivot table regardless of the 'general' formating.

Sorry if I didnt hel you

Rafael Salas

|||

I'm beginning to fight in that front since I don't see any problem in the package.

Thx a lot for your time Rafael

Problem exporting data using Excel destination (wrong format)

Hi there,

I have designed a package that works perfectly well, exporting data to an excel file from an ole db source. The problem is that in the excel destination file, columns of data that originally were numbers, are formatted as text. It would be just annoying if it weren't because I use those figures in a pivot table that operates with them.

Any idea on how to tell Excel that those columns are numbers?

Thx in advance

What is the original data type in the OLE DB source of those columns? If they are strings you may need tu use the Data Conversion transformation. Does the excel file already exists? if so, what are the format of the columns?

I run a quick test loading 100 rows od AdventureWorks.Sales.SalesOrderDetail table into an Excel file and all the data types mapped fine. The only thing is that I used the Excel Destination in BIDS to create the file and the destination tab using the 'Name of the excel sheet' -->New... button; it generated an statement like:

CREATE TABLE `Excel Destination` (
`SalesOrderID` INTEGER,
`SalesOrderDetailID` INTEGER,
`CarrierTrackingNumber` NVARCHAR(25),
`OrderQty` SMALLINT,
`ProductID` INTEGER,
`SpecialOfferID` INTEGER,
`UnitPrice` MONEY,
`UnitPriceDiscount` MONEY,
`LineTotal` NUMERIC (38,6),
`rowguid` UNIQUEIDENTIFIER,
`ModifiedDate` DATETIME
)

I only had to adjust the Numeric data type precision and I worked just fine.

Rafael Salas

|||

Thx for your answer Rafael.

The numeric data from the ole db data source is in four-byte signed int [DT_I4]. I have a data conversion between the ole db data source and the excel destination and I've tried to both leave the numeric fields unchanged and "convert" them into the same type. Regarding the excel file, I use a template pre-formatted that i copy into a new file through a system file task in the control flow. I've tried several formatting in the columns (general, numeric, etc...) to no avail...

I've also tried in the excel destination to create the worksheets in which I export the data through that "new button" and with a command very similar to the one you posted, with type for the numeric columns as INTEGER. If it worked for you I'm really confused then :/, I was beginning to think it could be a bug in excel.

Thx again

|||

Loslor,

I just looked into the details of mi excel destination file and compared how the data types from BIDS got mapped. I found that all my DT_I4, DT_I2, DT_WSTR and Numeric in BDIS have 'general' when I looked into the format of the cells in the Excel file. I also used the data in the excel file to build a pivot table and worked fine. Are you getting the same behavior?

CREATE TABLE `Excel Destination` (
`SalesOrderID` INTEGER, --> mapped from an DT_I4 in the dataflow; loaded in excel as 'General' (when opening the execel file and look a the format of the cell)
`SalesOrderDetailID` INTEGER,

`CarrierTrackingNumber` NVARCHAR(25), --> mapped from an DT_WSTR in the dataflow; loaded in excel as 'General' (when opening the execel file and look a the format of the cell)
`OrderQty` SMALLINT, --> mapped from an DT_I2 in the dataflow; loaded in excel as 'General' (when opening the execel file and look a the format of the cell)
`ProductID` INTEGER,
`SpecialOfferID` INTEGER,
`UnitPrice` MONEY, --> mapped from an DT_CY in the dataflow; loaded in excel as 'Currency' (when opening the execel file and look a the format of the cell)
`UnitPriceDiscount` MONEY,
`LineTotal` NUMERIC (38,6), --> mapped from a Numeric in the dataflow; loaded in excel as 'General' (when opening the execel file and look a the format of the cell)
`rowguid` UNIQUEIDENTIFIER,--> mapped from an DT_DBTIMESTAMP in the dataflow; loaded in excel as 'Date' (when opening the execel file and look a the format of the cell)
`ModifiedDate` DATETIME
)

Rafael Salas

|||

Hi again,

Yes, my excell is doing the same. After exporting the data, all the cells have the format "General", though they are still treated as text. In fact, the numeric columns display a warning saying that "The number in the cell is formatted as text or preceded by apostrophe" (the last thing obviously being not true) and asks me if i want to reformat the cells, wich sounds a bit like a joke to me. The pivot table is still not getting right the data.

Thx Rafael

|||

Then it seems there is an issue in how excel treats the format 'general' in your side. As I told you I was able to generate the Pivot table regardless of the 'general' formating.

Sorry if I didnt hel you

Rafael Salas

|||

I'm beginning to fight in that front since I don't see any problem in the package.

Thx a lot for your time Rafael

|||

I'm having the same problem using Excel 2003 in SSIS 2005 and wonder if you discovered the solution. I'd appreciate any tips you may have. Thanks.

Dan

Monday, March 12, 2012

Problem during the process database

This is the error when i execute the code for the association algorithem. "Errors in the high-level relational engine. The data source view does not contain a definition for the 'receiptid' column in the 'receiptdesc' table or view.".

Dim ds As New RelationalDataSource("miningas", "miningas")

ds.ConnectionString = "Provider=SQLNCLI;Data Source=localhost;" & _

"Initial Catalog=miningas;Integrated Security=SSPI"

db.DataSources.Add(ds)

' Create connection to datasource to extract schema to dataset

Dim dset As New DataSet()

Dim cn As New SqlConnection("Data Source=localhost;" & _

"Initial Catalog=supermarket;Integrated Security=True")

' Create the receiptdesc data adapter

Dim daProduct As New SqlDataAdapter("SELECT * FROM dbo.receipt", cn)

daProduct.FillSchema(dset, SchemaType.Mapped, "receipt")

' Create the receipt data adapter

Dim dareceipt As New SqlDataAdapter("Select * from dbo.receiptdesc", cn)

dareceipt.FillSchema(dset, SchemaType.Mapped, "receiptdesc")

Dim drreceipt_desc As New DataRelation("Newreceipt_desc", _

dset.Tables("receipt").Columns("receiptid"), _

dset.Tables("receiptdesc").Columns("receiptid"))

dset.Relations.Add(drreceipt_desc)

' Create the dsv, add the dataset, and add to the database

Dim dsv As New DataSourceView("miningas", "miningas")

dsv.DataSourceID = "miningas"

dsv.Schema = dset.Clone()

db.DataSourceViews.Add(dsv)

' Update the database to create the objects on the server.

db.Update(UpdateOptions.ExpandFull)

End Sub

It seems like your column is not there after you create dsv. Can you double check? Otherwise, I have the sample code below to create dsv. Please check the difference.

RelationalDataSourceView dsv = new RelationalDataSourceView("SampleDSV", "SampleDSV");

OleDbConnection connection = new OleDbConnection("Provider=SQLOLEDB.1;Initial Catalog=Northwind;Data Source=localhost;Integrated Security=SSPI;Persist Security Info=False");

try

{

connection.Open();

//********** Fill Customers table in schema ************

OleDbDataAdapter adapter1 = new OleDbDataAdapter ("Select * from [dbo].[Customers] where 1=0", connection);

DataTable[] dataTables = adapter1.FillSchema(dsv.Schema, SchemaType.Mapped, "Customers");

if (dataTables.Length > 0)

{

DataTable dataTable = dataTables[0];

dataTable.ExtendedProperties.Add( “TableType”, “Table”);

dataTable.ExtendedProperties.Add( “DbSchemaName”, "dbo");

dataTable.ExtendedProperties.Add( “DbTableName”, "Customers");

dataTable.ExtendedProperties.Add( “FriendlyName”, "Customers");

}

//********** Fill Orders table in schema ****************

OleDbDataAdapter adapter2 = new OleDbDataAdapter ("Select * from [dbo].[Orders] where 1=0", connection);

dataTables = adapter2.FillSchema(dsv.Schema, SchemaType.Mapped, "Orders");

if (dataTables.Length > 0)

{

DataTable dataTable = dataTables[0];

dataTable.ExtendedProperties.Add( “TableType”, “Table”);

dataTable.ExtendedProperties.Add( “DbSchemaName”, "dbo");

dataTable.ExtendedProperties.Add( “DbTableName”, "Orders");

dataTable.ExtendedProperties.Add( “FriendlyName”, "Orders");

}

//********** Create relationship ****************

DataColumn parentColumn = dsv.Schema.Tables["Customers"].Columns["CustomerID"];

DataColumn childColumn = dsv.Schema.Tables["Orders"].Columns["CustomerID"];

dsv.Schema.Relations.Add("FK_Orders_Customers", parentColumn, childColumn, true);

}

finally

{

connection.Close();

}

|||Sorry, but the code i still cannot solve the problem. Can u able to give more support on this section. I very urgent need it. Thx|||

Couple things I notice in your code. the connection string in datasource is different from the connection string you get schema. Also, you don't need to clone the dataset before setting to the dsv.schema. You can just set it directly.

I used your code on new AS database and I have no problem. However, I used same connection string (at least same initial catalog). I am not sure if that makes difference.

BTW, it is better to use my code because you do need to set some extended properties.

Problem during the process database

This is the error when i execute the code for the association algorithem. "Errors in the high-level relational engine. The data source view does not contain a definition for the 'receiptid' column in the 'receiptdesc' table or view.".

Dim ds As New RelationalDataSource("miningas", "miningas")

ds.ConnectionString = "Provider=SQLNCLI;Data Source=localhost;" & _

"Initial Catalog=miningas;Integrated Security=SSPI"

db.DataSources.Add(ds)

' Create connection to datasource to extract schema to dataset

Dim dset As New DataSet()

Dim cn As New SqlConnection("Data Source=localhost;" & _

"Initial Catalog=supermarket;Integrated Security=True")

' Create the receiptdesc data adapter

Dim daProduct As New SqlDataAdapter("SELECT * FROM dbo.receipt", cn)

daProduct.FillSchema(dset, SchemaType.Mapped, "receipt")

' Create the receipt data adapter

Dim dareceipt As New SqlDataAdapter("Select * from dbo.receiptdesc", cn)

dareceipt.FillSchema(dset, SchemaType.Mapped, "receiptdesc")

Dim drreceipt_desc As New DataRelation("Newreceipt_desc", _

dset.Tables("receipt").Columns("receiptid"), _

dset.Tables("receiptdesc").Columns("receiptid"))

dset.Relations.Add(drreceipt_desc)

' Create the dsv, add the dataset, and add to the database

Dim dsv As New DataSourceView("miningas", "miningas")

dsv.DataSourceID = "miningas"

dsv.Schema = dset.Clone()

db.DataSourceViews.Add(dsv)

' Update the database to create the objects on the server.

db.Update(UpdateOptions.ExpandFull)

End Sub

It seems like your column is not there after you create dsv. Can you double check? Otherwise, I have the sample code below to create dsv. Please check the difference.

RelationalDataSourceView dsv = new RelationalDataSourceView("SampleDSV", "SampleDSV");

OleDbConnection connection = new OleDbConnection("Provider=SQLOLEDB.1;Initial Catalog=Northwind;Data Source=localhost;Integrated Security=SSPI;Persist Security Info=False");

try

{

connection.Open();

//********** Fill Customers table in schema ************

OleDbDataAdapter adapter1 = new OleDbDataAdapter ("Select * from [dbo].[Customers] where 1=0", connection);

DataTable[] dataTables = adapter1.FillSchema(dsv.Schema, SchemaType.Mapped, "Customers");

if (dataTables.Length > 0)

{

DataTable dataTable = dataTables[0];

dataTable.ExtendedProperties.Add( “TableType”, “Table”);

dataTable.ExtendedProperties.Add( “DbSchemaName”, "dbo");

dataTable.ExtendedProperties.Add( “DbTableName”, "Customers");

dataTable.ExtendedProperties.Add( “FriendlyName”, "Customers");

}

//********** Fill Orders table in schema ****************

OleDbDataAdapter adapter2 = new OleDbDataAdapter ("Select * from [dbo].[Orders] where 1=0", connection);

dataTables = adapter2.FillSchema(dsv.Schema, SchemaType.Mapped, "Orders");

if (dataTables.Length > 0)

{

DataTable dataTable = dataTables[0];

dataTable.ExtendedProperties.Add( “TableType”, “Table”);

dataTable.ExtendedProperties.Add( “DbSchemaName”, "dbo");

dataTable.ExtendedProperties.Add( “DbTableName”, "Orders");

dataTable.ExtendedProperties.Add( “FriendlyName”, "Orders");

}

//********** Create relationship ****************

DataColumn parentColumn = dsv.Schema.Tables["Customers"].Columns["CustomerID"];

DataColumn childColumn = dsv.Schema.Tables["Orders"].Columns["CustomerID"];

dsv.Schema.Relations.Add("FK_Orders_Customers", parentColumn, childColumn, true);

}

finally

{

connection.Close();

}

|||Sorry, but the code i still cannot solve the problem. Can u able to give more support on this section. I very urgent need it. Thx|||

Couple things I notice in your code. the connection string in datasource is different from the connection string you get schema. Also, you don't need to clone the dataset before setting to the dsv.schema. You can just set it directly.

I used your code on new AS database and I have no problem. However, I used same connection string (at least same initial catalog). I am not sure if that makes difference.

BTW, it is better to use my code because you do need to set some extended properties.

Problem deploying site developed with Sql Ex. To server running Sql Server 2005.

Can someone show me, or direct me, to a source,that shows me how, and what to change,when deploying a website from a development server running Sql Ex to a production server running Sql server 2005.I can’t get the sites to run under Sql server 2005.

They work in Sql Ex. what must I change?The connection string, to what format?and what else?I attached the dB to Sql 2005 and browsed the content in the Sql manager.But can’t get the aspx pages to work on the server.

Help please

What is the error code you get from your ASP application?

When connecting to SQL Express, you normally specify server as <servername>\sqlexpress. When you switch to sqlserver 2005, depending on it instance name, you need to change your connection string if you hard-code the connection string in your ASP app. For default instance, you can use <servername>, for named instance, you can use <servername>\<instancename>.

If you can't resolve your issue, please post your connection string, error message from ASP application and server connectivity configuration, such as whether it is name instance or default instance, whether you have TCP up or browser up and etc.

|||

Thanks Nan Tu for the assistance

This is the connection string error i get:

Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.

But i have setup the virtual drive as a app in the root.

This is theconnection string:

<connectionStrings>

<add name="ConnectionStringGetSomeThing" connectionString="Data Source=localhost;initial catalog =getsomething.mdf;Integrated Security=True" providerName="System.Data.SqlClient"/>

</connectionStrings>

also TCP and browser are enabled

|||The errormsg is not from connectivity driver, you probably need to ask either in ASP or IIS forums.

Friday, March 9, 2012

Problem deploying site developed with Sql Ex. To server running Sql Server 2005.

Can someone show me, or direct me, to a source, that shows me how, and what to change, when deploying a website from a development server running Sql Ex to a production server running Sql server 2005. I can't get the sites to run under Sql server 2005.

They work in Sql Ex. what must I change? The connection string, to what format? and what else? I attached the dB to Sql 2005 and browsed the content in the Sql manager. But can't get the aspx pages to work on the server.

Help please

The connection string format of SQL 2005 should be the same as SQL Ex, only the change should be the data source name and user/password. What the error you got after change to SQL2005?|||

It's configured properly as a application, And it is in the root of the application

Parser Error Message:It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.

|||Your new error message seems to be an IIS issue, we'd better get help from IIS expert.|||As far as I know, the exception is thrown when an element that is only allowed in the application root is set in a web.config file that is in a subfolder. Please check.|||

We have the files in the root and we believe its some connection issue because of all the test we've run. This is a more detailed explanation of what me and my partner have been working on.

Any help would be very very much appreciated as I am about 15 hours into this :(

Background is a development system with ASP.NET 2.0 and SQL express 2005. The server is SQL 2005 standard edition. Any ASPX pages that connect to a database results in errors.

I have 2 identical servers with Windows server 2003, one has SQL Express and the other has SQL Server 2005 standard. that is the only difference between these systems. The scripts that work seamlessly when uploaded to the SQL Express server dont work on the SQL Server 2005

My connection string is

<remove name="LocalSqlServer" />
<add name="LocalSqlServer" connectionString="Datasource=servername;Integrated Security=SSPI;initial catalog=C:\INETPUB\WWWROOT\test\app_data\aspnet.MDF;"
providerName="System.Data.SqlClient" />

two interesting tidbits

1.) No matter what the initial catalog is pointing to, I get the same error. EVEN if the database doesnt exist

Cannot open database "C:\INETPUB\WWWROOT\test\app_data\aspnwet.MDF" requested by the login. The login failed.
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.

2.) second interesting thing is this, if I change the datasource to "MSSQLSERVER" which is the instance name of SQL 2005. the error changes to

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

I have reinstalled SQL server 2005

I have verified that under SQL Server 2005 Surface Area Configuration that remote connections has Both TCP and Named Pipes enabled

I have verified that under the Network Configuration that the protocols for TCP/IP and Named pipes are enabled.

I have tried atleast 20 different variations of Connectionstrings

I have ran aspnet_regsql against the database

I have verified that the SQL Server Browser is started

I have verified that the TCP/IP is set in Network Configuration to default port 1433

I have gave all authentication rights to Network Service and ASPNET accounts for testing against both the MASTER and ASPNET databases using Management Studio and attaching the Database

I have created a custom SQL account with access to the database in question and added the username password syntax to the connectionstring and get the same login failed message.

If anyone can give any insight that would be MUCH appreciated!! thanks in advance.

|||

You are using SQL 2005 Express default connection for ASPNETDB.MDF which is sitting in App_Data folder within your application. It will not work when you switch to sql 2005 standard because you don't have the SQL 2005 Express version anymore.

This is not for you to use under SQL Server 2005 or 2000.

<remove name="LocalSqlServer" />
<add name="LocalSqlServer" connectionString="Datasource=servername;Integrated Security=SSPI;initial catalog=C:\INETPUB\WWWROOT\test\app_data\aspnet.MDF;"
providerName="System.Data.SqlClient" />

You need a new customized connection to point to this database ASPNETDB.MDFor (all tables from this one). Useaspnet_regsql.exe to generate this database in your target database.

I assume you may combine this one with your database.

After the database is ready, create a connection in your web.config file. Importantly, you need to add customized role and membership provider to point back to your database.

I'll copy some code at the end that works.

<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">

<connectionStrings>

<add name="yourDB" connectionString="Data Source=yourDBServer;Integrated Security=false;Initial Catalog=YourDBwithASPNETDB.MDF;User ID=yourUser;Password=yourUserPwd" providerName="System.Data.SqlClient" />
</connectionStrings



<system.web>

<roleManager enabled="true"
defaultProvider="CustomizedRoleProvider">
<providers>
<add name="CustomizedRoleProvider"
type="System.Web.Security.SqlRoleProvider"
connectionStringName="yourDB" />
</providers>
</roleManager>

<membership defaultProvider="CustomizedMembershipProvider">
<providers>
<add name="CustomizedMembershipProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="yourDB"
applicationName="/"
/>
</providers>
</membership>

</system.web>

</configuration>

Please try this.

Let me know if this works or new issues come out.

Have a good sleep and we will be there.

Saturday, February 25, 2012

Problem copying DTS jobs with Database Copy Wizard

I am using the Database Copy Wizard to copy a database from one server
to the other. Here is the server information:
Source Server: Windows 2000 Server SP4, SQL Server 2000 SP4
Destination Server: Windows 2003 Enterprise Edition SP1, SQL Server
2000 SP4
I initiate the DCW from the Source server and use the sa account to
authenticate on both servers. I need to copy all logins, jobs, etc..
so I check the appropriate boxes for this. The copy completes
successfully.
When I log onto the destination server, the database is there, logins
are there, but I don't see anything under Data Transformation Services
- Local Packages.
Do I need to turn something on/off because of the different operating
systems? I have done this successfully several times before - the
only difference this time is the OS.
Thank you!
KarriBI dont know Exactly What u mena when you said you have copied DTS with
Database copy wizard.
Database Copy Wizard is Implemented as a DTS by Microsoft.
you can only Copy Databases or Logins/SP or Jobs etc but not DTS
Packages.
When we RUn this Wizard, it can be Run Immideatly or Scheduled for
later RUN. (option in the Last Screens of the Wizard)
If you mean you want to save this DTS, you cna do So by specifying so
on the last screens.
Maninder
MCDBA
On Jan 30, 1:00 pm, zell...@.avaya.com wrote:
> I am using the Database Copy Wizard to copy a database from one server
> to the other. Here is the server information:
> Source Server: Windows 2000 Server SP4, SQL Server 2000 SP4
> Destination Server: Windows 2003 Enterprise Edition SP1, SQL Server
> 2000 SP4
> I initiate the DCW from the Source server and use the sa account to
> authenticate on both servers. I need to copy all logins, jobs, etc..
> so I check the appropriate boxes for this. The copy completes
> successfully.
> When I log onto the destination server, the database is there, logins
> are there, but I don't see anything under Data Transformation Services
> - Local Packages.
> Do I need to turn something on/off because of the different operating
> systems? I have done this successfully several times before - the
> only difference this time is the OS.
> Thank you!
> KarriB

problem copying database to new server!

I am trying to copy a
dbase from one server to another so first created a backup file from source
server,then copied it to destination server. Then created an empty dbase
with same
name on destination server, then selected backup and created a backup file
dbase.bak. I then replaced the backup
file on the destination server with the one from the source server and tried
to restore
from that file. I get the following error, can not find file id 3 on device
c:\program files\...Backup\dbase.bak
thanks.
--
Paul G
Software engineer.Your problem is that the original file destination of the database is
stored in the backup file. SO it can be that the stored destination
folder isn=B4t present in your restore system. With specifying a new
restore destination while issueing the command (via GUI or via TSQL
[RESTORE DATABASE]) that should do the trick.
HTH, Jens Suessmeyer.|||Hi thanks for the response. I tried RESTORE database 'name' from disk
='c:\filebak' from sql analyzer simular to what you suggested and it worked.
--
Paul G
Software engineer.
"Jens" wrote:
> Your problem is that the original file destination of the database is
> stored in the backup file. SO it can be that the stored destination
> folder isn´t present in your restore system. With specifying a new
> restore destination while issueing the command (via GUI or via TSQL
> [RESTORE DATABASE]) that should do the trick.
> HTH, Jens Suessmeyer.
>