Showing posts with label drop. Show all posts
Showing posts with label drop. Show all posts

Wednesday, March 21, 2012

Is this a poor database design?

Setup
I am using a simple aspx page to calculate a person's tax filing status and capturing statistical information. Most of the items are drop down boxes or radio buttons but a few are checkboxes.

Question
My plan is to give each option in the check boxes its own column in the database this will lead to a table that is 70 columns wide. Is that to many? Most of the info will be very small like "yes" or "no". I will be using a stored procedure to insert the info. This will be coming down a VPN

Goal
I would like to give the admin staff here real time access to the data via link tables and such. I would like there to be only one table so it will be easy for them to pars the info quickly without needing to join tables or write unions. Ideally this would get me out of the business of creating one off reports.I would recomend a more normalized table design.

If your admin users want to view the data de-normailzed you can create a view which accomplishes this.|||Go to the SQL Server Web site and look for the SQL Server 2000 AdventureWorks, it will get you create table statements that is close to what you are looking for because I takes table Reationship to Upper and Lower bound Cardinality. The only human interpretation of Peter Chen ERD relational Algebra. Hope this helps.

Kind regards,
Gift Peddie

Friday, March 9, 2012

Is there anyway to drop and re create all the index of a database ???

I wanna do that without usinf DBCC REINDEX
ThanksYou can write your own script which uses a couple of loops and the system tables and then drop and
create the indexes. But it gets more complicated as some indexes are created by constraints.
In fact, DBREINDEX uses the same code internally in SQL Server as CREATE INDEX, so why don't you
want to use DBREINDEX?
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"Rubens Naves" <rubensnaves@.hotmail.comm> wrote in message
news:%231baqYJxDHA.556@.TK2MSFTNGP11.phx.gbl...
> I wanna do that without usinf DBCC REINDEX
> Thanks
>

Monday, February 20, 2012

is there an error handler in sql stored procedures?

is there an error handler in sql stored procedures? For example if i want to do a drop something and there is a lock, i want to try return if it droped it or not and if not then try again latererror handling in sql 2000 is pretty poor. basically you have to check @.@.ERROR after every statement that could possibly fail. The situation in 2005 is much better since there you can use try/catch.

for error handling on 2000:
http://www.sommarskog.se/error-handling-I.html
http://www.sommarskog.se/error-handling-II.html

for try/catch:
http://msdn2.microsoft.com/en-us/library/ms175976.aspx