Re: problem with query moving data from 1 dbase to another.

From: Paul (Paul_at_discussions.microsoft.com)
Date: 11/03/04


Date: Wed, 3 Nov 2004 07:43:11 -0800

Thanks will give this a try. Being a C programmer was thinking of using a
cast but did not know how to impliment this with SQL

"Tibor Karaszi" wrote:

> If I understand the problem connect, try:
>
> INSERT INTO [dbase1].dbo.Table1 [Data_Item_Log_ID]
> Select CAST([Data_Item_Log_ID] AS int) from
> [dbase2].dbo.dataitemlog
>
>
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
>
> "Paul" <Paul@discussions.microsoft.com> wrote in message
> news:8C6EFEC1-7B3F-48AB-B0BF-82694B3D7596@microsoft.com...
> > I have a large dbase table and am moving the data from 1 table to another.
> > The problem is that I had to change the datatypes in the destination table so
> > am getting the failure
> > Syntax error converting the nvarchar to int.
> >
> > INSERT INTO [dbase1].dbo.Table1 [Data_Item_Log_ID]
> > Select [Data_Item_Log_ID] from
> > [dbase2].dbo.dataitemlog
> > Data_Item_Log_ID (destination field) is type integer and the source field
> > (from another dbase on the same server) is type nvarchar 4. I have several
> > columns like this and the table has approximately 20k records.
> > The origin of the source database was a MySQL dbase which I moved to SQL2000
> > using a driver and access. Thanks.
> > --
> > Paul G
> > Software engineer.
>
>
>



Relevant Pages

  • Re: CAST conversion error: Syntax Error missing operator
    ... AFAIK, neither Access, VBA or Jet SQL will recognize CAST, ... I have to do a series of updates to said data ... "import" table I work with to manipulate the data before inserting. ...
    (microsoft.public.access.formscoding)
  • Re: Date time stamp shows different
    ... I think you will need to cast it to a double and do date/time calculations ... of a second so the milliseconds get stripped out out of the conversion, ... When I run an SQL ... > //Get the reverse date time stamp so that we can use it for later. ...
    (microsoft.public.vc.database)
  • Re: Invalid CastException with SqlDBType
    ... Add(string*, SqlDbType, int, string**) ... The DateTime.Now is trying to cast into a int. ... not in Sql set up the column as identity and let it seed itself. ... > update a MS SQL Database with a stored procedure. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: CAST Command
    ... SQL Server MVP ... Will this sql view works and cast the ... > field on the form that is in decimal format. ... Can I nest the Cast command? ...
    (comp.databases.ms-sqlserver)
  • Re: Text field that is a date
    ... passing the SQL thru to the datasource and specifying the return type there. ... You're foxpro app will have to match the datatype returned by the DBMS. ... As long as your code only runs against the SQL server ... database it should be ok to use the CAST or Convert. ...
    (microsoft.public.vb.database.ado)