concatenate int with varchar arg in Values clause?

concatenate int with varchar arg in Values clause?

Post by Rich » Wed, 03 Mar 2004 03:15:45



Hello,

I need to generate some test data and want to run the
following loop:

CREATE TABLE [dbo].[tblTest1] (
[fld1] [int] NULL ,
[fld2] [nvarchar] (50),
[fld3] [nvarchar] (50)
)
GO




Begin
insert into tbltest1(fld1, fld2, fld3)


End

But I get an error about fld3 being converted from a

do this?

Thanks,
Rich

 
 
 

concatenate int with varchar arg in Values clause?

Post by Alejandro Mes » Wed, 03 Mar 2004 03:19:01


Try,

...

...

AMB

 
 
 

concatenate int with varchar arg in Values clause?

Post by Rich » Wed, 03 Mar 2004 03:53:17


Thanks.  That worked perfectly.  
>-----Original Message-----
>Try,

>....

>....

>AMB

>.

 
 
 

concatenate int with varchar arg in Values clause?

Post by Louis Davidso » Wed, 03 Mar 2004 11:17:45


I wouldn't use rtrim to do this, since technically rtrim operates on
character data.  Using cast would be better:


--
----------------------------------------------------------------------------
-----------

Compass Technology Management

Pro SQL Server 2000 Database Design
http://www.apress.com/book/bookDisplay.html?bID=266

Note: Please reply to the newsgroups only unless you are
interested in consulting services.  All other replies will be ignored :)


> Thanks.  That worked perfectly.

> >-----Original Message-----
> >Try,

> >....

> >....

> >AMB

> >.