How Long Need ALTER DATATABLE (DATABASE) SET ENABLE_BROKER ?

Dec 21, 2005

I am try to start with SQL BROKER service,

When I lunch from sql Management studio the following query, this don't finish never.

ALTER DATATABLE dbname SET ENABLE_BROKER

 

Where I am mistaking ?

 

View 11 Replies


ADVERTISEMENT

Why Does 'alter Database NorthWind SET ENABLE_BROKER' Take Forever?

Feb 2, 2008

I am trying to execute the following query , in Management Studio. But it takes forever. Can someone tell me why is this happening? I am running the query in 'NorthWind' database.The windows account  under which I am logged into WinXP (windows authentication is enabled for the SQL Server database) is the database owner for NorthWind database.
alter database NorthWind SET ENABLE_BROKER

View 3 Replies View Related

Query &&>&&>ALTER DATABASE OperationsManager SET ENABLE_BROKER Never Completes

Feb 20, 2008

My SQL broker was not enabled. So I ran the query >> ALTER DATABASE OperationsManager SET ENABLE_BROKER

The query has been running for several hours and is still not complete. I let it run for over 24 hours and the broker never gets enabled.

Thanks,

Wesley Jones

View 4 Replies View Related

ALTER How Long Should It Take?

Jun 8, 2007

The following ALTER takes about 2 hours in my environment. totalnumber of records is about 2.8 million. IS this typical? Is there away to speed up this process.BEGIN TRANSACTIONSET QUOTED_IDENTIFIER ONSET TRANSACTION ISOLATION LEVEL SERIALIZABLESET ARITHABORT ONSET NUMERIC_ROUNDABORT OFFSET CONCAT_NULL_YIELDS_NULL ONSET ANSI_NULLS ONSET ANSI_PADDING ONSET ANSI_WARNINGS ONCOMMITBEGIN TRANSACTIONALTER TABLE dbo.PERSON ADDFL_CNSL_NTFY char(1) NOT NULL CONSTRAINT DF_PERSON_FL_CNSL_NTFYDEFAULT '',CD_INTRP_NEED smallint NOT NULL CONSTRAINT DF_PERSON_CD_INTRP_NEEDDEFAULT 0GOCOMMITThanks for any tips on this issue....

View 4 Replies View Related

Alter Column To Varchar(max) Takes To Long

Sep 24, 2006

Hi,

I need to modify existing table in my database to varchar(max) from varchar(2000)

This table contains 30 million plus rows and has more than 70 columns.

now when i am running alter command for this it take too long(more than 9 mins) which is not acceptable. . Is their any way to reduce this execution time

Following is the query i am using for this

ALTER TABLE Receipt
ALTER COLUMN CUSTOM VARCHAR(MAX) NULL

Please let me know if you have any suggestion to improve this

TAI
Prashant

View 1 Replies View Related

SQL Server 2014 :: Alter Table Add 2 Fields Takes Too Long

Sep 25, 2015

We have a proc that adds some fields to a few tables of ours and normally there are no issues. For one of our client databases this process is taking anywhere from 5-10 minutes to add the fields. This causes an issue where the app will timeout waiting. After plugging around and looking at the proc and trying different items i found it to only be for this one database and ONLY when there is data in the table. If i truncate the table and run the same procedure everything is fine. Tables all have same index on 4 columns and the columns being added are not indexed because of the stupid hoops we have to jump thru to pre-pivot data for our reporting package.

View 4 Replies View Related

Filling A DataTable From SqlQuery : If SqlQuery Returns Null Values Problem Ocurrs With DataTable

Sep 3, 2007

Filling a DataTable from SqlQuery : If SqlQuery returns some null values problem ocurrs with DataTable.
Is it possible using DataTable with some null values in it?
Thanks

View 2 Replies View Related

Sqlexpress ENABLE_BROKER

Oct 2, 2007

i'm using sqlexpress edition for my application and i'm wondering whether i will be able to execute the below sql statement
use masteralter database <dbname> SET ENABLE_BROKER
when i execute the above two lines its executing from last 30+ minutes...
i'm wondering will that support in sqlexpress edition ?
also, in order to use sqldependency do i have to enable broker service?
thanks.
 

View 2 Replies View Related

Updating SQL Database - Using DataTable

Jan 8, 2008

I am quite new to ASP.net 2.0. I have had plenty of experience using ADO.net in standard windows applications.
In my app I am opening a connection to an SQL database and I am creating a DataTable without a DataSet:
Shared m_cnADONetConnection As New System.Data.SqlClient.SqlConnection
Shared m_daDataAdapter As System.Data.SqlClient.SqlDataAdapter
Shared m_rowPosition As Integer
Shared m_dtContacts As New System.Data.DataTable
I am initializing everything and filling my DataTable when the Page first Loads if it isnt a postback.Protected Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Form1.Load
If Not Page.IsPostBack Then
m_rowPosition = 0
m_cnADONetConnection.ConnectionString = "Data Source=.SQLEXPRESS;AttachDbFilename=C:First ASP DatabaseApp_DataMyFirstDatabase.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True"
m_cnADONetConnection.Open()m_daDataAdapter = New System.Data.SqlClient.SqlDataAdapter("Select * From Books", m_cnADONetConnection)m_cbRefillCommand = New System.Data.SqlClient.SqlCommand
m_daDataAdapter.Fill(m_dtContacts)
Me.ShowCurrentRecord()
End IfEnd Sub
The Me.ShowCurrentRecord Sub assigns the values of the current record(row) in the DataTable via (m_rowPosition) to TextBox controls on the form:
I also have record navigation buttons on my form: << < > >> Moving me from record to record (row to row) by incrementing or decrementing m_rowPosition
All is good! I am able navigate the DataTable and the textboxes change their text properties accordingly from record to record.
The only other control on my form is a button which I'm coding its click event to save changes that I made to the current row (record) by changing the values in the textboxes then clicking save.
 Here is my code:Protected Sub ButtonSave_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ButtonSave.Click
If m_dtContacts.Rows.Count <> 0 Then
m_dtContacts.Rows(m_rowPosition).BeginEdit()m_dtContacts.Rows(m_rowPosition)("Title") = TBTitle.Text
m_dtContacts.Rows(m_rowPosition)("Author") = TBAuthor.Textm_dtContacts.Rows(m_rowPosition)("YearPublished") = TBYearPublished.Text
m_dtContacts.Rows(m_rowPosition)("Price") = TBPrice.Textm_dtContacts.Rows(m_rowPosition)("LastReadOn") = TBLastReadOn.Textm_dtContacts.Rows(m_rowPosition)("PageCount") = TBPageCount.Text
m_dtContacts.Rows(m_rowPosition).AcceptChanges()
m_dtContacts.Rows(m_rowPosition).EndEdit()
m_dtContacts.AcceptChanges()
m_daDataAdapter.Update(m_dtContacts)
End Sub
After I click save I can navigate through my records and back to the one I just changed and updated and all is well. The changes were made in the table.
However, when I close the page and exit out of Visual Web Developer and reopen the database: THE CHANGES WERENT UPDATED!!!
 This worked all the time in VB2005.net when developing a standard windows app.
Can I use the same approach I was using in my code above or am I missing something. 
 
I have read and searched all over and what I'm thinking is that my UpdateCommand, InsertCommand, DeleteCommand, SelectCommand are empty.
Do I have to do it this way?
 
 
 
 
 
 
 

View 1 Replies View Related

Updating DataTable In DataBase Using SqlDataAdapter

Sep 4, 2007

Hi GuysI am facing a problem while updating a DataTable to database using sqldataadapter.In my application I am fetching a dataTable from Database and filling values into textboxes on the UI.User has given facility to change or add new texboxes (new row) on the fly .(Textboxes on the UI are like in a row(tr) having two textboxes in each row.)I am again then converting a new (empty) datatable from scrap and filling its rows with the value of textboxes on submit button event.The datatable which I have created has the same schema as the database table.Now what I want here is that changed value should be reflected to the already existed rows in database and only new rows should be  inserted.I am using a SQLDataAdapter having two sqlcommands , one for update with update procedure name and parameter mapping and another for insert with parameter mapping.But SqlDataAdapter is inserting fresh new rows all the time in the database table not updating the older one.Please help me in the matterThanks & RegardsVishal Sharma 

View 2 Replies View Related

DataTable And Autoincremental Database Fields

Sep 16, 2007

Hi,
I got a problem regarding autoincremental Database Fields and DataTables. Using the technique to map the DataBase to an *.xsd file and trying to insert a Row into the table always results in this kind of error:Cannot insert explicit value for identity column in table 'Cars' when IDENTITY_INSERT is set to OFF.
This only happens when I set CarIDs properties AutoIncrement = true, AutoIncrementSeed = -1, AutoIncrementStep = -1. Having AutoIncrement = false, results in this error:Column 'CarID' does not allow nulls.
Do I missunderstand something, or do I need to change some parts? I would be glad if someone could help me and figure out what I am doing wrong.Thanks a lot have a nice weekend.Regards Johannes 

View 1 Replies View Related

Not Able To Drop Database After Opening Datatable

May 3, 2005

Hi everybody,
I am using VB Webforms as my front end and MSDE 2000 as my back end.  I am not able to drop a database after executing the following vb code on that database:
        Dim vConnection As New SqlConnection(vConnectionString)        Dim vAdapter As New SqlDataAdapter("SELECT party_type_code, party_type_name, party_type_imported" & _                                         " FROM Party_Type" & _                                         " ORDER BY party_type_name", vConnection)        Dim vDataTable As New DataTable()        vAdapter.Fill(vDataTable)        vAdapter.Dispose()        vConnection.Dispose()
On trying to drop the database using the SQL Command "DROP DATABASE PPCABCD2005", I get the error message:Cannot drop the database 'PPCABCD2005' because it is currently in use ...However, if I don't execute the above code, I am able to drop it.  Why is it so?  What is the solution to this problem?

View 2 Replies View Related

Bulk Insert A DataTable Into SQL DataBase

Nov 18, 2005

Hi All!!                I need to export a whole datatable to the database, through bulk insert or any other method..Can any body help me in that??Yes, col's in the database table and datatable are same!!Thx,Regards,Nilee.. 

View 4 Replies View Related

How To Keep DataTable's Primary Index In Sync With Database?

May 12, 2008

I'm working with a legacy database whose structure I cannot change.  I'm building a web-based editor for one of the DB's tables.  This table has a Primary Key called "Master_Idx" that is an Identity (autonumber) field.To start, I query the DB and populate a data table which is cached.  This is used to "feed" the web form.  Any additions, changes, and deletions are reflected in this cached table.The user then has the flexibility to press Save at any time, which ensures that the database is modified accordingly.Here's my question:When new records are added, I assign them a Master_Idx value, the first of which was calculated to be 1 + the Max(Master_Idx) value when the editing session started.  But when I insert these records back into the database it's possible that another user might have also been doing similar editing (of different records from the same table), so there's no guarantee that the Master_Idx values in the data table will be identical to those in the DB.  When I insert a record from the cached table back into the DB, what technique can I use to check what value was assigned to the Master_Idx?  If it's not the same as in the cached table then I need to update it locally in a few places.I hope all of this makes sense but if it doesn't then let me know and I'll explain it in another way.Robert W. 

View 2 Replies View Related

Granting Permission To A Database User To Alter Database Role

Sep 5, 2006

I want a database user to be able to alter login, database user and database role from my application. so, i assigned that user to sccurityadmin server role, db_accessadmin and db_securityadmin database roles....By now, the user can add or remove login and database user. However, the user cannot add or remove any database role membership. What am I missing here?? What should I do so that the user can create, and alter database roles in the database??

View 1 Replies View Related

SQL Security :: ALTER DATABASE Failed Because A Lock Could Not Be Placed On Database

Jul 20, 2015

I have a script that automates some db drop/restore operations and bringing the database to single user mode is part of it: ALTER DATABASE ... SET SINGLE_USER WITH ROLLBACK IMMEDIATE...I want this to executes under a login, that has restricted privileges, so I've created a login and granted it a dbcreator role + ALTER ANY DATABASE privileges.

Problem: When I run the script against a database with an active/sleeping connection:It fails when using the restricted login: "Msg 5061...ALTER DATA BASE failed because a lock could not be placed on database ..."It completes successfully when using a sysadmin login According to stackoverflow.com the solution is to kill the active/sleeping connections to the database, before ALTER-ing it, which works fine, but the question is....

Questions: Why the "ALTER DATABASE..." statement works under the sysadmin login, but not under a dbcreator one?Does this mean the sysadmin login kills the connections to the target database in the background?Is it possible to grant additional privileges to the restricted login, so the "ALTER DATABASE..." statement won't need preventive killing of the connections?

View 5 Replies View Related

Database Mirroring Hangs On ALTER DATABASE SET PARTNER

Jun 26, 2005

Hi,

View 6 Replies View Related

Create Database And Alter Database In One SQL Script

Aug 25, 2000

I am using SQL 6.5. Can I create a database and Alter the same
database in one SQL Script?
Thanks in advance.

View 1 Replies View Related

Alter Table Alter Column In MSACCESS. How Can I Do It For A Decimal Field?

Jul 23, 2005

Hi people,I?m trying to alter a integer field to a decimal(12,4) field in MSACCESS 2K.Example:table : item_nota_fiscal_forn_setor_publicofield : qtd_mercadoria integer NOT NULLALTER TABLE item_nota_fiscal_forn_setor_publicoALTER COLUMN qtd_mercadoria decimal(12,4) NOT NULLBut, It doesn't work. A sintax error rises.I need to change that field in a Visual Basic aplication, dinamically.How can I do it? How can I create a decimal(12,4) field via script in MSACCESS?Thanks,Euler Almeida--Message posted via http://www.sqlmonster.com

View 1 Replies View Related

Alter Database

Jan 23, 2001

I am trying to move one of my database log to different location but I am geeting an error when I try to do this.

I am moving Registration DB log file from 'c:mssql7
egistrstion_log.ldf'
to 'e:sql
egistration_log.ldf'

Here the syntax I am using to do this:

alter database registration modify file (name='registration_log',filename= 'e:sql
egistration_log.ldf')

But I get the following error:
Server: Msg 5037, Level 16, State 1, Line 2
MODIFY FILE failed. Do not specify physical name.


Thank You,
John

View 1 Replies View Related

Alter Database

Jul 31, 2006

Hi all this is my first of most likely many posts.
I am writting a stored proc that will be used on many diffrent named databases and i am setting the database name with a variable. I would like to use this variable in the following situation any clues on this would be greatly appreciated.

DECLARE @DBName varchar(50)
SET @DBName='Database'
alter database @DBName set recovery full

regards
Phil

View 4 Replies View Related

ALTER DATABASE

Apr 25, 2008



Hey,

I am trying to give a user permission to change the name of a database.

They are a member of the server role 'secuirtyadmin'
They are a member of the database role 'db_owner'
They have been granted ALTER permission on the database.

But every time I try and run the command

ALTER DATABASE <dbname> MODIFY NAME = <newdbname>

I get an error saying the database doesn't exist or you don't have permissions.

What am I missing?

View 7 Replies View Related

Alter Database Failed

Mar 13, 2003

Hello,

I have Test database with Log file property Automatically grow the file, option Unrestricted file growth, I wanted to alter it with Restrict file growth upto 200 MB. I'm getting an error that you cannot modify as file doesnot exist
But the file does exist. I cannot figure out what is giving the problem.
below is the sql statements
select name from sysfiles
go

Test_Data
Test_Log

USE master
go
ALTER DATABASE Test MODIFY FILE
( NAME='Test_Log',
MAXSIZE=200MB )
go

ERROR
Server: Msg 5041, Level 16, State 1, Line 1
MODIFY FILE failed. File 'Test_Log' does not exist.

Any help is appreciated.

Thanks
Sejal

View 3 Replies View Related

Alter Database While Suspect

Jan 22, 2004

Hi

I got the following error
Error: 823, Severity: 24, State: 4
I/O error 33(The process cannot access the file because another process has locked a portion of the file.) detected during write at offset
0x0000000a796000 in file xxxxxxxxx.ndf'.

and the respective database could not be brought online - this was just due to a problem with a .ndf file containing only indexes...is there any way to connect to/alter a database while it is in this transitional state? (it would be no loss if i could just remove the file & its filegroup)

(i tried starting with -f -c, but no go)

thanks in advance
des

View 3 Replies View Related

Can Alter (current) Database?

Apr 7, 2006

I have a *.sql script that creates database tables, and I need to modify the database to enable the service broker. In addition, the actual name of the database is not known in advance - it is set per instance of the application.

I know I need to do:

ALTER DATABASE dbname SET ENABLE_BROKER

But I must avoid including the name of the database in the script. I did wonder if this would work:

DECLARE @DB varchar(50)

SELECT @DB = DB_NAME()

ALTER DATABASE @DB SET ENABLE_BROKER

But I just get a syntax error. Presumably this also rules out setting the database name as a parameter to the script (SqlParameter stuff)

The only option I can think of is dynamically creating the statement, either in T-SQL or in the calling .NET environment.

Any thoughts?

Ruth

View 6 Replies View Related

ALTER DATABASE SET PARTNER OFF

Oct 25, 2006

I've read that when this run's, it removes all db mirroring information on that db. What exactly does it remove?

Here's my senario:

We are using SQL 2005€™s db mirroring process. We are using the certificate method of authentication between the principle and the mirror db€™s.

My question is that when the ALTER DATABASE dbname SET PARTNER OFF is run, does it remove these certificate settings as well? In other words when I want to enable the db mirroring, will I need to recreate these certificates or just recreate the endpoints to use these certificates?

View 5 Replies View Related

Long Time Database Processing In ASP.NET ?

Aug 2, 2007

 I made a website in ASP.net and using sql server 2005 as database. There is sometime processing data that need long time processing ( about 20 minutes ) and big data. It works fine in dev box, but when I place on shared hosting, and some people access it  crashed. The website can not be accessed. Hosting support told me maybe I need to reprogram my code. So anybody has solution for this problem ? Should I create new thread ?  

View 3 Replies View Related

Is This A Good Database Design - Very Long

Dec 29, 2007

Hey I was wondering if you
all could help me with my database. I am very noobish as databasing and I am
not sure what I have is good or bad. This is very long since I tell you basically
what my whole site does/will do. This is in hopes that it will give you a
better understanding of how many database will work.

 

Japanese WebSite

Purpose of the site:

 

This sites intention is to help people learn the 2 basic
Japanese character sets Hiragana and Katakana. 
Hiragana is usually used for Japanese words and contains 46 basic characters,
plus a set of special characters. Katakana is usually used for foreign words
and also contains 46 basic characters plus a special set of characters.
Hiragana and Katakana are written differently when they are written with Japanese
characters. However if you right them in romaji (this is basically writing words
as if you where writing English and does not involve using characters. This is
used for foreigners while they are learning how to write the Japanese
characters).

 

Hiragana and Katakana are pronounced exactly the same.
This site will use a quiz style format. The user will first choose from the set
of Hiragana characters then the Katakana characters. Once chosen the website
will randomly choose a character and display the Japanese symbol of it.  The user will then write the romaji
representation in the text box provided.

 

 It will be then checked
and if the user is right they will get a new symbol. If they are wrong they
will have try again.  The purpose for
this is for the user to get use to see how the character looks like but at the
same time writing in romaji what will be easier for them. This should make it
easier for them the next time they see the character to know how to say it.

 

Version 1 

 

The site will go through many versions. This version I am
focusing on using C#,asp and ms sql. Later on in future versions ajax and
javascrip will be introduced and parts will be changed. Version 1 also uses CSS
and html.

 

Version 1 will contain these features.

1.       A
practice section. A user will go through a wizard like setup that will first
let them choose from the basic 46 Hiragana characters (the other special
characters will be added later). They will then go to the next setup and choose
from the 46 basic Katanana characters. After they go to another section that
asks them how many repetitions they want to go through.  If the user is a member(free membership) they
will have the option to save their settings that will be stored and later
available on the front page called quick links. The next page of the wizard is
actually going through the quiz. Once they are done they will see a summary of
how many they got right,wrong and how many they needed assistance on. At this
point they will be able to view a chart to see their progress(current chart
showing there last  attempt, a week one
and a month one). These charts will be either made using c# or ms sql(I saw a
something that says you can make something like that but have not confirmed
it). I may do both ways for a learning experience.

2.       A  Registration form, login and logout.

3.       Quick
link. Quick link will be for registered members so they don’t have to go
through the wizard every time to make their practice quiz up. A user will go
through the wizard once and choose what they want and save it.  Quick link will be on all the pages in the
form of mostly likely a grid view. A user will be able to store 3-5 different quiz’s
(in the future maybe more). A user can then click on the quick link and it will
just take them to the quiz. The user will also will be able to update their
quiz through the grid view. This will take them to the start of the wizard and
they can go through it again and then just save over it. They will also be able
to delete there quick links through the grid view.

Currently done

Half of step 1 has been completed. Currently a user can
go through the wizard and select what they want and choose how many repetitions
and go through the quiz. However the summary and charts are not done.

 

Future versions.

 

Design will be a major part of it since I have not
focused on this at all. Also since I wanted to experiment with dynamic controls
I made all the checkboxes for the selections dynamically. This caused a problem
that a user must hit a save button since the controls have to get recreated and
updated.

 

I think normally this might not have been a problem but
since I since I am using a multiview(to create a effect that the wizard is all
on the same page and not the whole page has to be reloaded) it caused some
problems(I can’t really remember since it was a couple months ago when I
started but had to stop due to the amount of school work). This is why I want
to go back later and make them with ajax. This also makes another learning
experience.

 

Where I am at now.

 

When I started this I really did not think much of my
database mainly because I am not good at data basing and don’t really like it that
much. I have had a course in data basing (was with oracle though)that was part
of my program. At the time I did not understand very much since I found the
teacher going too fast and he started at chapter 8….. Also when you got 7 other
courses with it it’s hard to learn lots.

 

I have gone through some tutorials and stuff. I am not
very keen on reading a database book since I just don’t have the time since I
want to also read a book on c#, javascript, ajax and so forth. Also I don’t
know how much I will retain/learn from a book. With some of the stuff I just
find its better to try to something where you will be interested in and then
when needed read chapters of a book or ask questions.  This is what I done for my c# stuff like I
had a c# with asp course and 2 months after the courses I started this site and
I had to ask myself what the heck did I learn in that course since it seemed I
knew nothing(and I was close to top in my class). With pounding it out and
reading I was able to accomplish what I needed. Like I still want to read a
book on C# but for now it’s just not going to happen same with Data basing.

 

All the pervious information was so you can understand
what my website is trying to do so you can better evaluate my database design
and answer my questions.

 

First Design of my
database.

 

This is when I just made it up on the spot and did not do
any database design or anything.

 

Question 1: I
forgot how to limit select query results. Like If I just want to show 10 query
results how do I do this?

 

I have currently 2 tables How one called Hiragana and the
other Called Katakana

 

HiraganaID = PK

 

HiraganaID  HiraganaCharacter HiraganaImage

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

1           a                 Images/hiragana/a-o/a.jpg

2           i                 Images/hiragana/a-o/i.jpg

3           u                 Images/hiragana/a-o/u.jpg

4           e                 Images/hiragana/a-o/e.jpg

5           o                 Images/hiragana/a-o/o.jpg

6           ka                Images/hiragana/ka-ko/ka.jpg

 

Katakana

 

KataKanaID = PK

 

KatakanaID  KatakanaCharacter                                  KatakanaImage

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

1           chk_Kata_a                                        
Images/katakana/a-o/a.jpg

2           chk_Kata_i                                        
Images/katakana/a-o/i.jpg

3           chk_Kata_u                                         Images/katakana/a-o/u.jpg

4           chk_Kata_e                                        
Images/katakana/a-o/e.jpg

5          
chk_Kata_o                                        
Images/katakana/a-o/o.jpg

 

I quickly found that this design was very bad since I was
unable to add new rows very easily. Each character set has each of its characters
in rows of 5. Some rows however have only 3 romaji characters so what they do
is leave the other cells blank representing that they don’t exist. I wanted to
do this too so I figured the easier way would be to have just null rows of
data. So say for “ya,yu,yo� it would be like this “ya,null,yu,null,o�. That’s
how it would appear in the database so when my c# would read it in it would not
have to account for rows that had less than 5 characters since it would have
already the nulls for it.

 

You can check a chart out here: http://www.alpha.ac.jp/japanese/img/moji.gif

 

So with this poor design it would result me in basically
rewriting the database.

 

I have thought of 2 possible ways to. I am not sure if
either way is good but I will try to explain my reasoning as much as I can.

 

Possible Way 1

 



 

In this approach I have 5 tables.

 

 

 

 

 

Hiragana

This table stores all the information about Hiragana
Characters

 

CREATE TABLE [dbo].[Hiragana](

      [HiraganaID] [int] IDENTITY(1,1) NOT NULL,

      [HiraganaCharacter] [varchar](5) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL,

      [HiraganaImage] [varchar](50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL,

      [SortOrder] [numeric](3, 0) NOT NULL,

 CONSTRAINT [PK_Hiragana] PRIMARY
KEY CLUSTERED

 

 

 

Katakana

This table stores all the information about Katakana
Characters

 

CREATE TABLE [dbo].[Katakana](

      [KatakanaID] [int] IDENTITY(1,1) NOT NULL,

      [KatakanaCharacter] [varchar](50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL,

      [KatakanaImage] [varchar](50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL,

      [SortOrder] [numeric](3, 0) NOT NULL,

 CONSTRAINT [PK_Katakana] PRIMARY
KEY CLUSTERED

 

 

Quick Links

This table will store the users quick link information.

 

CREATE TABLE [dbo].[QuickLinks](

      [QuickLinkName] [varchar](50) COLLATE
SQL_Latin1_General_CP1_CI_AS NOT NULL,

      [UserID] [int] NOT NULL,

      [SavedCharacters] [varchar](200) COLLATE
SQL_Latin1_General_CP1_CI_AS NOT NULL,

      [SavedImagePaths] [varchar](200) COLLATE
SQL_Latin1_General_CP1_CI_AS NOT NULL

) ON [PRIMARY]

 

Users

This will store login information.

CREATE TABLE [dbo].[Users](

      [UserID] [int] IDENTITY(1,1) NOT NULL,

      [UserName] [varchar](30) COLLATE
SQL_Latin1_General_CP1_CI_AS NOT NULL,

      [EmailAddress] [varchar](50) COLLATE
SQL_Latin1_General_CP1_CI_AS NOT NULL,

      [Password] [varchar](50) COLLATE
SQL_Latin1_General_CP1_CI_AS NOT NULL,

      [DateTimeStamp] [smalldatetime] NOT
NULL,

 CONSTRAINT [PK_Users] PRIMARY
KEY CLUSTERED

 

Charts

This will store all information that will be used for
charts.

 

CREATE TABLE [dbo].[Charts](

      [PracticeNum] [int] IDENTITY(1,1) NOT NULL,

      [UserID] [int] NOT NULL,

      [Correct] [numeric](3, 0) NOT NULL,

      [Wrong] [numeric](3, 0) NOT NULL,

      [AssitanceNeeded] [numeric](3, 0) NOT NULL,

      [TimeDateStamp] [smalldatetime] NOT
NULL,

 CONSTRAINT
[PK_Charts] PRIMARY KEY
CLUSTERED

(

 

 

Relationships

 

Users and QucikLinks have a PK to FK relationship this is
because quicklinks is dependent on the user having a user account. It also away
to identify which QuickLinks will belong to who.

 

Question 2:  Currently I don’t have a primary Key for this
table what would be a good primary key for this table?

 

QuickLinks also does not have any relationship to either
to HiraganaCharacters or Katakana Characters. This is because I did not feel it
was necessary to grab the information from here. I simply could just grab it
from the array that holds this information from my c# code.

 

Question 3:  How can I make this table for all users? Like
Say they choose 5 characters and save it as QuickLink1(as the
QuickLinkName).  Should each of these 5
characters gets its own line or should it all be saved in one row? Or should I
even have another table to hold this data?

 

Option 1

 

QuickLinkName     UserID     
SavedCharacters    SavedImagePaths                                                                                                                                                                              
   

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

QuickLink1          1                    a           image/a.jpg

QuickLink1          1                    i           image/i.jpg

QuickLink1          1                    u           image/u.jpg

QuickLink1          1                    e           image/e.jpg

QuickLink1          1                    o           image/o.jpg

QuickLink1          2                    a           image/a.jpg

QuickLink1          2                    ya          image/ya.jpg

QuickLink1          2                    ki          image/ki.jpg

QuickLink1          2                    yo          image/yo.jpg

QuickLink1          2                    n           image/n.jpg

























 

Option 2

 

               

QuickLinkName     UserID     
SavedCharacters    SavedImagePaths                                                                                                                                                                              
   

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

QuickLink1          1                    a,i,u,e,o     image/a.jpg, image/i.jpg,

                                               image/u.jpg, image/e.jpg,

                                                image/o.jpg,

                           

QuickLink2         2                  a,ya,ki,yo,n      image/a.jpg,
image/ya.jpg,

                                               image/ki.jpg, image/yo.jpg,

                                                image/n.jpg,

             

Charts table also has a Relationship with Users

 

The thinking for this one is that Charts will use the
UserID to tell who this data belongs too. It will store the number of correct
answers, wrong answers and AssitanceNeed. This table will also hold a timeDateStamp.
The reason for this is because I want to have a chart that displays the last
Quiz they did and also the stats of a week’s worth of quizzes, and month’s
worth of quiz’s. With a timeDateStamp I should be able to add up all those columns
and then display them for whatever period I choose.

 

Second Possible
Way.

  

Characters

 

CREATE TABLE [dbo].[Chracters](

      [CharacterID] [int] NOT NULL,

      [CharacterName] [varchar](5) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL,

      [CharacterPath] [varchar](50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL,

      [SortOrder] [numeric](3, 0) NOT NULL,

 CONSTRAINT [PK_Chracters] PRIMARY
KEY CLUSTERED

 

This way uses 4 charts instead of 5. The main difference
is that the Hiragana Charts and Katakana Charts have been merged into one
table.

 

This way has another relationship between Characters and
Quick Links.  This will store the Character
ID instead of the actual Characters and Path through the use of C# code. When a
user selects a box it will make a note of the CharacterID. When it is time for
the user to use the QuickLink it will join the tables together and filter out
the CharacterIDs. Giving me the CharacterName and Path.

 

The problem with this way is that well the code I written
will need to be changed since currently it grabs stuff from 2 tables into one.
I don’t know if this would save anytime over the first way either.

 

I hope these are sort of close to an alright design since
I did try to think about how my website would interact with the database.

 

Sorry for it being so long.

 

Summary of Questions

 

Question 1: I
forgot how to limit select query results. Like If I just want to show 10 query
results how do I do this?

Question 2:  Currently I don’t have a primary Key for this
table what would be a good primary key for this table?

Question 3:  How can I make this table for all users? Like
Say they choose 5 characters and save it as QuickLink1(as the
QuickLinkName).  Should each of these 5
characters gets its own line or should it all be saved in one row? Or should I
even have another table to hold this data?

 

View 9 Replies View Related

Using DTS To Copy One Database Into Another... How Long Should It Take? 1.5 Gigs

Sep 29, 2004

i'm using DTS to copy one database into a new database, copying over everything, i.e. stored procedures, views, etc.. not just the tables.. how long should it take? it's been stuck at 22% now for about 15 minutes?

thanks

View 2 Replies View Related

Database Search Time -too Long

Jun 2, 2008

I had a database of electronic resources which had 28000 records earlies and was working fine. Now we have added a whole bunch to make it 800K records which has increased the search time to 14-22 seconds which is not acceptable. I have all the tables indexed.

Please help me how to solve this problem. Let me know what other information I should put up here to make my problem undestandable.
Thanks in advance,
Archana

View 2 Replies View Related

How Long To Copy/replicate A Database

Jul 20, 2005

My company is considering purchasing MS SQL Server to run anapplication on (SASIxp). I am mainly familiar with Oracle, so I waswondering how long it would take to copy a database. Basically we havedatabase A and each night we want to replace database B with thecontents of A. How long would this take say if we had a 10GB databaseor a 20GB database.What would be the technique to do this nightly, the Copy DatabaseWizard, Snapshot Replication, Attach & Detach...? We need to automatethis process, and the source database can be made unavailable whenthis happens.Thanks,Roger

View 2 Replies View Related

Alter Table In Replicated Database

Apr 26, 2003

How can I do an alter table in some table that replicated database ?
I got the error message when I try !

View 3 Replies View Related

ALTER DATABASE With Table Partitioning

Jan 15, 2007

Conrad writes "I'm currently working on Table Partitioning. I have done everything succesfull for partitioning, what I'm struggling with is to use
" SELECT MAX(NAME) from sys.filegroups WHERE NAME NOT LIKE 'PRIMARY' " to get the last used FileGroup. Now this works just fine, but when I run the following script:
--Decalre variables
DECLARE @LastFilegroupName VARCHAR(50)
DECLARE @FilegroupName VARCHAR(50)

--Retuns the next FileGroup to be used
SET @LastFilegroupName = (select MAX(NAME) from sys.filegroups WHERE NAME NOT LIKE 'PRIMARY')
SET @LastFilegroupName = Replace(@LastFilegroupName,'FileGrp','')
SET @FilegroupName = 'FileGrp' + CAST((@LastFilegroupName + 1) as varchar(10))

--Alter database statement
ALTER DATABASE VadivelTesting
ADD FILEGROUP @NewFG_Name

This script gives the following error "Incorrect syntax near '@NewFG_Name'."

When I give it a static name it works fine, but not with the variable.

Please can someone help me, I'm in struggeling with this one."

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved