Forum Replies Created

Viewing 15 posts - 2,881 through 2,895 (of 8,761 total)

  • RE: SQL Agent Token and Ola H scripts

    I find it easier to log the output of the OH scripts to a table and work from there.

    😎

  • RE: How to use a CSV as parameter in a query

    One option is to use XML, here is a simple example

    😎

    USE TEEST;

    GO

    SET NOCOUNT ON;

    DECLARE @PARAXML XML = '<X>1</X><X>2</X><X>3</X><X>4</X><X>5</X>';

    SELECT

    P.DATA.value('(./text())[1]','INT') AS PARAM_VALUE

    FROM @PARAXML.nodes('/X') P(DATA);

    Output

    PARAM_VALUE

    -----------

    1

    2

    3

    4

    5

    Quick question, how many parameter...

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

    David Burrows (11/7/2016)


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

  • RE: Determine if a table column is used?

    Eric M Russell (11/4/2016)


    Or you could leave the columns as is and add page compression, which in this case would probably shrink the table down to 10% or less of...

  • RE: A Better sp_Spaceused

    Jeff Moden (11/6/2016)


    Geez... it would have been SOOOOOOOO simple for them to make the "improvement" so much more worthwhile. I don't know why they even bothered.

    They had to add...

  • RE: Check my backup knowledge?

    Brandie Tarvin (11/7/2016)


    GilaMonster (11/7/2016)


    No, a compressed backup is compressed from the start.

    If it worked according to your theory, then a compressed backup would take longer than a normal backup...

  • RE: table structure

    Quick thought, if you are storing exactly the same information for all "person types" then a single person table could work.

    😎

    +------------+ ...

  • RE: installed memory(RAM)

    You can find detailed memory information in the sys.dm_os_process_memory view.

    😎

  • RE: Importing Data and Default Values

    SteveD SQL (11/7/2016)


    Hi Eirikur

    Unfortunately I have no control over the data structure so is not be an option for me.

    Interesting idea though. Quick followup, if I had that as a...

  • RE: Importing Data and Default Values

    Here is a possible solution using a trigger

    😎

    USE TEEST;

    GO

    SET NOCOUNT ON;

    IF OBJECT_ID(N'dbo.Product05') IS NOT NULL DROP TABLE dbo.Product05;

    CREATE TABLE dbo.Product05

    (

    ProductName VARCHAR(20) NOT NULL

    ...

  • RE: Evalution Expired

    Rechana Rajan (11/7/2016)


    Eirikur Eiriksson (11/7/2016)


    Rechana Rajan (11/7/2016)


    We have two node cluster with 3-2014 Standard edition OLTP instances and 1-2012 Enterprise analysis server instance.

    Earlier the server had evalution edition and because...

  • RE: Evalution Expired

    Rechana Rajan (11/7/2016)


    We have two node cluster with 3-2014 Standard edition OLTP instances and 1-2012 Enterprise analysis server instance.

    Earlier the server had evalution edition and because of that now SSMS...

  • RE: sp_settriggerorder in section TRY/CATCH

    rajnoha (11/7/2016)


    Yes, it's an explanation. But if the procedure call without section TRY / CATCH then no transaction is open - Example 1.

    When wrapped in a try/catch, the exit clause...

  • RE: sp_settriggerorder in section TRY/CATCH

    rajnoha (11/7/2016)


    It's just a question of principle. Why when using the section try / catch remains open transactions?

    In this case it is the poor coding of sys.sp_settriggerorder which is throwing...

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

    abhas (11/7/2016)


    hi,

    if first two letters are same then use first three letters for second user and so on......

    Thanks

    Abhas.

    And if the first names are the same?

    😎

Viewing 15 posts - 2,881 through 2,895 (of 8,761 total)