Forum Replies Created

Viewing 15 posts - 811 through 825 (of 8,731 total)

  • RE: Query help

    Just a different option, for the fun:

    DECLARE @Sample TABLE(
      patients_ID int,
      treatment_ID int
    );
    INSERT INTO @Sample
    VALUES
    (1, 111),
    (1, 222),
    (1, 333),

    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: Is it possible to view the partitioning that is set up inside a database ?

    goher2000 - Thursday, November 30, 2017 10:46 AM

    will this help


    SELECT SCHEMA_NAME(so.schema_id) AS schema_name
       ,OBJECT_NAME(p.object_id) AS object_name
       ,p.partition_number
       ...

    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: How to add sequential dates to a SQL table

    Something like this, will insert all Saturdays for 2018, but I´m sure you have something else in the table.

    CREATE TABLE #Calendar(cal_id int IDENTITY, cal_date date);

    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: Difficulty with SQL UPDATE Query

    John Mitchell-245523 - Thursday, November 30, 2017 9:26 AM

    Luis Cazares - Thursday, November 30, 2017 9:23 AM

    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: Force execution plan in a view

    Sergiy - Thursday, November 30, 2017 2:17 AM

    If returned sets are always filtered by PVID you may use this trick:

    CustomData =...

    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: Difficulty with SQL UPDATE Query

    John Mitchell-245523 - Thursday, November 30, 2017 8:46 AM

    You haven't built your string properly, and like Sue said, you're not even executing...

    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: How to add sequential dates to a SQL table

    MarkW.Rhythm1 - Thursday, November 30, 2017 8:38 AM

    Hello ~

    I am trying to add sequential dates to a table in 2008. By sequential...

    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: Extended Properties

    I believe the wording on the correct answer is misleading. In my opinion, it should say: "The value of level0type is invalid".
    Maybe it's just me.

    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 error, how to identify row causing error

    JJR333 - Thursday, November 30, 2017 6:26 AM

    When I run my storedprocedure to MERGE one table into another I get the following...

    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: How to search songs_words table for songs that contain a group of words?

    This seems like homework and MySQL.
    Is any of those assumptions correct?

    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 Month number value in table of Dates

    Would these formulas give the correct results?

    DECLARE @test-2 TABLE (
      [Date] DATE,
      [Weeknumber] AS DATEPART(wk, DATEADD(wk, -1, [Date])),
      [DayName]   AS DATENAME( DW, [Date]),

    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: Alternative to a table valued function in SQL Server

    Sandeeppunreddy2 - Tuesday, November 28, 2017 9:35 AM

    Hi All,

    we have a table valued function fn_ProductType which accepts a ProductID and Order Date as...

    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: Better TSQL Performance

    PrettyMegaDBA - Wednesday, November 22, 2017 9:23 AM

    Grant Fritchey - Wednesday, November 22, 2017 9:19 AM

    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: Better TSQL Performance

    PrettyMegaDBA - Wednesday, November 22, 2017 8:36 AM

    Thanks Jeff.  And go easy on me J. Drew, I don't post very often 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: Force execution plan in a view

    Jeff Moden - Wednesday, November 22, 2017 8:15 AM

    Did you try it by naming the columns in the SELECT list instead...

    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 - 811 through 825 (of 8,731 total)