The below one worked for me.
"Arnie Rowland" <arnie@1568.com> wrote in message
news:eYY3d458GHA.5092@TK2MSFTNGP04.phx.gbl...
> ;-)
>
> --
> Arnie Rowland, Ph.D.
> Westwood Consulting, Inc
>
> Most good judgment comes from experience.
> Most experience comes from bad judgment.
> - Anonymous
>
>
> "Warren Brunk" <wbrunk@techintsolutions.com> wrote in message
> news:%23wqGR258GHA.3384@TK2MSFTNGP05.phx.gbl...
>> What you need is an insert with select then...
>>
>> Insert Into ProductInfo(ProgramName)
>> Select ProgramName From
>> Product Info where Cat_ID = 21
>>
>>
>> thanks,
>> --
>> /*
>> Warren Brunk - MCITP - SQL 2005, MCDBA
>>
www.techintsolutions.com >> Tech Blog -
www.technologyis.com >> */
>>
>>
>> "venkat" <venk,kol@yahoo.com> wrote in message
>> news:ecJdYM48GHA.4964@TK2MSFTNGP02.phx.gbl...
>>> Thanks for the feedback.,
>>> But my idea is to generate the sql queries in query analyzer.
>>> Basically i need to create multiple insert queries like
>>> "Insert into productinfo (programname) values ('test1')"
>>> "Insert into productinfo (programname) values ('test2')"
>>>
>>> using the below query:
>>> select "Insert into productinfo (programname) values ('" + productname
>>> from productinfo where cat_id=21 + "')" -- Cat_id with 21 will
>>> return multiple productnames
>>>
>>> But i am getting an error near the "')", coz cat_id is an integer and
>>> proceeds by a closed paranthesis.
>>>
>>> Can it be acheived in query analyzer rather than writing a stored proc
>>> and executing it.
>>>
>>> Thanks
>>> Ganesh
>>>
>>> "Warren Brunk" <wbrunk@techintsolutions.com> wrote in message
>>> news:e2Q$Plw8GHA.4964@TK2MSFTNGP02.phx.gbl...
>>>> You could use a select into statement...
>>>>
>>>> select * into productinfo
>>>> From ProductInfo
>>>> Where Product_ID = 21
>>>>
>>>> thanks,
>>>>
>>>> --
>>>> /*
>>>> Warren Brunk - MCITP - SQL 2005, MCDBA
>>>>
www.techintsolutions.com >>>> Tech Blog -
www.technologyis.com >>>> */
>>>>
>>>>
>>>> "venkat" <venk,kol@yahoo.com> wrote in message
>>>> news:u1CYHov8GHA.4708@TK2MSFTNGP05.phx.gbl...
>>>>> Hi,
>>>>>
>>>>> I am trying to migrate some data from dev db to prod db.
>>>>> I am trying to do this by creating queries in query analyzer like
>>>>>
>>>>> SET QUOTED_IDENTIFIER OFF
>>>>> select "Insert into productinfo (programname) values ('" + productname
>>>>> from productinfo where product_id=21 + "')"
>>>>>
>>>>> I am getting
>>>>> Syntax error converting the varchar value '')' to a column of data
>>>>> type int
>>>>>
>>>>> I am not sure what i am doing wrong? can someone help.
>>>>>
>>>>> Thanks
>>>>> venkat
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>