Forum Replies Created

Viewing 15 posts - 856 through 870 (of 1,183 total)

  • RE: Can be CTE referenced within view?

    CREATE VIEW dbo.cte_view_test

    AS

    WITH cte_test

    AS

    (SELECT id, val FROM dbo.test)

    SELECT

    id,val

    FROM cte_test

    Where test is your table

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Can be CTE referenced within view?

    The quickest way to answer that question is to try it. 😛

    Yes, a CTE can be used in a view. You should then be able to reference the view in...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Help producing a Data-Driven Subscription that runs only when new data is added

    I humbly :hehe: submit this article http://www.sqlservercentral.com/articles/Development/2824/.

    I'm sure you can use this method by either creating a Trigger to fire it, or a scheduled job.

    Hope this helps....

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Need help with stored procedure with cursor

    Are you positive that the data in the "first" row is unique?

    What happens when you run the query commenting out the insert?

    How many entries for the first row?

    Now the bad...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Need help with stored procedure with cursor

    1. Move your "FETCH NEXT ... INTO" just after your "BEGIN" in the WHILE loop.

    2. You might also read up on Triggers. BEFORE UPDATE triggers would be another way to...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Need help with stored procedure with cursor

    Well, my suggestion would then be to alter your table and change the key to an IDENTITY column. Tie-ing yourself to a procedure that gets the next key for a...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Need help with stored procedure with cursor

    Kenena,

    What exactly does the procedure "SequenceValue 346, @Gridkey Out" do? I would assume this is giving you a key to use, but what else does it do?

    The reason I ask...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Arranging the data??

    They do on my machine.

    Wait, do you mean Query Analyzer or Management Studio? They show in SSMS.

    I can definitely see that Steve and the guys need to work on...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: How do I selectively get rid of portions of the where clause based on user entry

    I'm not sure with the multi-select parameter feature in RS 2005.

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: How do I selectively get rid of portions of the where clause based on user entry

    Set a default value for the (@office) office parameter to something like "N/A" and then change your query to...

    Select Date, Office, Name from Info_table

    Where Date >= '01/01/2007' and

    Date <= '02/01/2007'

    and...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Convert positive number to a negative

    David Burrows (10/16/2007)


    * -1 should work

    what is the datatype and what makes you think it did not work

    btw

    preceding a column or variable with - will achieve the same, eg

    DECLARE...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: How to search and replace multiple stored procedures?

    Right, you search for "vmdproduction" and it will give you a list of all objects that have the server name hard-coded. You can then copy the SQL from the results...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: How to search and replace multiple stored procedures?

    Not sure about the replacing, but SQL Digger is pretty handy and will find all of the objects that need modified.

    http://sqldigger.bdsweb.be/

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: complex select problem w history tables, date ranges

    OK, My turn to test. ...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Union Query in Reverse

    Sometimes your just TOO close to a problem to see a simple solution. I know I've been there many times!

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg

Viewing 15 posts - 856 through 870 (of 1,183 total)