Forum Replies Created

Viewing 15 posts - 1,846 through 1,860 (of 1,917 total)

  • RE: Dynamic SQL

    Oh man, i very nearly pulled this thing out without CASE and DYNAMIC-SQL...

    here is the code; if in future u are planning to append many extra columns, say e,f,g...

  • RE: Incorrect Syntax near GO

    Is your .Net Code executing the .sql thro sqlcmd/isql or is it reading the whole database creation query into a string and then executing the string using ExecuteQuery ?

  • RE: Incorrect Syntax near GO

    Hmmm..

    Tel me if u did this:

    1. You Right-click on the database, "Create To" to a new SQL Server Window

    2. SAve this script as .sql file

    3. And now u are trying...

  • RE: Incorrect Syntax near GO

    For SQL Server 2005, the compatiblity level can maximum be 90 and there is no command like HONOR_BROKER_PRIORITY

    I tried this code in both SQL 2005 and 2008. i got error...

  • RE: Incorrect Syntax near GO

    One doubt mate, are u trying to run this piece of code in SSMS 2005 or SSMS 2008?

  • RE: Nice one, please read and give your comments.

    Mate, are u sure we have instr function in SQL Server ? :blink: :blink:

  • RE: Dynamic SQL

    I agree with Lynn here... CASE statements look appropriate here and to my knowledge readable too, then why would you prefer dynamic SQL??

    here is a sample code with CASE statement...

  • RE: I don't know how to do it :(

    I always ask people to look up to your post on forum etiquettes Jeff.. i will add that to my signature as well 🙂

  • RE: I don't know how to do it :(

    Exactly Jeff!!

    When the OP is unclear then we are explicitly type-casted to be unclear 😀 :w00t:

  • RE: Dynamic SQL

    rahul.koduru (4/5/2010)


    But, the example I provided is really a short version of what I really need.

    In the actual problem,

    thats the turning point, please be specific with what your requirement...

  • RE: Dynamic SQL

    Thanks Lynn for checking that out!! i was kind of reluctant to post it without testing.. now that u tested and decorated the code, the OP can directly us that.....

  • RE: Deleting the columns from the same database through the script

    hi there, here is the code u asked for.. check the output of this from that print statement.. if that matches your requirement, uncomment the exec part and your requirement...

  • RE: Dynamic SQL

    I understood partially your requirement and here is the code for that

    SELECT

    CASE LOOKUP.COL1

    ...

  • RE: I don't know how to do it :(

    Jeff Moden (4/5/2010)


    That will work for only 1 level of approval.

    Jeff i did not have the time to execute the query, my bad :doze:.. but the solution using the recursive...

  • RE: I don't know how to do it :(

    the solution i have provided is created by me closely following the recursive-cte explanation give in BOL 2008 (http://msdn.microsoft.com/en-us/library/ms186243.aspx).. excellent article with the example walk-thro.. u ll find it very...

Viewing 15 posts - 1,846 through 1,860 (of 1,917 total)