i hav one table in oraclei hav to copy that first 300 records into the sqlserver table through the import/export activites in sqlserver -> enterpriseManager.
iam select the inport data from the sqlserver enterprise manager and set the all properties.. at select query option i selected ,now i hav to write query for thatcondition(first 300 records)
i.e simply tell me the query for selecting first 300 rows from a table in Oracle.... thats it..!!!!!
We use a LINKED SERVER to the Oracle box, and then use OPENQUERY as Spirit suggests - something like:
DECLARE @strSQL varchar(8000)
SELECT @strSQL =
'SELECT *
INTO ##MyTempTable
FROM OPENQUERY(MyOracleLinkedServerName,
''SELECT *
FROM
(
SELECT *
FROM MyOracleTableName
ORDER BY MyColumnA
) X WHERE ROWNUM <= 300
'')'
-- SELECT [SQL] = @strSQL -- Comment in for debugging
EXEC (@strSQL)
Might it be an idea to have an ORDER BY on it - so that the 300 that you get is repeatable? (Unless you are happy that they might be different each time, or unless Oracle provides a guaranteed sequence in the absence of an ORDER BY - I'm no Oracle expert!)