Viewing 15 posts - 271 through 285 (of 345 total)
Select FirstCommunityChoice, Count(FirstCommunityChoice) as 'Community Count'
From dbo.tblApplicationCommunities
Group By FirstCommunityChoice
April 27, 2011 at 2:05 pm
This will fix what you have:
declare @startdate Datetime
declare @enddate Datetime
set @startdate = getdate()-480
set @enddate = getdate()-90
--set @vStart = select convert(varchar,@startdate, 102)
print @startdate
print @enddate
WHILE (@startdate < @enddate)
BEGIN
print 'delete from vending where...
April 27, 2011 at 1:58 pm
I think you're looking for something like this:
CREATE TRIGGER trigger_test ON test FOR UPDATE
AS
SET NOCOUNT ON
IF UPDATE(column9) OR UPDATE(column10) OR UPDATE(column11)
BEGIN
--do your main DML here
END
April 27, 2011 at 7:50 am
Not only confusing, but dangerous! I'm reading Defensive Database Programming by Kuznetsov and he describes where any triggers on the table in the code above will be affected by the...
April 25, 2011 at 11:50 am
Ajay.Kedar (4/25/2011)
April 25, 2011 at 7:50 am
SQLkiwi (4/24/2011)
toddasd (4/21/2011)
I didn't know INSERT could have a TOP clause.
It's a good thing to know, because SET ROWCOUNT will not work with INSERT, DELETE, or UPDATE in the next...
April 25, 2011 at 7:42 am
opc.three (4/21/2011)
TOP also works with INSERT directly. So this is the case BOL was talking about:
I didn't know INSERT could have a TOP clause. Now it makes sense. Thank you.
April 21, 2011 at 1:36 pm
I've been reading about Service Broker with these questions lately and I still have a lot of questions on what exactly it is (even after reading BOL). Anyone here use...
April 21, 2011 at 7:19 am
You're in the wrong forum. This has very little to do with SQL Server. My company also has many databases offshore and do you know what I do when I...
April 20, 2011 at 7:25 am
Your UDF is based on getting the next box number of that day's orders. So I'm saying don't join tblOrders to avoid locking it and instead pass the procedure the...
April 19, 2011 at 10:10 am
Multiple columns (not fields) won't matter. Try it out and you'll see that they are tacked on to the end of the rows just like a scalar total. You'll only...
April 19, 2011 at 9:27 am
Yes, you can tack on as many as you like if your additional queries return one value. If they contain more than one row, your results will cross-multiply and we'll...
April 18, 2011 at 3:53 pm
Ah, I thought you would copy the whole queries from the first post into the parenthesis. If these are views, then just remove the parenthesis.
SELECT *
FROM...
April 18, 2011 at 1:47 pm
db2mo (4/18/2011)
What field would I join on? There are multiple fields in the first dataset and only one field in the second dataset.
None, just paste your queries where I...
April 18, 2011 at 12:33 pm
Viewing 15 posts - 271 through 285 (of 345 total)