Showing posts with label studio. Show all posts
Showing posts with label studio. Show all posts

Wednesday, March 28, 2012

Query Problem!

Hello!
I am using Visual Studio 2005 and Microsoft SQL Server 2005 Express Edition.
I have a table like this in my db:

-- MyTable ------------------------

id name
1 ??????????
?????????? ??? 2

-----------------------------

You can see non-english characters under name.
Now it is my query:
SELECT *
FROM MyTable
WHERE (name LIKE '%??????????%')

But it doesn't bring up any results... I have used = sign, but it doesn't do anything...

Why?

Sorry for my poor EnglishWhat is your data type andcollation setting for the Name column?|||

Try LIKE N'%....'

Sorry if it doesn't work, I don't usually work with foreign characters that way, I would use a parameter and let the user type whatever they needed.

|||It works! Thanks.

Monday, February 20, 2012

Query Linked Server?

Using SQL 2005 Management Studio to access a SQL 2000 Database.
While in the SQL 2000 Database have created a Link server so in Object
explorer it shows a folder called Link Server\DataServer1. I am unable to
query it.
Using windows authentication. Not sure how to query DB from SQL2000. Do
you have to also include anything special like user name and password?
Not able to get the Linkserver control to work.
thanksAre you able to view the objects of the linked server in the object explorer
.
f so, then you can use a 4 part name to access the tables.
Hope this helps.
--
"Harry" wrote:

> Using SQL 2005 Management Studio to access a SQL 2000 Database.
> While in the SQL 2000 Database have created a Link server so in Object
> explorer it shows a folder called Link Server\DataServer1. I am unable to
> query it.
> Using windows authentication. Not sure how to query DB from SQL2000. Do
> you have to also include anything special like user name and password?
> Not able to get the Linkserver control to work.
> thanks
>|||i can see the Linked server in Object explorer. i recall a code that used
open data source to try and query data from it. i am not able to find it
anymore.
Still not working.
If I am directly on the SQL 2000 server and run my query to the ODBC Linked
server it works fine.
Not sure how to resolve the connection issue when I am using 2005 management
studio to connect to the SQL 2000 database and from there query data from th
e
linked server so I can write back to the SQL 2000...ahh I am !
--
Harry
"Omnibuzz" wrote:
> Are you able to view the objects of the linked server in the object explor
er.
> f so, then you can use a 4 part name to access the tables.
> Hope this helps.
> --
>
>
> "Harry" wrote:
>