>>
>>Although I don't understand how to do item 4) in your list. How do you create a temp table in SQL Server without a stored procedure?
>
>SQLExec(m.lnHandle,'create table #myIdList (myId i)')
>SQLExec(m.lnHandle,'insert into #myIdList values (1)')
>SQLExec(m.lnHandle,'insert into #myIdList values (2)')
>SQLExec(m.lnHandle,'insert into #myIdList values (3)')
>SQLExec(m.lnHandle,;
> 'select myTable.* from myTable inner join #myIdList ids on ids.myID = myTable.pkid', 'result')
>
>Cetin
Cetin,
Thank you very much for the example of creating temporary table in SQL Server.
But as I look at your example, I am wondering what is better/faster/more efficient: 1. Creating a temp table and, say, inserting 20 or 50 rows into the temp table (which means calling SQLExec so many times. Or 2. Creating a string of values to be used in the IN clause of one SQL Select against the "myTable" without temp table. What is your (and others) feeling on that?
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham