Forum Replies Created

Viewing 15 posts - 7,666 through 7,680 (of 8,731 total)

  • RE: Are the posted questions getting worse?

    Sean Lange (9/27/2013)


    Luis Cazares (9/27/2013)


    Today, I'm really pissed off with the database and network administrators. Because of the lack of good planning and best practices, instead of restrictions to our...

    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?

    Today, I'm really pissed off with the database and network administrators. Because of the lack of good planning and best practices, instead of restrictions to our users permissions, they decided...

    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: Find a character in string

    Sean Lange (9/27/2013)


    Could do this with a case expression also so there is no need to use CAST.

    select case when CHARINDEX('%', @Test) > 0 then 1 else 0 end

    But CAST...

    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: Query that returns only columns with data

    Why would you need this?

    To achieve this, you would need to build a dynamic query and the process might be very inefficient. If you're trying to determine which columns are...

    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: Newbie needs help with a query!!

    Can you explain your problem? I don't understand how do you define your business rules.

    Why are you using char(10) instead of a proper data type for time?

    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: Save float valur with a stored procedure adds some decimal numbers

    That's because float and real are not exact numeric data types, they're approximate numerics and can generate different values than the ones intended.

    Data Types (Transact-SQL)

    float and real (Transact-SQL)

    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: listing of months for a particular year

    For a more complete answer, please take a look at the article linked on my signature.

    For an explanation on the pivot query, check the following articles:

    Cross Tabs and Pivots, Part...

    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 aborts on first FK violation

    I'm not sure if bcp would allow you to do that. However, you could load all data to a staging table and insert clean data into your final table 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: how to replace this cursor with set based solution?

    Be careful on using table variables, they might reduce performance on your query depending on the number of rows. You should test what's better for your performance (temp table, 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: how to replace this cursor with set based solution?

    It was easy to find the solution with the DDL and sample data you posted (I had to run the original query to get the expected results).

    The important thing...

    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 replace this cursor with set based solution?

    An OUTER APPLY might do the job. There might be another option, but this looks like it should work fine.

    INSERT INTO RunsByBench

    SELECT BenchName AS BenchName,

    COUNT(CreateDate) AS NumberOfRunsOnBench,

    MAX(CreateDate) AS LastRun

    FROM @benches...

    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: Find a character in string

    Try CHARINDEX and you could CAST it to bit so you will only get 1's and 0's.

    Select CAST( CHARINDEX('@', 'AGDJS@JDJD') AS bit)--will show as 1

    Select CAST( CHARINDEX('@', 'AGDJSJDJD') AS bit)...

    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: Phone number question - detecting and replacing

    You have a nice plan and good ideas, but I would really suggest a different approach on the splitter. Check the following link to improve the performance of your strings...

    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: Query help - summarize data with some complexities - TSQL gurus needed

    Some people are just crazy and ask for weird things on reports.:-D

    You helped a lot by posting all the ddl and sample data. With that and knowing the right techniques,...

    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: Query help - summarize data with some complexities - TSQL gurus needed

    I'm curious, why would you want to do this? I'm posting a way, but I'm bnot sure if it's the best idea to do it on SQL Server (and I'm...

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