Forum Replies Created

Viewing 15 posts - 2,956 through 2,970 (of 8,731 total)

  • RE: Count differs while using the date values

    tindog (4/28/2016)


    Did the queries Luis provided not work? What happened?

    An alternative would be to change your parameters to DATE instead of DATETIME, then use BETWEEN as you have (without the...

    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: Count differs while using the date values

    pstanand (4/28/2016)


    Hi,

    thanks for your information. Could you please provide me the correct query as I'm not aware of SQL Server queries.

    Thanks

    Regards,

    pstanand

    I did provide 2 queries which should be 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: Do subqueries Kill the Performance of Server

    I would actually leave the last 3 subqueries. I'd probably move them to the from using the APPLY operator. The reason is that those seem to be unrelated quantities which...

    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!

    mjagadeeswari (4/28/2016)


    djj (4/28/2016)


    ThomasRushton (4/28/2016)


    Ed Wagner (4/28/2016)


    whereisSQL? (4/27/2016)


    jeff.mason (4/27/2016)


    Luis Cazares (4/27/2016)


    Ray K (4/27/2016)


    Ed Wagner (4/27/2016)


    Big Brother

    Big Sister

    Candace

    Bergan

    Actress

    Lead

    Balloon

    Helium

    Atom

    Arrow

    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: Extract string from same column

    If they're all renaming queries, this could work.

    WITH SampleData AS(

    SELECT 'EXEC sp_rename @objname = N''PK_Filegroup_Tables_ID'', @newname = N''PK_FilegroupTables_ID'';' as Script UNION ALL

    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: Count differs while using the date values

    The operator BETWEEN is inclusive. The common way to do this is to write the range. Also, for using only dates, the ISO 8601 short format is preferred.

    select count(1) from...

    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!

    Ray K (4/27/2016)


    Ed Wagner (4/27/2016)


    Big Brother

    Big Sister

    Candace

    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: String Together Mulitple fields when not NULL

    Or if you're on 2012, you could use CONCAT.

    SELECT ID,

    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: SQL help - I need the last day for the last month in YYYYMMDD format

    Shorter version without the need of scalar functions.

    DECLARE @Date SMALLDATETIME = GETDATE();

    SELECT CONVERT( char(8), DATEADD(MM, DATEDIFF(MM, 0, @Date), -1), 112);

    More formulas: http://www.sqlservercentral.com/blogs/lynnpettis/2009/03/25/some-common-date-routines/

    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: sql query issue

    cajsoft (4/27/2016)


    Luis Cazares (4/26/2016)


    You might need to use a recursive CTE if you can nest more than one level.

    Remember, with a good DB design this would be as easy 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: help in designing table(saving multiple values for one PK value in one row)

    I agree with Sean comments. Database design can be something complex without the proper formation. For instance, you're not designing a table, you're designing a database with several tables.

    You need...

    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?

    Sean Lange (4/26/2016)


    Alvin Ramard (4/26/2016)


    Ed Wagner (4/26/2016)


    Luis Cazares (4/26/2016)


    Wonder if I should answer: "Using INSERT statements"

    http://www.sqlservercentral.com/Forums/Topic1781117-1550-1.aspx

    Well, you would be correct. Tell them to create the table first. 😉

    Tempted to...

    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: Audit information in to table

    New persopn (4/26/2016)


    I am not getting any references in online

    Check this article: http://weblogs.sqlteam.com/jeffs/archive/...er.aspx

    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: Audit information in to table

    New persopn (4/26/2016)


    Currently I am capturing Audit information in to file.

    How?

    What are you auditing?

    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 (4/26/2016)


    whereisSQL? (4/26/2016)


    Ed Wagner (4/26/2016)


    Luis Cazares (4/26/2016)


    Ray K (4/26/2016)


    Ed Wagner (4/26/2016)


    Song

    Music

    Sound

    Waves

    Ride

    Horse

    No Name

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