Showing posts with label objects. Show all posts
Showing posts with label objects. Show all posts

Monday, March 26, 2012

Importing Sql 6.5 data

I am trying to move my data from Sql Server 65 on Windows NT 4 to my Sql
Server 7.0 on W2K and can only seem to move the tables, but not the
objects (such as stored procedures) using DTS.
Is there a way to easily move/transform the whole database from 65 to 7?
Thanks,
Tom.Only DTS type which includes other stuff than tables is the Object Transfer. And that is not
available when you go from 6.5 (as I remember). You can scrip the stuff to move proc's etc over, or
use the Upgrade Wizard which comes with SQL7.
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"Thomas Scheiderich" <tfs@.deltanet.com> wrote in message news:3FC3F4AB.9050601@.deltanet.com...
> I am trying to move my data from Sql Server 65 on Windows NT 4 to my Sql
> Server 7.0 on W2K and can only seem to move the tables, but not the
> objects (such as stored procedures) using DTS.
> Is there a way to easily move/transform the whole database from 65 to 7?
> Thanks,
> Tom.
>|||Tibor Karaszi wrote:
> Only DTS type which includes other stuff than tables is the Object Transfer. And that is not
> available when you go from 6.5 (as I remember). You can scrip the stuff to move proc's etc over, or
> use the Upgrade Wizard which comes with SQL7.
>
Where would I find the Upgrage wizard?
Thanks,
Tom.
"Thomas Scheiderich" <tfs@.deltanet.com> wrote in message
news:3FC3F4AB.9050601@.deltanet.com...
> I am trying to move my data from Sql Server 65 on Windows NT 4 to my Sql
> Server 7.0 on W2K and can only seem to move the tables, but not the
> objects (such as stored procedures) using DTS.
>
> Is there a way to easily move/transform the whole database from 65 to 7?
>
> Thanks,
>
> Tom.|||On the SQL Server 2000 machine, the program group is called "Microsoft SQL Server - Switch".
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"Thomas Scheiderich" <tfs@.deltanet.com> wrote in message news:3FC45F9D.5030901@.deltanet.com...
>
> Tibor Karaszi wrote:
> > Only DTS type which includes other stuff than tables is the Object Transfer. And that is not
> > available when you go from 6.5 (as I remember). You can scrip the stuff to move proc's etc over,
or
> > use the Upgrade Wizard which comes with SQL7.
> >
> >
>
> Where would I find the Upgrage wizard?
> Thanks,
> Tom.
>
> "Thomas Scheiderich" <tfs@.deltanet.com> wrote in message
> news:3FC3F4AB.9050601@.deltanet.com...
> > I am trying to move my data from Sql Server 65 on Windows NT 4 to my Sql
> > Server 7.0 on W2K and can only seem to move the tables, but not the
> > objects (such as stored procedures) using DTS.
> >
> > Is there a way to easily move/transform the whole database from 65 to 7?
> >
> > Thanks,
> >
> > Tom.
>sql

Monday, March 19, 2012

Importing Error

Hi all,

From SQL Server 2000 Import wizard, if we use Copy Objects & data between SQL Server Databases it'll copies table with primary key. Similar to this what is the alternative method in SQL Server 2005.

Please suggest me to solve the problem

Thanks in advance
Karna

You still have the Import/Export wizard in SQL Server 2005 but you would need to have SQL Server Management Studio not the express version.

Right click on a database and choose tasks-> export data

which then lets you copy tables.

I hope that is what you are looking for.

|||Hi,

Thanks for reply,

As u said it is similar to Import/Export wizard that we found in SQL server 2005 Management studio, here in this example it does the export of table to the destination database but primary key will not be attached. Is it SSIS is helpful for this purpose.

My problem is when I export table to different database it should export all attributes of table which includes Primary Key (as similar to copy objects & data between SQL Server Databases in SQL Server 2000).

Please suggest me to solve my problem

Thanks in advance
Karna|||

Have you looked at the Copy Objects task available in the SSIS designer?

Thanks.

|||Hi,

Thanks for the reply.

It is same as I briefed in earlier mail.
My problem is when I import table from one database to another it has to import data with primary key constraints.

Thanks in advance
Karna

Importing Error

Hi all,

From SQL Server 2000 Import wizard, if we use Copy Objects & data between SQL Server Databases it'll copies table with primary key. Similar to this what is the alternative method in SQL Server 2005.

Please suggest me to solve the problem

Thanks in advance
Karna

You still have the Import/Export wizard in SQL Server 2005 but you would need to have SQL Server Management Studio not the express version.

Right click on a database and choose tasks-> export data

which then lets you copy tables.

I hope that is what you are looking for.

|||Hi,

Thanks for reply,

As u said it is similar to Import/Export wizard that we found in SQL server 2005 Management studio, here in this example it does the export of table to the destination database but primary key will not be attached. Is it SSIS is helpful for this purpose.

My problem is when I export table to different database it should export all attributes of table which includes Primary Key (as similar to copy objects & data between SQL Server Databases in SQL Server 2000).

Please suggest me to solve my problem

Thanks in advance
Karna|||

Have you looked at the Copy Objects task available in the SSIS designer?

Thanks.

|||Hi,

Thanks for the reply.

It is same as I briefed in earlier mail.
My problem is when I import table from one database to another it has to import data with primary key constraints.

Thanks in advance
Karna

Friday, February 24, 2012

Importing CSV files with SqlBulkCopy

I am trying to import a CSV file into an SQL Server table with the OleDbDataReader and SqlBulkCopy objects, like this:

using (OleDbConnection dconn =new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\mystuff\\;Extended Properties=\"text;HDR=No;FMT=Delimited\"")){using (OleDbCommand dcmd =new OleDbCommand("select * from mytable.csv", dconn)){try{dconn.Open();using (OleDbDataReader dreader = dcmd.ExecuteReader()){try{using (SqlConnection dconn2 =new SqlConnection(@."data source=MyDBServer;initial catalog=MyDB;user id=mydbid;password=mydbpwd")){using (SqlBulkCopy bc =new SqlBulkCopy(dconn2)){try{dconn2.Open();bc.DestinationTableName ="dbo.mytable";bc.WriteToServer(dreader);}finally{dconn2.Close();}}}}finally{dreader.Close();}}}finally{dconn.Close();}}}

A couple of the columns for the destination table use abitdatatype. The CSV files uses the strings "1" and "0" to represent these.

When I run this code, it throws this exception:

Unhandled Exception: System.InvalidOperationException: The given value of type S
tring from the data source cannot be converted to type bit of the specified targ
et column. --> System.FormatException: Failed to convert parameter value from a
String to a Boolean. --> System.FormatException: String was not recognized as
a valid Boolean.
at System.Boolean.Parse(String value)
at System.String.System.IConvertible.ToBoolean(IFormatProvider provider)
at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvid
er provider)
at System.Data.SqlClient.SqlParameter.CoerceValue(Object value, MetaType dest
inationType)
-- End of inner exception stack trace --
at System.Data.SqlClient.SqlParameter.CoerceValue(Object value, MetaType dest
inationType)
at System.Data.SqlClient.SqlBulkCopy.ConvertValue(Object value, _SqlMetaData
metadata)
-- End of inner exception stack trace --
at System.Data.SqlClient.SqlBulkCopy.ConvertValue(Object value, _SqlMetaData
metadata)
at System.Data.SqlClient.SqlBulkCopy.WriteToServerInternal()
at System.Data.SqlClient.SqlBulkCopy.WriteRowSourceToServer(Int32 columnCount
)
at System.Data.SqlClient.SqlBulkCopy.WriteToServer(IDataReader reader)
at MyClass.Main()

It appears not to accept "1" and "0" as valid strings to convert to booleans. The System.Convert.ToBoolean method appears to work the same way.

Is there any way to change this behavior? I discovered if you change the "1" to "true" and "0" to "false" in the CSV file it will accept them.

Hello my friend,

I believe this is due to the way that Microsoft Access uses numbers to represent bits. I think 0 is Yes and -1 is No. Try it with 0 and -1 instead of 1 and 0.

Kind regards

Scotty

|||I created a schema.ini file for the table and specified bit columns for it. Then it converted without any problems.

Sunday, February 19, 2012

importing a pdf file

I have a business objects report that I would like to set up in reporting
services. I'm wondering if there is a way to import or display a link to a
.pdf file in reporting services.
Any ideas?
ThanksThere's no way to "import" PDFs, but you can include hyperlinks to external
PDF documents in Reporting Services' reports.
Best,
-Chris
SQL Server Reporting Services
"beeyule" <beeyule@.discussions.microsoft.com> wrote in message
news:82D55264-C23D-41D5-A809-4A838C334518@.microsoft.com...
>I have a business objects report that I would like to set up in reporting
> services. I'm wondering if there is a way to import or display a link to
> a
> .pdf file in reporting services.
> Any ideas?
> Thanks