Monday, March 12, 2012

newbie how to create temp table and populate

Sorry guys I know this is easy but I've been looking for about an hour for a straight forward explanation.
I want to store a user's wish list while they browse the site, then they can send me an enquiry populated with their choices.
Basically, a shopping cart!
I thought of using session variables and string manipulations but I am more comfortable with DB queries.
a simple 4 column table would cover everything.
SQL server and VBScript
Thanks
Mhttp://www.sqlteam.com/item.asp?ItemID=2029|||thanks, that was the first one I found on Google, but it just confused me.

just after I posted my Query I looked again on Google and found this:
http://www.programmers-corner.com/article/76 which seemed to be more my level!
I am currently having a go.|||;-) well Google is your friend.|||aye,
Here you go Newbies, the three statement to create a temp table, insert some values and retrieve them:
CREATE TABLE #myTempTable
(
DummyField1 INT,
DummyField2 VARCHAR(20)
)
--------
INSERT into #myTempTable (DummyField1, DummyField2) VALUES (1,2)
--------
SELECT * from #myTempTable

I new it wasn't rocket science, sometimes just writing to a forum clears your mind...enought to formulate the correct query for Google! doh

No comments:

Post a Comment