September 5, 2006 at 5:52 pm
Fairly new to SQL server and while I'm pretty familiar with it, I have a ways to go yet. My problem is this:
Using SQL Server 2000, I've used Enterprise Manager to create a view that uses an INNER JOIN to join about 6 tables together. When you check the fields to include in the table view, it adds them to the SQL Select statement in the order that you selected them. I've since gone in and added Aliases to each of these fields to make them easier for the end user to understand, but would like to be able to re-sort the order that the view displays the fields, so that there is some logic to it rather than just the order I picked them in the tables. I'd like to go alphabetically by the alias, so it makes it fairly easy to find the field you are looking for. Any help would be appreciated. Please let me know if you need clarification or have any questions about what I'm trying to do.
- Josh
September 6, 2006 at 11:01 am
Copy ther select statment generated by Enterprise Manger in to Query analyser and adjust the select statement to suit your needs and past it back to the view.
Hope that answers your question.
Thanks
Sreejith
September 6, 2006 at 11:06 am
I had already thought of that... problem being I have a large number of fields (in the vicinity of 250) and that would take a little less time than unchecking and rechecking all the fields.
September 6, 2006 at 7:18 pm
Sounds a little whacked but with 250 columns, might not be as whacked as you think... copy the columns in the SELECT list to a text file (copy and paste them into any text editor). Import the file into EXCEL using space as the delimiter. Sort the resulting spreadsheet by the alias column. Copy and paste from EXCEL back to the SELECT list.
--Jeff Moden
Change is inevitable... Change for the better is not.
September 6, 2006 at 8:34 pm
I actually thought about doing this but the only issue is that my Aliases have spaces, so they are getting split up, which washes out any time I may have saved in Excel. Now I can use [ as the delimiter, but then I'm going in and readding it... unless.... oh I just had a stroke of Genius. I'll let you know how it works out
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply