all groups > sql server programming > december 2005 >
You're in the

sql server programming

group:

SELECT INTO PROBLEM


Re: SELECT INTO PROBLEM David Portas
12/31/2005 6:15:27 AM
sql server programming: [quoted text, click to view]

INSERT INTO [AlisverissaatiXML].[dbo].[urunler] (col1, col2, col3, ...)
SELECT col1, col2, col3, ...
/* ... list the columns you require */
FROM [Kangurum].[dbo].[urunler]
WHERE urunadi='ROMANSON PHIL MEETY' ;

--
David Portas
SQL Server MVP
--
Re: SELECT INTO PROBLEM Jens
12/31/2005 6:30:45 AM
Hi Savas,

Select into is used if you want to create a new table based on the
provided schema of the selected columns in your statement. If you want
to insert data into an exsiting table you should rather use INSERT
INTO:

INSERT INTO [AlisverissaatiXML].[dbo].[urunler]
(
urunadi
)
SELECT urunadi
FROM [Kangurum].[dbo].[urunler]
WHERE urunadi='ROMANSON PHIL MEETY'


HTH, Jens Suessmeyer.
Re: SELECT INTO PROBLEM Aaron Bertrand [SQL Server MVP]
12/31/2005 11:01:11 AM
[quoted text, click to view]

Or in this trivial case:

INSERT [AlisverissaatiXML].[dbo].[urunler]
(
urunadi
)
SELECT 'ROMANSON PHIL MEETY'

:-)

SELECT INTO PROBLEM Savas Ates
12/31/2005 4:08:46 PM
I have two tables.. They are both identical..

I want to select some fields from one and insert to another one.
How can i do it ?

SELECT urunadi INTO [AlisverissaatiXML].[dbo].[urunler] FROM
[Kangurum].[dbo].[urunler] WHERE urunadi='ROMANSON PHIL MEETY'

It returns

The object name 'AlisverissaatiXML.dbo.urunler.' contains more than the
maximum number of prefixes. The maximum is 2.

AddThis Social Bookmark Button