|
Hi
You can select these fields by LIKE operator
Example:
SELECT * FROM MyTable WHERE MyField LIKE %c "bil" c%
|
|
|
|
|
Hi
Excuse me
Your code look like this
SELECT * FROM MyTable WHERE MyField LIKE '%bil%'
|
|
|
|
|
Thanks My friend
it's ok
jooooo
|
|
|
|
|
Hi..
Iam trying to connect to a host sql server 2000 using SQL enterprise manager.I made it successfully using one of my desktop computers but I could not do it using my new Laptop.When I try I get the error:specified sql server not found.I dont know what cause this problem.May be because I have Mcafee installed on this laptop But I don't know how to fix this problem?.
Please any advice could be helpful.
-- modified at 11:01 Saturday 10th March, 2007
I am too late but i will never give up
|
|
|
|
|
You've either got a name resolution problem or a firewall issue.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
May you explain to me what do you mean by name resolution problem?
I am too late but i will never give up
|
|
|
|
|
Open a CMD prompt and type PING sqlServerName like it shows in your connection string. If it doesn't come back with an IP address, your machine can't resolve the name, and hence, can't find the IP address of the server.
If if CAN get the IP address, but the server doesn't respond, you either have a network routing issue or a firewall or two in the way.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
It gives me the IP and other data about sent and recieved packets.
What could I do to solve this problem?
I am too late but i will never give up
|
|
|
|
|
The TCP/IP stack of the target machine responds. It didn't tell you anything about the SQL Server that's apparently either not running on it or is being blocked by a firewall.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thank you very much for all these valuable informations.I have change some network settings in mcafee and install some updates then I delete the old SQL server registeration and add a new one with the same settings but with a different name and it works.May be the old name was similar to one of the SQL servers in the network and it caused some kind of conflict.But now every thing is working perfectly.
Thank you for helping me all the time.
I am too late but i will never give up
|
|
|
|
|
Hi
I have a table
ID Name THEAD VAlue
-------------------------
1 Anish H1 400
2 Anish H2 300
3 Joseph H2 600
4 Joseph H1 100
5 Anish H3 50
6 Joeph H3 60
------------------------
Can I get output as shown below
Name H1 H2 H3
----------------------
Anish 400 300 50
Joseph 600 100 60
--------------------
regards
anish mm
|
|
|
|
|
You need PIVOT functionality.
What database and version do you use?
|
|
|
|
|
Ofcourse, but with some restrictions,
such
how many h1 h2 h3 exists bcs they will becom coulmns
Perhaps there will be a temp table #T(name nvarchar(x),[h1] integer,...)
and over some loop or cursor(wich is slow) u will fill the #T
|
|
|
|
|
Hi
Can you send me the table structure and with same data? You need to use CrossTab SP. I will modify it based on your table structure and will mail you.
Harini
|
|
|
|
|
Hi every one,
Well I’m working on this project that requires the database to be replicated on another server as well. I’m working in SQL server 2000 Enterprise Ed. And this is my first project of that sort. It also requires a little horizontal partitioning of rows of some tables. Now I’m trying to get this replication going but every time its giving me errors. I’m trying to establish transactional replication here and the servers are connected over LAN.
Right now I’ve tried doin it by making a new database in the subscriber and selecting the option to ‘make new schema and data’ and already ‘existing schema’ as well. In the first case it gives me error that the
‘ALTER TABLE statement conflicted with COLUMN FOREIGN KEY SAME TABLE constraint 'FK_Products_Products'. The conflict occurred in database 'Server_ATech', table 'Products', column 'CatID'.’
And while I was not initializing the schema it gave me an error over the absence of a stored procedure and that one looked like something related to replication but anyway…
Now I don’t have any idea what else to do… plz tell if it’s a good idea to make a single publication when ur having abt 40 tables to replicate. What should I do… or more likeably; how should I do it???
Please help me as early as you can coz I really have a very short time to complete this thing.
Thanks in advance,
Rocky
|
|
|
|
|
Rocky71 wrote: And while I was not initializing the schema it gave me an error over the absence of a stored procedure and that one looked like something related to replication but anyway…
There is an option while creating the article that specifies whether to call stored procedures to insert,update,delete data or use queries (third tab I think, I don't have SQL 2000 now) Try to use queries not stored procedures.
Also check:
Setup Transactional replication: step by step guide[^]
|
|
|
|
|
hi
i'm doing somtehing like that right now, using linked servers and remote sp.
|
|
|
|
|
yea well, I've kept on trying n trying again and now the replication is working... but the changes at the subscriber are not getting updated at the publisher although I have the proopagate updates my using MSDTC checked.... ahh I'll just tri it again lets see what happens now.
Rocky
|
|
|
|
|
all the matter that is the first time in network applications all earlier was in stand alone machine , i just want someone to give me guidelines
|
|
|
|
|
Does remote queries supports using of temp tables, and how?
|
|
|
|
|
alexrad wrote: remote queries
What do you mean by a remote query?
As far as I'm aware any query can make use of temp tables.
|
|
|
|
|
Is there a way for me to check if a specific row in a table is odd or even? Thanks.
|
|
|
|
|
Do you want to check for the ID of the PK column or the order of the record?
in the first case:
Select *,case (ID % 2) when 1 then 'Odd' Else 'Even' End from items
in the second case (SQL Server 2005 only):
Select *,case (row_number() over (order by ID) % 2) when 1 then 'Odd' Else 'Even' End<br />
from items
|
|
|
|
|
Hi all,
I'm very new to designing and working with DB based apps so please forgive me if I write down things that can make seasoned developer's cry in aguish.
We are right now developping a Remote application scenario with a client app and a server app. The server app will be connected to a DB, SQL Server for more info, which is not, theoretically, reachable from any other machine in the intranet or internet. Only access is through the server app.
Ok the thing is we want the developers of our client app and the client app itself,which is basically 99% of the project workload, to "know as little as possible" of the DB behind the whole project and make all query and update to the DB as simple as possible (through the server app of course).
The design we (I) came up with is the following: (Shuts his eyes and prays he hasnt blown all major rules of designing applications and if so please forgive me)
The server app will have a main worker class named DbEngine which basically does all the work with a few helper classes. The method used to execute selection queries and bring back info to the client app would be the following:
byte[] ExecuteCommand(string commandName, Dictionary<string,object> parameters).
byte[] is a serialized datatable, compressed and most likely, allthough not yet encrypted.
The only thing the client application needs to know is what commandname to call and what parameterName and value to send if any. Please not that the parameters Dictionary does not store any Parameter class, its simply a string key with the parameter name (@columnname) and its value. Its pretty lightweight and easy to code.
The whole work is done in the server side. The thing is, we are storing a table in the SQL Server Database, which we would call TBL_SYS_COMMANDS with all the SQL/Stored Procedure commands our app is going to use. The info stored in this table would be:
[CommmandName] (Primary Unique Key)
[CommandText] (this would be a stored procedure name or a SQL command)
[CommmandType] (Text, StoredProcedure, etc. Server app would parse the string into the corresponding .NET enum)
[Parameters] (would contain custom serialization of parameter(s) info, except Value of course).
The server app would recieve the ExecuteCommand, look up the commandname in the cached TBL_SYS_COMMANDS datatable and if found, build up command and the parameters through reflection, assign their values, execute the command and send back info compressed in a byte array.
Security measures taken: The DbEngine class in the server side which takes care of executing the ExecuteCommand has a custom attribute with a list of allowed commandNames. If somebody somehow injected a harmfull command in TBL_SYS_COMMANDS it would not be executed because its not included in the custom attribute's allowed command list and the DBEngine class would throw a SecurityException...any new command needs the server code recompiled once the new command has been added to the allowed commands list in the DbEngine's custom attribute.
Thats basically it. Am I forgetting some great security hole somewhere storing my SQL commands in a database table? Is this design way to complicated? Basically we want to minimise coding and specially recoding if we make changes and fine tune the database, queries, stored procedures etc, and this system basically allows you to change all this without having to dig into almost any code at all...only update the allowed commands attribute.
Please recommend other approaches etc.
Thanks in advance, and sorry for the long post.
-- modified at 13:16 Friday 9th March, 2007
|
|
|
|
|
I have been writing SQL for about 10 years now. Never have I ever used the words "inner" or "outer" in my stored procedures. I use "join", "left join" and "right join". My question is what are the "inner" and "outer" key words used for? Isn't a join always an "inner join" and a left or right join always an "outer" join or am I missing somethin?
|
|
|
|