Thank you for the response.
Sorry, I guess I wasn't completely clear. When I wrote the nested select statement 'Select B.Test3 From B', I should've actually written 'Select TOP 1 B.Test3 From B Where ...'. So unfortunately I can't use the method you provided.
That's why I'm trying to use the...
Hello,
I've got a stored procedure that builds a dynamic SQL satement and then assigns it to a varchar variable.
I would like to know if if's possible to declare a variable from within a select statement. I keep getting the 'Incorrect syntax near the keyword Declare' error.
For example...
Wow, another quick response...thanks
Yup, you understood correctly. Funny that's actually what I had to do to make the query run, but I wanted to use the @tmp variable to avoid having to run the statement (Select B.Test3 From B) again if @tmp wasn't empty (in hopes of speeding up the query)...
Thank you very much for the quick reply.
Unfortunately it still doesn't work. I might not have explained the situation completely. The stored procedure is actually building a dynamic SQL satement and then assigning that to a varchar variable.
So it's more like:
DECLARE @myStr varchar(1000)...
Hello,
I would like to know if if's possible to declare a variable from within a select statement. I keep getting the 'Incorrect syntax near the keyword Declare' error.
For example:
SELECT A.test1, A.test2, (DECLARE @tmp INT SELECT @tmp = (SELECT B.test3 FROM B) CASE WHEN @tmp <> 0 THEN @tmp...
Thank you both for your help. I tried changing the settings (firewall, etc.), but still no luck. In the end I opted to have an onclick event that calls a routine which shells the application. It's one way to get around the problem.
Hello,
I'm hoping someone can help me. I've got a web page that creates an excel file client side and saves it to the client's temp folder. The page then displays a hyperlink (File://...) to that file. Before SP2 there were no problems, the file would open normally, but now even though the...
You're welcome kaylabear,
Maybe you could provide me with a little more detail. What exactly do you mean by 'declared again and again'? What I was referring to would mean that you would declare the variable once, perhaps in a form_load somewhere.
Hi,
You could just do a GetSetting() and check for an error(if the registry entry was not created yet). If the entry wasn't created yet, set it to 1, otherwise add 1 to it.
Basically remove the setting of the entry to 1 everytime you start the program.
Let me know if that doesn't answer your...
Hi,
Does anyone know how to force a form to the front, but only within the calling application (hopefully using the SetWindowPos API)? I have a form that is displayed showing a progress indicator (therefore I don't want the form shown modally, which would halt program execution). I want the...
Thank you all for your input. I'm trying to make this as generic as possible. I wanted to avoid using an array or collection. I'm dealing with multiple grids (each with many columns). I'm probably dreaming in technicolor, but does anyone know of a property of the MSHFLEXGRID that can return...
Hello,
I'm hoping somebody can help me out. I'm using the double click event of an MSHFLEXGRID to sort a column selected by the user. I have multiple columns with different data types (dates, integers, strings). The problem is that whatever sort property I choose, it doesn't sort all data...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.