Forum Replies Created

Viewing 15 posts - 406 through 420 (of 3,544 total)

  • RE: Username increment by 1 if already exists in table

    Notwithstanding Eirikur's statement re same first names

    WITH x (ID,FirstName,LastName,UserName,RowNum) AS (

    SELECT e.ID,e.FirstName,e.LastName,LEFT(e.FirstName,t.N)+e.LastName,

    ROW_NUMBER() OVER (PARTITION BY e.ID ORDER BY LEN(LEFT(e.FirstName,t.N)+e.LastName) ASC)

    FROM #Employee e

    JOIN master.dbo.Tally t ON t.N BETWEEN 1 AND LEN(e.FirstName)

    WHERE...

  • RE: update question

    COALESCE(NULLIF(foo,'')+','+newvalue,newvalue)

  • RE: How to write the query result from within a variable to a table

    DECLARE @HashTable TABLE(HashTable nvarchar (255),TABLE_NAME nvarchar (255));

    INSERT @HashTable

    EXECUTE sp_MSForeachdb 'IF DB_ID(''$'') > 4 BEGIN; USE [$]; EXECUTE sp_MSForeachTable ''SELECT CheckSum_Agg(Binary_CheckSum(*)) AS HashTable, ''''[$].?'''' AS TableName FROM [$].?''; END','$';

    SELECT *...

  • RE: Filling the missing rows/gap in the data

    Was experimenting a bit but could only come up with

    cross join distinct list of COMPANY,AREAS,PRODUCT,MARKET,SUBTERRITORIES with range of YEAR and MONTH (using tally table) and left join original table

  • RE: Filling the missing rows/gap in the data

    Jeff Moden (10/31/2016)


    Pictures are good but they're tough to execute. If you'd like a coded answer, please see the first link in my signature line below.

    😀

    IF OBJECT_ID('TempDB..#testtable','U') IS NOT...

  • RE: Are the posted questions getting worse?

    jasona.work (10/20/2016)


    I don't quite feel your pain, but I'm in the midst of migrating a handful of DBs to a new server.

    I am currently migrating 69 dev databases to new...

  • RE: Are the posted questions getting worse?

    djj (10/13/2016)


    Let me get my walker....

    20 years ago I had been working for 20 years.

    Ditto 😀

    p.s. I starting programming circa 1973 :w00t:

  • RE: Are the posted questions getting worse?

    Grant Fritchey (10/3/2016)


    Hugo Kornelis (10/2/2016)


    Eirikur Eiriksson (10/2/2016)


    BLOB_EATER (10/2/2016)


    Into my 19th hour for the weekend shift decided to google (Gone off bing) well know SQL Server people and found this (attached).......

  • RE: Are the posted questions getting worse?

    BLOB_EATER (9/29/2016)


    so....I will be doing a presentation in front of 40 people soon, I was wondering if the vets here have any advice? Practice in front of a mirror? smile?...

  • RE: Msg 245, Level 16, State 1, Line 2 Conversion failed when converting the varchar value 'F' to data type int.

    The problem is not with ADP-000077S or ADP-000077F but with AE-000077S and AE-000077F

    Unless the format of AE is different to ADP then the AE substrings should be 4,6 not 3,20

    What...

  • RE: T-SQL: EOMONTH

    Date format default interpretation is dependant on the language specified for the login.

    p.s. That is string interpretation.

  • RE: Are the posted questions getting worse?

    David Burrows (9/19/2016)


    Ed Wagner (9/19/2016)


    ChrisM@Work (9/19/2016)


    Eirikur Eiriksson (9/18/2016)


    Now where is that crystal ball again?

    😎

    You're going to need a pair of those. The OP (or should that be "perp"?) has been...

  • RE: Are the posted questions getting worse?

    Jeff Moden (9/19/2016)


    You've forgotten the "Modenism" that encompasses all of those... "Moroff". This is a person that doesn't even merit being called a "Moron" because they're more off than...

  • RE: Are the posted questions getting worse?

    Ed Wagner (9/19/2016)


    ChrisM@Work (9/19/2016)


    Eirikur Eiriksson (9/18/2016)


    Now where is that crystal ball again?

    😎

    You're going to need a pair of those. The OP (or should that be "perp"?) has been posting for...

  • RE: Bulk Insert without quotes

    Your format and data do not match

    The position of CITY and COUNTRY_CODE is different

    The last entry in the format file needs have \r in the terminator not \r

    All the data...

Viewing 15 posts - 406 through 420 (of 3,544 total)