Forum Replies Created

Viewing 15 posts - 4,096 through 4,110 (of 5,502 total)

  • RE: Create view issue

    lmu92 (3/3/2010)


    Add a line break before your GO statements:

    SET @SQL ='USE '+@DESDB+'

    GO '

    SET @SQL = @SQL+'

    CREATE VIEW '+@NAME+' AS SELECT * FROM '+@BASEDB+'.DBO.'+@NAME+'

    GO'

    Did you even tried that code???

    There...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Complex T-SQL query

    BaldingLoopMan (3/3/2010)


    ... I think he means. ...

    That's one possible direction. But instead of guessing I'd like to know.



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Create view issue

    balbirsinghsodhi (3/3/2010)


    I added char(13) also but no success..

    Msg 102, Level 15, State 1, Line 1

    Incorrect syntax near 'GO'.

    Msg 111, Level 15, State 1, Line 2

    'CREATE VIEW' must be the first...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Convert 0000 into 00:00 format

    It depends on several things:

    What is the format the original values are stored as?

    How do you want to display times before 10:00 (w/ or w/o leading zero)?

    Why is'n it stored...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Help with TOP clause

    @gcresse:

    If you compare ALZDBA's solution and mine you should focus on the different interpretation of where the ORDER BY section would apply to.

    Also you'll see a difference if you have...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Querying a Table Using Dynamic SQL

    @steve-2:

    The disadvantage of your solution is that you have to have a aclumn named "deed_name" within each table you want to apply that dynamic query to.

    Therefore, I decided to use...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Create view issue

    Please post the value of @sql and the error message.



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Create view issue

    Add a line break before your GO statements:

    SET @SQL ='USE '+@DESDB+'

    GO '

    SET @SQL = @SQL+'

    CREATE VIEW '+@NAME+' AS SELECT * FROM '+@BASEDB+'.DBO.'+@NAME+'

    GO'



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Complex T-SQL query

    Unfortunately, your sample code won't run since you defined ID as being identity but you're trying to insert value 13 for every row.

    Please clean up your sample code and run...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Querying a Table Using Dynamic SQL

    Would something like the following will do it?

    Side note: this will only work if you always provide an ORDER BY clause since this is required for the ROW_NUMBER function....

    SELECT @V_QUERY_STR...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Help with TOP clause

    First of all: thank your for taking the time to set up the sample data!!

    Made it really easy to work on! Great job :Wow:

    Here's what I came up with:

    ;WITH cte...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Help with TOP clause

    Would you please provide table def, some sample data and expected result? I'm sure it's possible to do it without dynamic sql but I'd like to have something to play...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Insert multiple records for a single ID

    Instead of that verbal description would you mind setting up some table definition (target table), input values that are provided and expected result set in your target table.

    If you'd like...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: need description of these tables

    Try the following:

    Open Query Editor (or whatever the name was back in SQL 2000... I simply forgot). Highlight the word "sysobjects" and press {F1}. IIRC it will open the...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Querying a Table Using Dynamic SQL

    Jeff Kring (3/3/2010)


    I did look into ROW_NUMBER as an option. I could use it to return the correct rows, but the application needs the actual value as well.

    I don't...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

Viewing 15 posts - 4,096 through 4,110 (of 5,502 total)