Forum Replies Created

Viewing 15 posts - 10,666 through 10,680 (of 13,460 total)

  • RE: How do I return the third Friday of the current month?

    i had the first monday of this month as an already saved snippet;

    her's the step by step on how i got the third friday:

    now instead of adding two weeks as...

    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: Editing an SQL Stored Procedure

    thanks for the feedback;

    can you clarify, you wanted to edit the procedure so it only returned results for 'CONSUME','SLOFF' and not all 5 values? was that the objective?

    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: Editing an SQL Stored Procedure

    there was a syntax error in the OR portion of the where statement where a minus sign should be an OR;

    'SLOFF' - mx_2 = 'UNCONSUME'

    should be

    'SLOFF'...

    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 set defaults on a join

    sure...the ISNULL or COALESCE function can do what you want:

    create view myView

    as

    select

    tableA.col1 as cola1,

    tableA.col2 as cola2,

    ISNULL(tableB.col1,'no selection') as colb1, --assuming...

    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 Range of occurences of consecutive String Values?

    misread the requirement...how about this:

    SELECT

    IssueNumber,

    Status,

    min(ActivityDate) As ActivityDate,

    min(EndDate) As EndDate

    FROM(

    select MyAlias.* ,myAlias2.ActivityDate as EndDate from

    (select

    IssueNumber,

    ...

    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 Range of occurences of consecutive String Values?

    thank you for the DDL and sample data; that makes it SO easy to test and offer suggestions;

    will row_number give you the data you are looking for?

    try these two SQLs...

    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 be notified when a insert/update happens?

    Yeah, SQL Server is really stateless in that situation, like a web page would be...unless you poll for a new snapshot of data,and compare against your local cache to see...

    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 be notified when a insert/update happens?

    well it can be done...but the better question is do you really want to....you might not after you think through the ramifications...

    lets assume that someone adds a new record and...

    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: Assistance On A Delete Statement

    correct me if I'm wrong, but i think you want to find the first Monday of the month, and delete anything prior to that?

    is that right? or do you want...

    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 Server 2005 Insert Delete Trigger causing Access 2003 Forms to lose master-detail linkage

    as Steve identified, your trigger is designed for just a single row of data.

    here's a version that should handle multiple rows gracefully.

    compare it to yours and see how it simplified...

    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: I have results now showing in my grid when I use varbinary(max)

    by default, SSMS only shows the first 255 characters in text mode, so your results are being cut off.

    Tools>options, and go to the spot below, icrease it to 8000 and...

    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: PeopleSoft searches go from 4 seconds to 20 seconds

    do you know if the search call is coming from a stored procedure?

    that's the next thing i'd look at, was parameter sniffing. if the procedure being called has any...

    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 allow certain applications (not users) to hit the database

    you could use a LOGON TRIGGER, and test the app_name() = 'Microsoft SQL Server Management Studio Express - Query', and deny the logon attempt if it is not in...

    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: PeopleSoft searches go from 4 seconds to 20 seconds

    most likely manually updating statistics more often would resolve the issue;

    statistics only get auto-updated(assuming auto update is ON) if 20% of the rows in a table have changed...

    on a...

    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: Last Modified

    heres a generic example; if you post your actual table definition, we could tailor the example to your actual table:

    Create Trigger TableName_Update On TableName For Update As

    Update Tb

    ...

    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 - 10,666 through 10,680 (of 13,460 total)