Forum Replies Created

Viewing 15 posts - 2,566 through 2,580 (of 8,731 total)

  • RE: How to update a field with the same Value within a Range using SQL?

    It's easy to convert a SELECT into an UPDATE.

    You have 2 options depending on the complexity of the UPDATE. You can keep the FROM and use a table alias in...

    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: Today's Random Word!

    Ed Wagner (6/30/2016)


    Manic Star (6/30/2016)


    Grumpy DBA (6/30/2016)


    Ed Wagner (6/30/2016)


    Race

    Rat

    Tail

    Head

    Body

    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: Today's Random Word!

    Ed Wagner (6/29/2016)


    Ray K (6/29/2016)


    Ed Wagner (6/29/2016)


    Manic Star (6/29/2016)


    TomThomson (6/29/2016)


    Revenant (6/29/2016)


    crookj (6/29/2016)


    ThomasRushton (6/29/2016)


    Grumpy DBA (6/29/2016)


    Hugo Kornelis (6/29/2016)


    Wedding

    Crasher

    Party

    Animal

    The Animals

    Geordies

    Visor (star trek reference)

    Dilithium

    Crystals

    Salt

    Pepper

    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: What is this WHERE clause

    Alan.B (6/29/2016)


    Luis Cazares (6/29/2016)


    oradbguru (6/29/2016)


    Hello, I was debugging some legacy code and came across an insert statement with only this in the where clause.

    WHERE ' ' = ' '

    Any ideas...

    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: What is this WHERE clause

    oradbguru (6/29/2016)


    Hello, I was debugging some legacy code and came across an insert statement with only this in the where clause.

    WHERE ' ' = ' '

    Any ideas what this would...

    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: date Hierarchy (simple hopefully)

    You can keep your dates as dates using the date data type. It's easier to manage and requires 1 byte less of storage per row. 😉

    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: Dates in Fact or Dimention

    You need one generic calendar/dates dimension which will be related to different columns in your fact table.

    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: Improvements in SQL Server Environment

    Possibly obvious but shouldn't hurt to ask. Have you run sp_blitz? https://www.brentozar.com/blitz/

    Or other health check scripts?

    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: Changing a function to work with multiple records

    NHS Baz (6/29/2016)


    Thanks for the input folks but does anyone have an answer to the question that was actaully posed in the original post?

    Think set-based 😉

    CREATE FUNCTION [dbo].[GetDaysUnavailable]

    (

    @intRefint

    )

    RETURNS TABLE...

    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: Are the posted questions getting worse?

    jasona.work (6/29/2016)


    Brandie Tarvin (6/29/2016)


    jasona.work (6/29/2016)


    So, I'm thinking if we get enough takers, we might be able to make a run at buying Taravai

    Close enough to another island with an airstrip,...

    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: Dynamic Query

    It's possible, but it's not easy.

    An option, if you want to keep queries dynamic is to use an ORM such as Entity framework. Be aware that if it's not handled...

    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: Are the posted questions getting worse?

    Just a little humor.

    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: Scrub Personal Information Data

    Does this example helps you?

    Note that the code is non deterministic, so the results aren't guaranteed to be the same on each run.

    CREATE TABLE PersonalInformation(

    PersonID ...

    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: BCP out to xls file

    bcp doesn't have output to xls files. It generates flat files (delimited or fixed length) which you can add any extension.

    Use SSIS for this.

    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: Convert multiple rows to columns Dynamically

    You can use the SELECT...INTO... option using a global temp table or a perm table. A local temp table would lose the scope after finishing the dynamic code execution so...

    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 - 2,566 through 2,580 (of 8,731 total)