Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

HOW TO REPLACE A WORD FROM THE END OF T SQL STRING

Avatar of Mahesh Yadav
Mahesh YadavFlag for India asked on
Microsoft SQL Server 2005
6 Comments1 Solution406 ViewsLast Modified:
I am running a while loop in my sql query
and creating a sql string, which I am executing at the end.

I am adding Union All in the sql server inside the while loop.

now I want to remove the last Union all from the sql string before running it otherwise I am getting an error becasue after last Union all there is no sql statements because the while loop ends.

Can any one help me out here, how can I replace the last union all from my sql string.
ASKER CERTIFIED SOLUTION
Avatar of nativ
nativ

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 6 Comments.
See Answers