Forum Replies Created

Viewing 15 posts - 121 through 135 (of 1,241 total)

  • Reply To: How Can I let Insert, update and delete sql statement work in a user-defined fun

    Lookup the MERGE command.

    Functions perform operations in a row by row manner as opposed to a set at a time. This is slow and not needed.

    I am not sure how...

    ----------------------------------------------------

  • Reply To: How to remove unallocated space after partitioning

    ScottPletcher wrote:

    It may fragment some indexes and not others.  You certainly don't want to automatically rebuild every index.  Also, rebuild from smallest to largest of the indexes that do need...

    ----------------------------------------------------

  • Reply To: Log full error 9002

    A very good link has been provided.

    If you have your log file on its own volume another thought would be , just to put it out there, a powershell script...

    ----------------------------------------------------

  • Reply To: Db is slow

    Techno-Umesh wrote:

    Few best practices to optimize SQL DB performance

    - Reduce Table Size - Simplify Joins - Use SELECT Fields FROM Instead of SELECT * FROM - Use EXISTS() Instead of...

    ----------------------------------------------------

  • Reply To: Db is slow

    Since you are on 2017 pressumably , navigate to your database (in explorer) and drill down to the Query Store. There you will find the most expensive queries by cpu...

    ----------------------------------------------------

  • Reply To: Pivot Issue

    I cant even make sense of what the data is supposed to render to. I cant make out any columns in the desired output. Please put in time to present...

    ----------------------------------------------------

  • Reply To: Counting Records summed into time overlap

    Please create a entity relationship diagram explaining what the tables are and what certain columns mean. and how they are related/joined.

    Provide a simple case of input data and what the...

    ----------------------------------------------------

  • Reply To: Schedule Replication

    What section and step within the documentation are you at ? Is this transactional replication ? Is it push or pull subscription ? Where is the distributor  ?

     

    ----------------------------------------------------

  • Reply To: Create start of week column based on dates

    "I'd like to create a column that will list every Monday (start of week) from the enrollment start date to the end date. If no end date, then it will...

    ----------------------------------------------------

  • Reply To: A Scary Situation

    I had a scary experience with CPU on a database server reaching 100% due to bad plans from badly written code. I have had all members of my team looking...

    ----------------------------------------------------

  • Reply To: Table Header with Dynamic Dates

    Test out the solution I provided with data that varies in the first few columns and adjust the pivot experssion as needed.

    ----------------------------------------------------

  • Reply To: Table Header with Dynamic Dates

    For dynamic SQL, try the following >

    declare @sqlStart nvarchar(200)=
    'Select *
    FROM (Select custID, staffId, jobID, dt, sum(units) as units ...

    ----------------------------------------------------

  • Reply To: What's been your most favorite/fun project you've worked on?

    One of my favorites was a project I did earlier in my career. What made it special was that I was learning as I went along and was given the...

    ----------------------------------------------------

  • Reply To: How to see the Current fill factor of an index?

    wensheng_zou wrote:

    select * from sys.indexes where fill_factor<>0

    Indeed from Microsoft Docs ---

    "> 0 = FILLFACTOR percentage used when the index was created or rebuilt."

    The key term to notice is 'rebuilt.' So...

    ----------------------------------------------------

  • Reply To: PostgreSQL User Defined Functions

    Thank you for the article. This is nicely explained. However I have a couple of questions.

    The basic template is

    CREATE [OR REPLACE] FUNCTION function_name (arguments) 
    RETURNS return_datatype AS...

    ----------------------------------------------------

Viewing 15 posts - 121 through 135 (of 1,241 total)