Viewing 15 posts - 1 through 15 (of 19 total)
Clipper was the first programming language I used in anger in a real job, I really enjoyed working with it. At the same company I also designed and implemented an...
September 10, 2021 at 9:02 am
On the self-driving car thing, it weould be much easier if all cars were self-driving. Take the human idiot factor out of it and it instantly becomes simpler, especially in...
July 19, 2021 at 8:54 am
Jobdescription: Well, it depends 🙂
This. If I'm talking to someone in the industry then I'll be more specific. If not, people's eyes tend to glaze over if you give...
May 24, 2019 at 2:04 pm
Using IF EXISTS would be a way to go about this.
IF EXISTS(SELECT UserName FROM Foo WHERE UserName = @UserName)
INSERT...
ELSE
UPDATE...
May 8, 2019 at 2:57 pm
I would advocate going down the NULL route. It's a new column after all and when that column is referenced by the calling application, that application should know what it...
March 3, 2017 at 2:36 am
Great article. And I love the Sesame Street reference 😀
November 18, 2016 at 1:51 am
Sorry, I misunderstood. Creating a function to do the work could be the answer, something like the following:
CREATE FUNCTION MyFunc (@CutOffDate varchar(6))
RETURNS INT
AS
BEGIN
DECLARE @Qty INT
SELECT @Qty = SUM(QUANTITY)
FROM ...
January 21, 2016 at 4:08 am
Hi,
You just call the stored procedure with parameter after the procedure name as in the following example:
CREATE PROCEDURE MyProc
@CutOffDate varchar(6)
AS
INSERT INTO testtable (Quantity, YearMonth)
SELECT SUM(QUANTITY) AS TotalQty, @CutOffDate
FROM ...
January 21, 2016 at 2:30 am
The auditing (or not) of these Excel application that are created by various people around the business is what is the most dangerous thing. I have done a fair bit...
January 21, 2014 at 6:49 am
As with Jeff above, I don't really use anything much apart from the standard tools for my job SSMS, Visual Studio, Office and a couple of specific business systems. I...
January 10, 2014 at 4:55 am
lanky,
I think you're doing your formatting in the wrong place, you need to do the formatting to hh:mm after the SUM is done. See following example:
DECLARE @tester TABLE...
August 23, 2013 at 9:41 am
lanky,
% gives you the modulo, that is, it divides the first number by the second number and gives you the remainder. So in your example, 177 % 10 will give...
August 23, 2013 at 9:14 am
To make Luis' code a little more generic, you could code it as follows:
SELECT
SUBSTRING(String,CHARINDEX('email=',String)+6
,CASE WHEN CHARINDEX(';',String,CHARINDEX('email=',String)+6) = 0
THEN LEN(string)
ELSE CHARINDEX(';',String,CHARINDEX('email=',String)+6)-(CHARINDEX('email=',String)+6) END) AS [Email]
,SUBSTRING(String,CHARINDEX('rota=',String)+5
,CASE WHEN CHARINDEX(';',String,CHARINDEX('rota=',String)+5) = 0
THEN LEN(string)
ELSE CHARINDEX(';',String,CHARINDEX('rota=',String)+5)-(CHARINDEX('rota=',String)+5)...
August 16, 2013 at 3:18 am
We have a team meeting for all people from all our offices here in the UK in a few weeks time and I'm looking forward to it much for the...
May 10, 2012 at 6:06 am
I think I will be involved in the technology side of things until I retire, at least I hope so. I like the challenge of solving problems and the just...
April 27, 2012 at 9:01 am
Viewing 15 posts - 1 through 15 (of 19 total)