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.
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) when1 then 'Odd' Else 'Even' End<br />
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 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.
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?
i'm a biggener , and asked to design SQL database project run on server and send specific fields to clients on the local network ..
i need some recommenditions and books to help me
send accounting informations to and from accounting application , and another feilds to the administrator , and so on
how to train my ideas to begin ?
My requirement is to do search facility for my website. So what is your idea for maintaining the index ? I read one article that when google was created they used to crawl 10billion pages and index size was just 120GB. how's it possible ? Will they store all words in the target website ? How can I implement a search for single website ?
I have my DB in SQL Server 2000 with the applications developed in ASP, VB. Now i am looking for mirroring my DB because i am going to change the db strucute with similar modifications. i m going to recreate older ASP, vb applications into C#.net & ASP.net
if any one have the idea.. kindly help in this issue..
SQL Server does not store rows like a flat file so when you say first row all you can really do is SELECT TOP 1 * FROM TABLE. You can include a WHERE clause though by saying SELECT TOP 1 * FROM TABLE WHERE Name="xyz".
"I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that." - Tommy Boy "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)
Do you want to create a procedure that can validate user name and password ? Then it could be something like this
CREATE PROCEDURE ValidateProcedure
Select * From UserTable Where UserNameColumn = @Username and PasswordColumn = @Password
Get the result in some reader. If the reader has records then u r login is authenticated. If you want to make your password case sensitive then go through this snippet http://www.w3hearts.com/showsnippet.aspx?show=22