Forum Replies Created

Viewing 15 posts - 1,426 through 1,440 (of 2,917 total)

  • Reply To: While loop

    CTE's are not the only way to do it.  Nested selects would be another option, or you could do the calculation outside of SQL at the application layer, or you...

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

  • Reply To: While loop

    So, I think the problem you are having is that you are doing the update based on a VARIABLE not a COLUMN VALUE.  Change:

     UPDATE [dbo].[DTable] SET...

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

  • Reply To: Substring SELECT query from CREATE VIEW statement

    One thing to be cautious of that I didn't think of until today (just now) - AFTER getting the "final" string, you may want to check for a WHERE clause...

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

  • Reply To: Magic Tables in the SQL Server

    My goal was not to "stump" the interviewee, but to see if they had knowledge of SQL Joins and if they could do basic problem solving based on the words...

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

  • Reply To: Substring SELECT query from CREATE VIEW statement

    I don't think you are going to have a nice "one size fits all" solution here.  You are probably going to need to be creative and do multiple SUBSTRINGs or...

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

  • Reply To: Need help trying to find MAX Value in column

    My first comment on this is with the TagName appearing in the WHERE clause, you likely don't need to worry about the CASE statement in the MAX.

    Looking at the result...

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

  • Reply To: Magic Tables in the SQL Server

    I just wanted to add my vote that I have not heard the INSERTED/DELETED tables being called "magic tables" before.  I am also not sure what "deep information" you are...

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

  • Reply To: Can I complete missing dates or points by performing a backward already exist CS

    That sucks for point number 1.  So you will need to dump it to DTL then convert to CSV then import to SQL which means 3 copies of the data...

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

  • Reply To: Error: when trying to start SSIS

    Missing DLL would lead me to believe this was an incomplete install.  I would do a repair install of SSIS on that system and see if that helps.

    If this is...

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

  • Reply To: Find Average Row Size and Num of Rows per page for a table

    ScottPletcher, I agree with you.  I think what makes it difficult is that rows can have different lengths.  A VARCHAR(8000) row for example, could be anywhere between 1 byte and...

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

  • Reply To: Find Average Row Size and Num of Rows per page for a table

    So, I don't know the exact formula, but I can answer some of the questions.

    Multiplying by 1024 would be to change it from KB down to B. A single row...

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

  • Reply To: How to get parts that not have same features count on table settings by code typ

    I see multiple ways to handle this.  My approach would be to count the number of unique feature keys in the #settings table and store that in a variable so...

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

  • Reply To: Filtering Customer Specific Data

    Are the customers able to export the data from the reports into something like Excel?  If so, then problem solved - push it back on them.

    If they CAN'T export to...

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

  • Reply To: The case for SQL Server Agent 2.0

    @g.britton In a SQL a agent job, you can call to start a job asynchronously.  So one way to do it is have a 2 jobs.

    Job 1 step 1 when...

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

  • Reply To: Merry Christmas 2020

    If memory serves, it is because RAND() is only semi-random.  You need to provide a "seed" which will be used to make it (again) semi random.

    RAND() returns a consistent list...

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

Viewing 15 posts - 1,426 through 1,440 (of 2,917 total)