|
This sounds like homework, your a very naughty boy.
Create table Movies with movieid, desc, year, etc....
create table actor with actor id, name, etc...
create a MovieActor table which links the two tables Movies and Actor ( it will look like Id, MovieID, ActorID).
The same for directors....
Images is a blob or image files
Blog Have I http:\\www.frankkerrigan.com
|
|
|
|
|
Frank Kerrigan wrote: your a very naughty boy.
Another flashback to Monty Python: He's not the messia, he's a very naughty boy!
|
|
|
|
|
Only messia would say he's not the messia.
Blog Have I http:\\www.frankkerrigan.com
|
|
|
|
|
|
I can't believe I ran it, but looks like a little error in the above script.
The CREATE DATABASE process is allocating 2.00 MB on disk 'Online Mall_Data'.
The CREATE DATABASE process is allocating 1.00 MB on disk 'Online Mall_Log'.
Msg 207, Level 16, State 1, Procedure add_products, Line 25
Invalid column name 'Date_added'.
Msg 207, Level 16, State 1, Procedure update_products, Line 25
Invalid column name 'Date_added'.
I'm not going to debug it for you.
I hope this is a homework project, and not a commercial application you've posted online for the world to see! If you were my employee, I'd be a bit miffed if you'd just posted my database schema online.
You'll probably get better feedback if you stated what your aim was with the logic (giving specific examples), rather than just posting the database script.
ChrisB
|
|
|
|
|
yes it's a homework project
thank you for your time and help
Mohsen
|
|
|
|
|
Jeez - Well, what is it meant to do?
|
|
|
|
|
I think its a database for a MALL, though I'm not sure.
Blog Have I http:\\www.frankkerrigan.com
|
|
|
|
|
Frank Kerrigan wrote: I think its a database for a MALL
That reminds me of a joke:
A pregnant woman realises that she can't look after the identical twins she is expecting so she puts them up for adoption. Many years later she decides that she wants to meet them to see what they are like. She finds out that one has been adopted by a jewish family who named him Amal, the other by a Spanish family who named him Juan. She eventually manages to get in touch with the Spanish family and she meets Juan. However, she was never able to track down the current whereabouts of the Jewish family. She asks her husband how she is ever going to know what Amal looks like and he replied "If you've seen Juan you've seen Amal"!
Boom! Boom!
|
|
|
|
|
Im looking for a query who get result in packages
let me explain
select * from users where codgroup = 1
i get all the user belongs to group 1 (100 users)
i want a query who get the rows by packages ( 10 by 10 users).
I hope you can help me
PD: Only sql statements, not using paging gridview property
keep Learning and you never will be out of date...
|
|
|
|
|
Britney S. Morales wrote: i want a query who get the rows by packages
I don't understand what you mean by "packages"
Do you mean you only want the SQL to return 10 rows at a time?
|
|
|
|
|
Britney S. Morales wrote: i want a query who get the rows by packages ( 10 by 10 users).
PD: Only sql statements, not using paging gridview property
What's a package ? : (stupid answers on a postcard please )
Blog Have I http:\\www.frankkerrigan.com
|
|
|
|
|
I am guessing that you want something like this:
select <code>TOP 10</code> * from users where codgroup = 1 <code>AND </code><code>usersortfield > 'last groups greatest value' ORDER BY </code><code></code><code>usersortfield</code> EXAMPLE:
If you were ordering by LastName, you would do this to get the first 10:
select <code>TOP 10</code> * from users where codgroup = 1 </code><code><code>ORDER BY </code></code><code><code><code></code></code>LastName</code><code> Then, when you want the next 10, you would take the lastname from the last record in the previous 10 and:
select <code>TOP 10</code> * from users where codgroup = 1 </code><code>AND </code><code><code></code><code><code></code></code>LastName <code></code></code><code>> </code><code><code>'</code><font class="messagetitle">Morales</font></code><code>' </code><code><code>ORDER BY </code></code><code><code><code></code></code>LastName
(Of course, you wouldn't use LastName alone, because it isn't unique enough...but you can see what I mean by this example.)
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
Eric thats the point, it isnt the answer, but your post given to me a light in the dark,
(its just a sentence)
keep Learning and you never will be out of date...
|
|
|
|
|
I get
"System.NotSupportedException: The method specified is not supported by the current provider."
AdomdClient v8, VS 2003, SQL Server 2000
What's the cause of this and is there any way around it?
Kevin
|
|
|
|
|
I've been retained by a company to create a HIPAA compliant billing file from their current data. The useless government information guide (A useless government manual, how could that be?) they were provided with is about 2 phone books thick and would make an excellent campfire.
Does anyone have any experience working with HIPAA billing files? Any advice would be appreciated - excellent advice would be compensated!
Thanks
John
|
|
|
|
|
just a quickie...
Is there a feature in ms sql server that allows you to setup a stored-proc to be run at predefined times.. Im thinking along
the lines of the "scheduled tasks" in windows where you can choose to run a process every so often.
|
|
|
|
|
you can use sql server agent.
|
|
|
|
|
cheers mate
|
|
|
|
|
You can also use a DTS package (which uses SQL Server Agent)
Blog Have I http:\\www.frankkerrigan.com
|
|
|
|
|
Hi all,
I'm trying to get a couple of remote computers running a UI to be able to access an SQL database behind a VPN firewall. They can get through the VPN successfully but cannot connect to the database, which is set up to do validation via trusted connections.
Any ideas as to how I can set this up please?
|
|
|
|
|
Ensure that the TCP/IP port SQL Server is using is exposed through the firewall.
If you are using SQL Server 2000 you can find this out with the Enterprise Manager:
Right click the server icon for the server you wish to expose. Click Network Configuration. Ensure that TCP/IP is in the Enabled list (if not, seek advice from your Network Admin). Click TCP/IP in the Enabled list and click the "Properties" button below it. It will tell you the default port. You need to open that port on the firewall to see the SQL Server.
|
|
|
|
|
Keberos does not travel well across VPN links. Try using SQL user connections rather than trusted.
Blog Have I http:\\www.frankkerrigan.com
|
|
|
|
|
Hello.. I wonder if someone here could help me.
I have 2 MSSQL Server 2000 databases installed on 2 different machines. These are named Master & Servant. The master db is a Windows 2003 machine. The servant DB is Windows XP machine.
- I have successfully setup a linked server on the master that references the Servant DB.
- I then written a stored-proc on the Servant which adds a record to a table.
- i have successfully called this stored-proc from master db which adds a new row to the table.
When, however i try to call this stored-proc from a triger on the master db i recieve the following error.
The operation could not be performed because the OLE DB provider 'SQLOLEDB' was unable to begin a distributed transaction.
[OLE/DB provider returned message: New transaction cannot enlist in the specified transaction coordinator. ]
OLE DB error trace [OLE/DB Provider 'SQLOLEDB' ITransactionJoin::JoinTransaction returned 0x8004d00a].
My trigger currently looks like this:
IF EXISTS (SELECT name FROM sysobjects WHERE name = 'trig_testCopyDataAcrossDb' AND type = 'TR')<br />
DROP TRIGGER trig_testCopyDataAcrossDb<br />
GO<br />
CREATE trigger trig_testCopyDataAcrossDb on testbed FOR update, insert AS<br />
<br />
BEGIN<br />
SET XACT_ABORT ON -- this is required for distributed transactions.<br />
SET IMPLICIT_TRANSACTIONS OFF <br />
BEGIN DISTRIBUTED TRANSACTION distTrans<br />
<br />
--insert into servant.testbed.dbo.mytable ( DateTimeRaised ) VALUES ( getdate() )<br />
exec servant.testbed..sp_AddRecord<br />
<br />
COMMIT TRANSACTION<br />
END
What i must stress here and what i find wierd is that am able to call the stored-proc from Query Analyzer with success. I am only recieving this error when trying to call this stored-proc from my trigger.
-- modified at 12:17 Monday 9th October, 2006
|
|
|
|
|
Okay guys this one definatly tripped me up but ive managed to find a way to sort it. Firstly this table syncronisation is only a tempory job which i want for a couple of weeks so i didnt want to go through the whole replication bag. That is just to heavy-duty for what i need, and something that want be around in a month or so.
So, after reading a post over at MSDN forums i found that the reason why the call to the stored-proc works inside Query Analyzer. Query Analyzer only requires the oledb to support ITransactionLocal. - But triggers require ITransactionJoin.
I looked into distributed transactions but but couldnt come up with any work-arounds. It looks like there is a problem with our security settings and distributed transactions across the two servers.
In the end i stumbled upon this hack and added a "COMMIT TRANSACTION" as the first line of the trigger and this worked. - I guess this is commiting the distributed transaction first. Then i added the call to my stored-proc which now works.
the trigger now looks like this:
<br />
IF EXISTS (SELECT name FROM sysobjects WHERE name = 'trig_testCopyDataAcrossDb' AND type = 'TR')<br />
DROP TRIGGER trig_testCopyDataAcrossDb<br />
GO<br />
CREATE trigger trig_testCopyDataAcrossDb on testbed FOR update, insert AS<br />
<br />
BEGIN<br />
COMMIT TRANSACTION<br />
EXEC servant.testbed..sp_AddRecord<br />
END
|
|
|
|