Forum Replies Created

Viewing 15 posts - 1 through 15 (of 19 total)

  • Reply To: New Old Architectures

    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...

  • Reply To: Seriously Real Time Data Processing

    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...

  • Reply To: What Keeps You Employed?

    Thomas Franz wrote:

    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...

  • Reply To: Use constraints to determine to execute either an insert or an update (re-post)

    Using IF EXISTS would be a way to go about this.

     

    IF EXISTS(SELECT UserName FROM Foo WHERE UserName = @UserName)

    INSERT...

    ELSE

    UPDATE...

     

     

  • RE: Null Defaults

    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...

  • RE: Wildcard Searches

    Great article. And I love the Sesame Street reference 😀

  • RE: How to pass parameter values to SQL query

    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 ...

  • RE: How to pass parameter values to SQL query

    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 ...

  • RE: Uncontrolled Code

    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...

  • RE: The Desktop Setup

    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...

  • RE: smallint to hh:mm

    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...

  • RE: smallint to hh:mm

    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...

  • RE: Help Required!!

    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)...

  • RE: Teambuilding and Bonding

    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...

  • RE: A Lifetime of Software

    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...

Viewing 15 posts - 1 through 15 (of 19 total)