Viewing 15 posts - 2,551 through 2,565 (of 3,500 total)
May 5, 2015 at 12:29 pm
I think this is what you meant. Your code should be inside the BEGIN/END block, and it wasn't.
CREATE TRIGGER Customers_country_Insert_Update
ON Customers
AFTER INSERT, UPDATE
AS
BEGIN
SET NOCOUNT ON;
UPDATE Customers
SET Country=UPPER(Country)
WHERE CustomerID IN...
May 5, 2015 at 12:18 pm
Did you look at your transaction log to see what's going on in your database?
May 5, 2015 at 12:27 am
query the database size, insert into table with timestamp... I know there are examples around here somewhere. Search around.
May 5, 2015 at 12:26 am
Thanks for the explanation... Helps a lot! Is this what you were looking for?
SELECT Account
, MonthsBetweenRuns
, DDCycle
, Num
FROM tblDDAccounts A CROSS JOIN Tally T
WHERE Num % MonthsBetweenRuns = 0;
Note,...
May 4, 2015 at 11:59 am
Ouch. Explain what you're trying to accomplish. You can probably do this with a Tally or "numbers" table and a simple query.
May 4, 2015 at 9:39 am
/* remove City and State from the Address */
SELECT Address
, LEFT(Address,CHARINDEX(',',Address,1)-1) AS StreetAddr
, RIGHT(Address,2) AS AddrState
FROM Address1;
April 30, 2015 at 7:50 pm
full weeks since when? the first of the year?
Maybe Lynn Pettis' article will help:
http://www.sqlservercentral.com/blogs/lynnpettis/2009/03/25/some-common-date-routines/
April 30, 2015 at 3:09 pm
I would probably start with Dwain Camps' article here:
http://www.sqlservercentral.com/articles/String+Manipulation/94365/
I might go about it by writing all the locations (use CharIndex) of a string to a temp table and then doing...
April 30, 2015 at 11:51 am
STDistance returns the straight line distance between two points (as the crow flies). GoogleMaps determines the distance by the sum of the lengths of sections of roads traveled on....
April 29, 2015 at 10:51 pm
I would be wary of a design like that. How would you deny update/delete on a table if you had all of your stored procedures like that? If they...
April 29, 2015 at 5:56 pm
<zing!>
Sorry, missed that COMPLETELY.
April 28, 2015 at 9:46 pm
Save yourself the headache. Store the dates as dates, not as two columns with numbers. Then you can do date math really easily, index columns and all that....
April 28, 2015 at 9:02 pm
What are you trying to do? Filter the report so they only see the records they want? That's pretty easy.
Or are you trying to make the fields in your...
April 27, 2015 at 9:43 pm
Viewing 15 posts - 2,551 through 2,565 (of 3,500 total)