|
Hi,
Apologies for the length of this question.
Does anyone know where to find information how to develop on MSSQL? I'm not looking for information on database design (Normal Forms etc.), but on how you actually work with it. For example, it's easy to create a new database in Visual Studio, but how do I then get this onto my web hosting server? How do I make sure I can repeat this process if need be? Can I create a new database with the same schema as an existing one? Is there a recognised way to set up the tables and relationships used by the security classes built into .NET? The list goes on.
I find information on designing databases everywhere, but I can't find anything good on how you actually work with them day-to-day. What are the best practices? I am a one-man-band, starting a project that uses an MSSQL database, and while the database won't be doing anything 'heavy' initially, I don't want to get into deep water. I'd like to do things 'right'.
Any advice would be gratefully received.
Kind wishes - Patrick
Thank you to anyone taking the time to read my posts.
|
|
|
|
|
Patrick Skelton wrote: it's easy to create a new database in Visual Studio, but how do I then get this onto my web hosting server?
That depends on your hosting company. The obvious options would be:
- Backup your local copy of the database, copy the files to the server, and restore;
- Use the "Generate Scripts" option to create a SQL script which you can run on the server to create the database;
- If the host supports it, use Web Deploy[^];
Patrick Skelton wrote: How do I make sure I can repeat this process if need be?
If you're overwriting the remote copy of the database, it's simply a case of repeating the initial deployment. If you just want to deploy structural changes, you'll need to create the SQL scripts to make the changes on the server.
Patrick Skelton wrote: Can I create a new database with the same schema as an existing one?
Schemas are local to the database. Two schemas in different databases with the same name are not connected in any way.
Patrick Skelton wrote: s there a recognised way to set up the tables and relationships used by the security classes built into .NET?
If you're using the SQL providers, then the ASP.NET SQL Server Registration Tool[^] is the way to go. However, these providers are quite old; you might prefer to look at the newer "Universal" providers[^].
As for your broader question, I presume you've looked at the SQL documentation on Technet[^]?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thank you for taking the time to write that reply. I will dive in with your suggestions.
- Patrick
Thank you to anyone taking the time to read my posts.
|
|
|
|
|
Patrick Skelton wrote: Does anyone know where to find information how to develop on MSSQL?
I buy books.
|
|
|
|
|
Okay - can you recommend any good books?
Thank you to anyone taking the time to read my posts.
|
|
|
|
|
Sage advice from both Patrick and j, I presume you are having trouble finding reference on developing sql server[^]
Also sqlservercentral.com[^] is a good resource but they tend more towards the DBA skills. As a one man show you are going to have to get a good handle on the development cycle, building the app is only the core skill.
POH has some excellent articles [^]you may be interested in
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi
i want to design database that have different object but with the same structure .
we have feeling table with this structure (code,name,id) also zone table with (code,name,id).
my question is ,i have to design separate procedure for insert & update & delete or i can use one procedure for both table ??
is it possible to send table name??
is it good way to send table name from DAL OR BLL layer?
please help me
|
|
|
|
|
Keep it simple.
Create 2 stored procedures.
Just my opinion.
|
|
|
|
|
tnx david.but i have 8 table with this structure .we have to design (delete,update,insert,SearchByName,SearchCode,....)store procedure .now what is the best way??
|
|
|
|
|
Since the data structure of the table seems to be identical across these 8 tables, why don't you create a "super table" which contains the name of the table, followed by the other columns ?
Data would look like:
Feeling,code,name,id
Zone,Code,name,id
Table6,Code,name,id
This way you would only implement a single set of Select,Insert,Upadate,Delete, just passing the name of the table as part of the "Where" clause.
Kind of hard to describe, but hopefully you get the idea.
Good luck.
|
|
|
|
|
|
|
Mahdi_kishislan wrote: now what is the best way?? The best way would be a design where each table has a specific structure optimized for the data it is holding. By using a dump-table where all has the same structure, you'll loose a lot of advantages that a usual database offers - simple things like references and type-safety.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I totally agree. It seems that his design is kind of lacking.
I just tried answering his question. Sounds more like a homework assignment than a real project.
|
|
|
|
|
You can use dynamic SQL but I would not suggest that. Create the stored procedures. It is easy to use cut and past for creating all you need, and if one table changes you only change on procedure.
Another way would be to pass the table name into the procedure and have an IF ELSE IF structure within the procedure to update the tables.
|
|
|
|
|
I Think You Should Add One More Column To Your Main Table As Type
Now Your Table Structure Is (Code,Name,ID,Type)
Now In Type Column You Can Insert Feeling Or Zone.
And Now One One Insert Update And Delete Procedure Can Do The Same, As You Required.
-------------------------------------------------------------------
Another Approach
You Should Pass Table Name To Your Procedure And Create Dynamic Query.
To Execute That Dynamic Query Use SP_ExecuteSQL
Hope This Will Help You.......
|
|
|
|
|
I an not able to start the SQl Server Agent in SQL Server 2008. When i opened SQL Server configuration and found there is no option to start it.When i changed the property from network service to local service it throws error "The service cannot be started either because it is disabled or because it has no enable device associated to it."
Please somebody help me
modified 10-Aug-13 16:02pm.
|
|
|
|
|
This thread [^]turned up when I searched Google
I have the same setting on my local machine but I don't need Agent so have never enabled it!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hello!
I will create a view on a Firebird database server by using the Execute Statement "ON EXTERNAL DATA SOURCE".
I found this document on firebirdfaq.org: http://www.firebirdfaq.org/faq16/
and also this: http://tech.groups.yahoo.com/group/firebird-support/message/114481
Unfortunately my SQL-skills are not good enough to solve this task by my selves.
I tried this:
SELECT * FROM(
FOR EXECUTE STATEMENT
'select code, name from TMaster where group = 'A' '
ON EXTERNAL DATA SOURCE '[IP Adrress]:\Data\DB\master.fdb' AS USER 'u' PASSWORD
'p' ROLE 'R'
into :code, :name do suspend ;)
Certainly that doesn't run.
Please can anybody give me some interesting advises?
I look forward to all suggestions!
Kind regards
Christoph
I'm a novice from Germany.
modified 10-Aug-13 14:45pm.
|
|
|
|
|
You are going from firebird to firebird right?
When you say it doesn't "run" what do you mean exactly?
|
|
|
|
|
Hi!
Thanks a lot for your reply!
You are going from firebird to firebird right?
Yes I do.
When you say it doesn't "run" what do you mean exactly?
It is not possible to compile my SQL example:
SELECT * FROM(
FOR EXECUTE STATEMENT
'select code, name from TMaster where group = 'A' '
ON EXTERNAL DATA SOURCE '[IP Adrress]:\Data\DB\master.fdb' AS USER 'u' PASSWORD
'p' ROLE 'R'
into :code, :name do suspend ;)
I got a SQL-Error in Line 2. If I try to compile without the select command I got the error in line 1.
I suppose my way to use the "FOR EXECUTE STATEMENT" is not correct. Or do I have problems with my Firebird version? (I don't know my current version at the moment, tomorrow)
I'm a novice from Germany.
|
|
|
|
|
My version is ok (2.5.2)
So my SQL must be incorrect. Is my example basicly possible?
I'm a novice from Germany.
|
|
|
|
|
My name is sanjay i had done bsc in computer science and also a course in oracle currently pursuing mca and wants to enter in database jobs. Can anyone suggest me.
Thanks,
Sanjay
|
|
|
|
|
This is a technical forum. You need to research your local area to find out what jobs are available. Try newspapers, recruitment agencies, friends etc.
Use the best guess
|
|
|
|
|
There are also web sites like Dice and Monster.
|
|
|
|