Forum Replies Created

Viewing 15 posts - 3,961 through 3,975 (of 8,753 total)

  • RE: Flag Values Based on Columns

    Quick suggestion

    😎

    USE tempdb;

    GO

    SET NOCOUNT ON;

    ;WITH SAMPLE_DATA(ID,code,DesiredFlag) AS

    (SELECT * FROM (VALUES

    (1,'999010',1)

    ,(2,'000010',1)

    ...

  • RE: Having fun with PARSENAME (SQL Spackle)

    Jeff Moden (1/17/2016)


    If you're sorting a BIGINT, I don't believe the sign bit will come into play at all for IP4 addresses.

    True but still one is sorting on [D][C][A] which...

  • RE: Having fun with PARSENAME (SQL Spackle)

    Jeff Moden (1/17/2016)


    Eirikur Eiriksson (1/17/2016)


    thierry.vandurme (1/15/2016)


    Nice article. May come in use one day so glad you shared that.

    Btw, I use bigint to store IP4 addresses (less space and able to...

  • RE: Having fun with PARSENAME (SQL Spackle)

    Jeff Moden (1/15/2016)


    thierry.vandurme (1/15/2016)


    Nice article. May come in use one day so glad you shared that.

    Btw, I use bigint to store IP4 addresses (less space and able to use ORDER...

  • RE: Having fun with PARSENAME (SQL Spackle)

    thierry.vandurme (1/15/2016)


    Nice article. May come in use one day so glad you shared that.

    Btw, I use bigint to store IP4 addresses (less space and able to use ORDER BY)

    Using a...

  • RE: Date Function

    Scott's fine code provides the correct answer but logic embedded in the code such as this is neither too readable nor maintainable and what is even worse is that it's...

  • RE: how to Select getdate () in yyyy/M format ?

    nigel. (1/15/2016)


    Orlando Colamatteo (1/13/2016)


    sushantkatte (1/13/2016)


    I want to select getdate() in the format yyyy/M. i tried to write a query as SELECT FORMAT(GETDATE(),'yyyy/M') but it is giving me error.I am a...

  • RE: Guarantee entire flat file loaded

    Steve Jones - SSC Editor (1/13/2016)


    My only thought here is that if you know you have windows formatted files with a \r at the end, you can count these with...

  • RE: derived column error

    arkiboys (1/15/2016)


    Hello,

    Using the foreachloop I loop through excel files to get the filename andthen start loading the data into sql server using oledb...

    1- I get the filename

    2- Then...

  • RE: change dinamically value of parameters inside stored procedure

    simone.hagiu (1/15/2016)


    Hi all,

    Im struggling with a problem here. I have an app with a lot of screens based on an sql database using a lot of stored procedures. The app...

  • RE: Getting SQL Server Error 7303

    jacksonandrew321 (1/14/2016)


    unable to create linked server to access excel file. getting below error while creating linked server:

    Cannot initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server...

  • RE: Are the posted questions getting worse?

    GilaMonster (1/14/2016)


    He's asking MySQL questions on a SQL Server site and appears to be about at the level of spelling 'SQL'. I won't be surprised if he asks "What's a...

  • RE: Stop deletes on a table

    krypto69 (1/14/2016)


    Thanks everyone - very intersting input.

    I ended up using:

    CREATE TRIGGER NoDeleteMedicalGroup ON dbo.Medical_Group

    INSTEAD OF DELETE

    AS

    BEGIN

    ROLLBACK;

    END;

    No items in the Medical group table should ever be deleted. So, this...

  • RE: how to Select getdate () in yyyy/M format ?

    Jeff Moden (1/14/2016)


    Orlando Colamatteo (1/13/2016)


    Be careful anyway, FORMAT is very slow when compared to other date functions. CONVERT does not contain a style option for the format you need but...

  • RE: Alternative to splitting text

    sqlquaker (1/13/2016)


    You may want to check this article by Aaron Bertrand. He explains various methods to split values in a string separated by delimiter such as #.

    http://sqlperformance.com/2012/07/t-sql-queries/split-strings

    Also check out...

Viewing 15 posts - 3,961 through 3,975 (of 8,753 total)