Viewing 15 posts - 1,846 through 1,860 (of 1,917 total)
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...
April 6, 2010 at 6:01 am
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 ?
April 6, 2010 at 4:25 am
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...
April 6, 2010 at 4:16 am
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...
April 6, 2010 at 4:06 am
One doubt mate, are u trying to run this piece of code in SSMS 2005 or SSMS 2008?
April 6, 2010 at 4:01 am
Mate, are u sure we have instr function in SQL Server ? :blink: :blink:
April 6, 2010 at 1:14 am
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...
April 5, 2010 at 10:40 pm
I always ask people to look up to your post on forum etiquettes Jeff.. i will add that to my signature as well 🙂
April 5, 2010 at 10:31 pm
Exactly Jeff!!
When the OP is unclear then we are explicitly type-casted to be unclear 😀 :w00t:
April 5, 2010 at 8:53 pm
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...
April 5, 2010 at 8:51 pm
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.....
April 5, 2010 at 8:46 pm
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...
April 5, 2010 at 8:41 pm
I understood partially your requirement and here is the code for that
SELECT
CASE LOOKUP.COL1
...
April 5, 2010 at 8:25 pm
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...
April 5, 2010 at 7:48 pm
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...
April 5, 2010 at 3:50 am
Viewing 15 posts - 1,846 through 1,860 (of 1,917 total)