Forum Replies Created

Viewing 15 posts - 1,486 through 1,500 (of 13,460 total)

  • RE: Query fails with invalid column name but succeeds as a sub-query with unexpected results.

    this is because you have a correlated subquery, mostly due to bad aliasing. it's not a bug, but a behavior that occurs when you don't code correctly. properly aliasing columns...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: SQL Query Sort order is correct, but Reporting Services report shows different

    whoops i menat by hour and not description... changed above.

    ORDER BY cte.StartDateTime,r.hour_number

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: SQL Query Sort order is correct, but Reporting Services report shows different

    if you were gettign help in another thread, you probably should have continued in that thread, instead of a new post.

    looks like this would work to me:

    ORDER BY cte.StartDateTime,r.hour_number

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: SQL Query Sort order is correct, but Reporting Services report shows different

    you must have an explicit ORDER BY in your query to guarantee the data appears in a specific order. you stated you have no order by, so that is the...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: When renaming a table, it doesn't rename the foreign key constraints, correct?

    Rod at work (9/21/2015)


    I hadn't thought of renaming the foreign key constraints. That's an interesting idea. However, even if I did rename the foreign key constraints they're definition would still...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: When renaming a table, it doesn't rename the foreign key constraints, correct?

    you are correct, only the table would be renamed.

    you can rename each of the constraints, separately, one at a time, if you wanted with sp_rename, which you had already identified.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: SSIS script to create folders

    Newbie36037 (9/21/2015)


    Cheers Lowell,

    With a bit of tweaking that gave me what I needed, and saved me hours of frustration

    what did you have to tweak? your answer might save someone else...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Cannot Drop Table with Non-Printable Character on its name

    its possible it was marked as a system object; try sys.all_objects instead.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Cannot Drop Table with Non-Printable Character on its name

    can you try assigning the name to a variable and renaming it?

    DECLARE @tb sysname

    select @tb = name from sys.tables where name like 'Table%' and name like '%Name'

    exec sp_rename @tb,'Table_Name'

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: SSIS script to create folders

    the sub folders would server no purpose then,except make the processing a little more difficult. processing a single folder vs lots of subfolders just adds to teh complexity of later...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: How to print state of running query to output?

    i assume by you saying "But print statement dos not work correctly!!" you mean they don't print when you want them to, but when the batch completes, right?

    you can use...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Resending dbmail using the attachment stored in sysmail_mailattachments

    i have this saved in my snippets, I've only used it a handful of times.

    rather than rebuilding the emails, it's just re-queueing the email as however it was originally built:

    declare...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Date format got changed b/w two different version of SQL Server for the same web request

    if the parameters are datetime data types, it should not make any difference, right?

    the values are valid, you are not getting errors, you just happen to see the difference...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: SSIS script to create folders

    rather than an arbitrary count of 1000 or some other static value, would it make more sense to put files in folders based on the dates?

    you could group by month,...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Search through rows with specific values

    GREAT job providing the setup.

    in this case, since you have to check for two values,, i think you want to join the table against itself.

    you can join the same table...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 15 posts - 1,486 through 1,500 (of 13,460 total)