Hi
This may seem realy silly but the easiest way is open up Access. Edit the query, change to SQL view, select all and copy.
Now open SQL Server Management studio add a view, don't select any table and just paste into the SQL code windows, save and give it name.
Cheers
Taoh
User Profile
Collapse
-
Thanks
That did it.
With a little help from Query Optimizer the 3.5hr operation not takes 3 secs :-)
TaohLeave a comment:
-
Newbie : Updating a table from a query
All
I have two tables
Table1 has three fields empid,elid, stats
Empid and Elid are unique
Table2 contains many values of empid,elid and apstatid
I need to do something like this
UPDATE Table1 SET Table1.stats= (SUM(Table2.aps tatid)/COUNT(Table2.ap statid)) FROM
Table2 WHERE Table2.empid= Table1.empid AND Table2.elid= Table1.elid
How do I do it?
... -
Sorry All Ignore my question.
As soon as I finished the post I realised the answer.
My excuse it that I am try to understand somebody elses code and my original question was going to be about a problem later on in the routine but as I wrote the post I realised I was going to ask the wrong question.
Definately a case of not seeingthe wood from the trees:-)
Cheers
TaohLeave a comment:
-
Newbie: Find unique records
Hi All
Although I have been using SQL2K for a number of years this is my first venture into more complicated stuff.
I have a query
SELECT apd.elid , apd.pcid , apd.apstatid , ap.empid
FROM ap RIGHT OUTER JOIN
ar ON ap.apid = ar.apid RIGHT OUTER JOIN
apd ON ar.arid = apd.arid
WHERE ap.empid IN (
SELECT emp.empid FROM emp LEFT OUTER JOIN ...
No activity results to display
Show More
Leave a comment: