I think dvannoy means using an inner join within a view to create a dynaset. These are not necessarily updateable... It depends on the join and on the particular field. Look it up Books Online. Let's just say SQL Server is much more restrictive than Microsoft Jet.
Outer is optional if you already supply Left.
You need a cross join. A cross join of image and cat will get you a record for every possible combination of image and cat. Then you left join that onto image_cat to pull the third field in:
SELECT i.imageID, c.catID, ic.image_catID
FROM...
Jiminy jillickers! How did I miss that glaring FROM clause? I hit the same wall when I migrated from Access SQL: In SQL Server, your UPDATE statements can only update one table at a time. Check Books Online for the proper syntax.
In general:
UPDATE <table-to-be-updated>
SET a = b,
c =...
We will use VBA to generate a tab-delimited string. Since I don't know which version you are using, I will use DAO (I haven't used the ADO stuff in Access itself yet; it's been a while). Note the use of the CurrentDb object... I don't think anything after 97 has this; you may have to modify...
The visitor and order calculations are separate and must be done separately. Use subqueries:
SELECT
r.ref,
r.keyword,
( SELECT COUNT(*) FROM tbl_visitors
WHERE visitor_ref = r.ref AND
visitor_date >= '9/10/2002' AND
visitor_date < '9/21/2002' )...
That is not what an ASP querystring is.
The Response.QueryString object is a string representing arguments submitted from a form on a web page. This has nothing to do with SQL Server.
Instead of these inefficient dateparts, take advantage of the fact that dates in Access are stored in terms of days from 1/1/1900.
WHERE
r.date_time >= #9/1/2002# AND
r.date_time < #9/16/2002# AND
fpart(r.date_time)
Between #1/1/1900 07:00:00# And #1/1/1900 23:00:00#
The...
In the jsp page that receives the submitted form, build the SQL string. However, don't pass everything to the SQL Server. Place the if else logic inside the jsp page. Instead of what you proposed:
String sql = "UPDATE tbl SET if (a) { b, c } else { d, e }"
Do:
String sql =...
It may be faster if you drop all indexes (especially clustered ones) before the delete and rebuild the index afterwards. Maintaining the clustered one during the delete is the worst because the records are physically reordered for EVERY record deleted.
Short answer: DTS can't. Long answer: You can write a procedure, either in SQL Server or outside it, that examines the file and determines if a column has been added. If it has, trigger a stored procedure that ALTERs your TABLE to add the column.
Instead of using OPENROWSET, why not link the remote server? Then you can reference the remote db as if it were on your local instance. Check Books Online for info on linking servers.
Take the SQL used to generate the temp table. Put it in parentheses and alias it. Use this as a dynamically generated table. Take the final result SQL and put the parenthesized expression into every slot that says #temp. You can see how it gets out of hand, but I do see why you would want...
Move the non-join criteria into the WHERE clause. And don't mind my weird tab structure; that's my preferred way of displaying from clauses.
CREATE TRIGGER trg_userruns_pocketformat
ON Userruns
FOR INSERT
AS
UPDATE t
SET t.[User field 5] = ((t.[User field 5] / 10) - 1) * 6 +
(t.[User...
Instead of putting the criteria in the SQL string, why not do the if...else... in jsp and build the string there? Then you can select what fields to include on the Java side. You end up with a shorter SQL statement to pass to the server, which is always good:
String sql = "UPDATE tbl...
Post your SQL. If your command is written properly, there should be no problem with NULLs. Where is the SQL statement residing? (SP, dynamic generation from app)?
Is this trigger being fired on Blackbird_Remote? Please describe the business use case around the insert. We can then come up with the simplest, most elegant solution from there.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.