Forum Replies Created

Viewing 15 posts - 481 through 495 (of 8,731 total)

  • RE: How to get a sum of values in a table joind to table of sum values

    Here's a code sample on how to do it:

    WITH cteTable1 AS(
        SELECT col1, col2, SUM(col3) sumcol3, SUM(col4) sumcol4
        FROM Table1
        GROUP BY col1,...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Fast ways to load data from SQL server to SQL server

    Jeff Moden - Wednesday, June 13, 2018 9:40 PM

    I dunno... seems like a lot of people try to jump through unnecessary hoops...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Strange performance behaviour

    Are you aware that you'll get 2 result sets when @opMode is NULL?

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Fast ways to load data from SQL server to SQL server

    Scott Coleman - Wednesday, June 13, 2018 10:05 AM

    A single 5-million row INSERT can be a huge problem, it may fill up...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Strange performance behaviour

    Can you post DDL and sample data for FunctionPermission table? The problem might be related to it and the FOR XML.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Primary key incrementation

    I wonder if the OP was able to use a version still under mainstream support and used the sequence to solve his problem. Or maybe the previous option was kept...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Fast ways to load data from SQL server to SQL server

    Additional to what Steve just mentioned. You should also take into account that there's additional time when you run the SSIS from your machine as the data needs to travel...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Remove non printable characters

    dhart - Tuesday, June 12, 2018 2:06 PM

    Paul White:
    How do I actually use your inline table function?

    After the creating the function, I ran...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: The SQL Joke Thread

    Chris Harshman - Tuesday, June 12, 2018 11:58 AM

    Why doesn't President Trump like relational databases?

    He thinks we should use less foreign keys...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: This really grinds my gears

    ZZartin - Tuesday, June 12, 2018 9:20 AM

    People sending me excel documents zoomed to less than 100% yes thank you all your...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: MERGE vs UPDATE

    For UPDATE vs MERGE, I would choose UPDATE hands down. For an upsert, I would have to test again but I have encountered problems.
    https://www.sqlservercentral.com/Forums/1615384/Long-running-MERGE

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: remove only number in the given string

    Not really a suggestion because the solution posted by DesNorton should be better but I just wanted to have some fun.

    SELECT * ,
      STUFF((...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Return row as null instead of empty

    This would add the nulls row only if there's not a row in the table.

    SELECT id,
       name,
       createdDate
    FROM @sample
    RIGHT JOIN (SELECT...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Call Stored Procedure from a View / OPENROWSET Research

    HookSqlDba7 - Monday, June 11, 2018 9:48 AM

    We are running SQL Server 2012 on Windows 2008. I have read that some reasons for...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: HELP me on the ALTER TABLE statement, how do I add a UNIQUE Constraint to a table.

    https://docs.microsoft.com/en-us/sql/t-sql/statements/alter-table-transact-sql?view=sql-server-2017#syntax

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2

Viewing 15 posts - 481 through 495 (of 8,731 total)