Hi there,
I am currently working on a project which involves the implementation of some database seraching based on user input.
I need to mimic the functionality of a search engine search box in my search - i.e. parse characters such as "", +, - , or etc. to create advanced search criteria.
I...
Thanks for your help guys, and apologies for my donkey-ness in accidentally posting it in an Exchange forum.
I was trying to do it this way, but it just wasn't happening for me. Maybe I was being too lazy to sit and do it properly, but anyway, I think I have found a solution using a couple of...
I am trying to do something which I thought would be really easy, but is proving not to be...
TO give you an overview...
We (my company) have a hosted web server, and a local in-house web-server. The hosted web server acts as a remote backup / redundancy for our local system.
The hosted...
I am doing a rather complicated query which includes within it, two subqueries.
The two sub-queries calculate two individual values.
I need to add a third column to the query which will show these two values added together, but can't seem to achieve this. Any help would be most appreciated...
ugh, can't believe it is that complicated!!
Will have to rethink things a little!
BTW - SQLSister - apreciate what you are saying with the rant but I do know this, I just said select * as an example.
Thanks for everyones comments.
yes, I know it is harcoded, but the value for @TableSelect will be used many times in a large script.
I'd like to be able to change the variable at the top of the script and have it reflect all the way down the script without having to go through and do a "find and replace". I know this sounds...
Well, as I said in my original post, I need to be able to do:
select * from @variable
where...
or, something which will give the same results.
Lara's suggestion returns me the value of the variable in a resultset which is not what I need to do.
I presume you are looking at the db through Enterprise manager?
If so, have you clicked the refresh button on each view after running the script. An annoying thing about Enterprise Manager is that just expanding the various views in the tree (e.g. Tables, Views, etc) does not refresh their...
Lara, I know I can do this, but I really need to build the select statement where the table name comes from a variable. Is there not anyway that i can do this?
Thanks.
Phil.
Can anyone tell me why the following SQL statement doesn't work? I get an error telling me I must declare "@TableSelect".
And can anyone tell me how to change this code so that it does work?!
-------------------------------
Declare @adminuser varchar(20)
Set @adminuser = 'admin'
Declare...
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.