Showing posts with label experience. Show all posts
Showing posts with label experience. Show all posts

Wednesday, March 28, 2012

RAID and Cluster!

Hi All, Want to seek advice and experience from all of you. What is the
recommended RAID Solution for SQL Cluster on SAN, is it RAID 1+0 or RAID-5?
We just upgraded from RAID 1+0 to RAID 5 and since then we are getting
hiccups on the Cluster. If there is any connectivity failures on the Drives
(which are recovered after few mins) the Cluster goes haywire and becomes
unavailable (for e.g. it fails to read off the Quorum Log etc...)
Thanks in adv.
Env:
Win2000 Adv Server SP4
SQL2000 SP4
"Vai2000" <nospam@.microsoft.com> wrote in message
news:%23Lb1UxbIGHA.524@.TK2MSFTNGP09.phx.gbl...
> Hi All, Want to seek advice and experience from all of you. What is the
> recommended RAID Solution for SQL Cluster on SAN, is it RAID 1+0 or
RAID-5?
> We just upgraded from RAID 1+0 to RAID 5 and since then we are getting
> hiccups on the Cluster. If there is any connectivity failures on the
Drives
> (which are recovered after few mins) the Cluster goes haywire and becomes
> unavailable (for e.g. it fails to read off the Quorum Log etc...)
>
> Thanks in adv.
>
|||First, you need to fix you SAN issues, with or without clustering SQL really
likes to have its disks online at all times.
Have you separated your Databases and Transaction Log files? RAID 1 or 10
for the Logs. Raid 5 or 10 for the Databases. Quorum & MSDTC (if required)
on its own disk subsystems of 1 GB in size.
Cheers,
Rod
MVP - Windows Server - Clustering
http://www.nw-america.com - Clustering Website
http://msmvps.com/clustering - Blog
http://www.clusterhelp.com - Cluster Training
"Vai2000" <nospam@.microsoft.com> wrote in message
news:%23Lb1UxbIGHA.524@.TK2MSFTNGP09.phx.gbl...
> Hi All, Want to seek advice and experience from all of you. What is the
> recommended RAID Solution for SQL Cluster on SAN, is it RAID 1+0 or
> RAID-5?
> We just upgraded from RAID 1+0 to RAID 5 and since then we are getting
> hiccups on the Cluster. If there is any connectivity failures on the
> Drives
> (which are recovered after few mins) the Cluster goes haywire and becomes
> unavailable (for e.g. it fails to read off the Quorum Log etc...)
>
> Thanks in adv.
>
|||That's not an upgrade, it is a reconfiguration. They do completely
different things. By RAID 1+0 do you mean a stripe of mirrors or a mirror
of stripes?
In either case, the answer is, I don't know. RAID5 gives particular levels
of redundancy while incurring a performance impact for certain types of I/O
patterns. A mirror of stripes gives equivalent redundancy to RAID5 without
having quite a much of a performance impact on certain types of I/O
patterns. A stripe of mirrors gives much greater redundancy than the other
two and generally better performance as well. But, if you are saturating
the I/O channel or stuffing all of your data on a tiny subset of the drives
in the SAN, it really isn't going to matter very much. The recommendations
also vary depending upon whether you have an access pattern that looks like
"tradional OLTP", "traditional DW", or a mix of the two.
Regardless of the performance characteristics, neither one is going to be
more stable than the other in your case. If the SAN drives disconnect, it
doesn't matter if it is a cluster or a standalone SQL Server, it isn't going
to like it. You have to fix the errors on your SAN that are causing the
disconnects first. If those aren't fixed, there isn't anything you are
going to be able to do to make the system stable.
Mike
http://www.solidqualitylearning.com
Disclaimer: This communication is an original work and represents my sole
views on the subject. It does not represent the views of any other person
or entity either by inference or direct reference.
"Vai2000" <nospam@.microsoft.com> wrote in message
news:%23Lb1UxbIGHA.524@.TK2MSFTNGP09.phx.gbl...
> Hi All, Want to seek advice and experience from all of you. What is the
> recommended RAID Solution for SQL Cluster on SAN, is it RAID 1+0 or
> RAID-5?
> We just upgraded from RAID 1+0 to RAID 5 and since then we are getting
> hiccups on the Cluster. If there is any connectivity failures on the
> Drives
> (which are recovered after few mins) the Cluster goes haywire and becomes
> unavailable (for e.g. it fails to read off the Quorum Log etc...)
>
> Thanks in adv.
>
|||Not to mention that unless you have proper host isolation in the SAN, you
are going to run into severe spindle contention, even if this particular
host's channels are not saturated.
Anthony Thomas

"Michael Hotek" <mike@.solidqualitylearning.com> wrote in message
news:%234b0uwdIGHA.676@.TK2MSFTNGP10.phx.gbl...
> That's not an upgrade, it is a reconfiguration. They do completely
> different things. By RAID 1+0 do you mean a stripe of mirrors or a mirror
> of stripes?
> In either case, the answer is, I don't know. RAID5 gives particular
levels
> of redundancy while incurring a performance impact for certain types of
I/O
> patterns. A mirror of stripes gives equivalent redundancy to RAID5
without
> having quite a much of a performance impact on certain types of I/O
> patterns. A stripe of mirrors gives much greater redundancy than the
other
> two and generally better performance as well. But, if you are saturating
> the I/O channel or stuffing all of your data on a tiny subset of the
drives
> in the SAN, it really isn't going to matter very much. The
recommendations
> also vary depending upon whether you have an access pattern that looks
like
> "tradional OLTP", "traditional DW", or a mix of the two.
> Regardless of the performance characteristics, neither one is going to be
> more stable than the other in your case. If the SAN drives disconnect, it
> doesn't matter if it is a cluster or a standalone SQL Server, it isn't
going[vbcol=seagreen]
> to like it. You have to fix the errors on your SAN that are causing the
> disconnects first. If those aren't fixed, there isn't anything you are
> going to be able to do to make the system stable.
> --
> Mike
> http://www.solidqualitylearning.com
> Disclaimer: This communication is an original work and represents my sole
> views on the subject. It does not represent the views of any other person
> or entity either by inference or direct reference.
> "Vai2000" <nospam@.microsoft.com> wrote in message
> news:%23Lb1UxbIGHA.524@.TK2MSFTNGP09.phx.gbl...
becomes
>
sql

Tuesday, March 20, 2012

Quorum Disk or Majority Node?

New to Windows MCS 2003 is the Majority Node Set option, does anyone have
any experience where Majority Node is better than Quorum or vica versa?
If you want the quorum locally on each machine, MNS is for you. If you are
ok with the Quorum in one spot, go with the traditional method. In neither
case does it change the requirements for SQL Server Databases to reside on
shared storage.
Cheers,
Rod
MVP - Windows Server - Clustering
http://www.nw-america.com - Clustering Website
http://msmvps.com/clustering - Blog
http://www.clusterhelp.com - Cluster Training
"Kevin Antel" <kevina@.cqlcorp.com> wrote in message
news:um8P7Y5FGHA.208@.tk2msftngp13.phx.gbl...
> New to Windows MCS 2003 is the Majority Node Set option, does anyone have
> any experience where Majority Node is better than Quorum or vica versa?
>
|||Is there a "best practice"? Better to have in one spot or two?
"Rodney R. Fournier [MVP]" <rod@.die.spam.die.nw-america.com> wrote in
message news:ul1t%23f5FGHA.1676@.TK2MSFTNGP09.phx.gbl...
> If you want the quorum locally on each machine, MNS is for you. If you are
> ok with the Quorum in one spot, go with the traditional method. In neither
> case does it change the requirements for SQL Server Databases to reside on
> shared storage.
> Cheers,
> Rod
> MVP - Windows Server - Clustering
> http://www.nw-america.com - Clustering Website
> http://msmvps.com/clustering - Blog
> http://www.clusterhelp.com - Cluster Training
> "Kevin Antel" <kevina@.cqlcorp.com> wrote in message
> news:um8P7Y5FGHA.208@.tk2msftngp13.phx.gbl...
>
|||Traditional is the best practice. Very few corporations need MNS. Nothing
wrong with it, just the true need is small.
Cheers,
Rod
MVP - Windows Server - Clustering
http://www.nw-america.com - Clustering Website
http://msmvps.com/clustering - Blog
http://www.clusterhelp.com - Cluster Training
"Kevin Antel" <kevina@.cqlcorp.com> wrote in message
news:OA8fto5FGHA.532@.TK2MSFTNGP15.phx.gbl...
> Is there a "best practice"? Better to have in one spot or two?
>
> "Rodney R. Fournier [MVP]" <rod@.die.spam.die.nw-america.com> wrote in
> message news:ul1t%23f5FGHA.1676@.TK2MSFTNGP09.phx.gbl...
>
|||SQL Server does not support Majority Node Clusters.
Geoff N. Hiten
Senior Database Administrator
Microsoft SQL Server MVP
"Kevin Antel" <kevina@.cqlcorp.com> wrote in message
news:um8P7Y5FGHA.208@.tk2msftngp13.phx.gbl...
> New to Windows MCS 2003 is the Majority Node Set option, does anyone have
> any experience where Majority Node is better than Quorum or vica versa?
>
|||I found a very interesting article here :
http://www.microsoft.com/windowsserv...lustergeo.mspx
The chapter "Three-Site Majority Node Set Quorum in Geographically Dispersed
Clusters to Facilitate Automatic Failover" was the exact solution for some of
my split brain problems, so I wanted to try this solution.
Do you mean that it is a non applicable solution with SQLServer ?
Why ? (I was thinking that the impact was limited to Quorum+MSCS, not
clustered resources !)
Thanks for your reply.
Guillaume.
=======================
"Geoff N. Hiten" wrote:

> SQL Server does not support Majority Node Clusters.
> --
> Geoff N. Hiten
> Senior Database Administrator
> Microsoft SQL Server MVP
>
> "Kevin Antel" <kevina@.cqlcorp.com> wrote in message
> news:um8P7Y5FGHA.208@.tk2msftngp13.phx.gbl...
>
>
|||I would disagree with Geoff's statement that SQL Server does not support
majority node clusters, unless he can point us to the relevant MS
documentation. I have many customers doing MNS and SQL server
implementations; as long as you understand the requirements and limitations.
I believe MNS were introduced to facilitate clustering across remote
locations, hence no shared storage. Obviously, you have to have a
replacement for that shared storage so that the SQL data is available on the
passive node in the event of a failure. What that means is that you need to
do some sort of replication, usually a third party product such as NSI
DoubleTake for replication.
The other requirement is that a majority of the servers need to be available
in order for a failover to take place. So that means you need to have at
least 3 nodes in your cluster in order to have a failover, because in a two
node cluster if one node fails you only have one node left, and 1 of 2 is
not a majority. You need at least 2 out of 3 nodes to have a majority.
In a local cluster where shared storage is available, you will want to go
with the traditional quorum based clustering. If you have no shared
storage, you will want to go with MNS and data replication.
Alternatively you can ditch MSCS altogether and go with a third party
solution such as LifeKeeper Protection Suite for SQL Server from SteelEye
Technology which is a HA and DR solution combined which eliminates the need
for MSCS, MNS, shared storage and a quorum device.
DISCLAIMER: I am a SteelEye Engineer with years of experience implementing
HA and DR for WIndows solutions including Exchange and SQL server.
"GNocent" <GNocent@.discussions.microsoft.com> wrote in message
news:E6E414F7-795A-42A4-9D7E-7AEF21FACEB2@.microsoft.com...
> I found a very interesting article here :
>
http://www.microsoft.com/windowsserv...lustergeo.mspx
> The chapter "Three-Site Majority Node Set Quorum in Geographically
Dispersed
> Clusters to Facilitate Automatic Failover" was the exact solution for some
of[vbcol=seagreen]
> my split brain problems, so I wanted to try this solution.
> Do you mean that it is a non applicable solution with SQLServer ?
> Why ? (I was thinking that the impact was limited to Quorum+MSCS, not
> clustered resources !)
> Thanks for your reply.
> Guillaume.
> =======================
> "Geoff N. Hiten" wrote:
have[vbcol=seagreen]
versa?[vbcol=seagreen]
|||How about:
SQL Server does not NATIVELY support MNS clustering. Third party add-ons
may alter this behavior.
Geoff N. Hiten
Senior Database Administrator
Microsoft SQL Server MVP
"DAVID A BERMINGHAM" <david.bermingham@.steeleye.nospam.com> wrote in message
news:eKdpQd2JGHA.1132@.TK2MSFTNGP10.phx.gbl...
>I would disagree with Geoff's statement that SQL Server does not support
> majority node clusters, unless he can point us to the relevant MS
> documentation. I have many customers doing MNS and SQL server
> implementations; as long as you understand the requirements and
> limitations.
> I believe MNS were introduced to facilitate clustering across remote
> locations, hence no shared storage. Obviously, you have to have a
> replacement for that shared storage so that the SQL data is available on
> the
> passive node in the event of a failure. What that means is that you need
> to
> do some sort of replication, usually a third party product such as NSI
> DoubleTake for replication.
> The other requirement is that a majority of the servers need to be
> available
> in order for a failover to take place. So that means you need to have at
> least 3 nodes in your cluster in order to have a failover, because in a
> two
> node cluster if one node fails you only have one node left, and 1 of 2 is
> not a majority. You need at least 2 out of 3 nodes to have a majority.
> In a local cluster where shared storage is available, you will want to go
> with the traditional quorum based clustering. If you have no shared
> storage, you will want to go with MNS and data replication.
> Alternatively you can ditch MSCS altogether and go with a third party
> solution such as LifeKeeper Protection Suite for SQL Server from SteelEye
> Technology which is a HA and DR solution combined which eliminates the
> need
> for MSCS, MNS, shared storage and a quorum device.
> --
> DISCLAIMER: I am a SteelEye Engineer with years of experience implementing
> HA and DR for WIndows solutions including Exchange and SQL server.
>
> "GNocent" <GNocent@.discussions.microsoft.com> wrote in message
> news:E6E414F7-795A-42A4-9D7E-7AEF21FACEB2@.microsoft.com...
> http://www.microsoft.com/windowsserv...lustergeo.mspx
> Dispersed
> of
> have
> versa?
>
|||What if for some reason you wanted to do a MNS and all 3 nodes where
attached to the same SAN? Not a good idea, but that would still be a MNS
and it does not require any third party products. No application with any
dynamic data supports MNS without some sort of shared disk, whether iSCSI,
SCSI, SAN or replicated disk.
"Geoff N. Hiten" <SQLCraftsman@.gmail.com> wrote in message
news:eM1JRF3JGHA.1028@.TK2MSFTNGP11.phx.gbl...
> How about:
> SQL Server does not NATIVELY support MNS clustering. Third party add-ons
> may alter this behavior.
> --
> Geoff N. Hiten
> Senior Database Administrator
> Microsoft SQL Server MVP
>
> "DAVID A BERMINGHAM" <david.bermingham@.steeleye.nospam.com> wrote in
message[vbcol=seagreen]
> news:eKdpQd2JGHA.1132@.TK2MSFTNGP10.phx.gbl...
need[vbcol=seagreen]
at[vbcol=seagreen]
is[vbcol=seagreen]
go[vbcol=seagreen]
SteelEye[vbcol=seagreen]
implementing[vbcol=seagreen]
http://www.microsoft.com/windowsserv...lustergeo.mspx[vbcol=seagreen]
anyone
>
|||The solution that interested me was this one :
* Site 1 & Site 2 have hardware replicated storage and are connected via SAN.
* Site 3 is just connected via network and has only local disks.
* 3 nodes are part of the cluster (1 on each site)
* SQLServer instance can be hosted on node 1 or 2 only
* node 3 is only here for Quorum vote (not eligible for SQLServer instance)
Is that possible without 3rd party software ?
If you can explain me quickly why or why not, i would really appreciate (the
whitepaper is not very explicit) !
Thanks.
Guillaume.
=====================================
"DAVID A BERMINGHAM" wrote:

> What if for some reason you wanted to do a MNS and all 3 nodes where
> attached to the same SAN? Not a good idea, but that would still be a MNS
> and it does not require any third party products. No application with any
> dynamic data supports MNS without some sort of shared disk, whether iSCSI,
> SCSI, SAN or replicated disk.
> "Geoff N. Hiten" <SQLCraftsman@.gmail.com> wrote in message
> news:eM1JRF3JGHA.1028@.TK2MSFTNGP11.phx.gbl...
> message
> need
> at
> is
> go
> SteelEye
> implementing
> http://www.microsoft.com/windowsserv...lustergeo.mspx
> anyone
>
>

Friday, March 9, 2012

Quick Question on Relationships

Hopefully, this is an easy one for people with more experience with SQL than me...

Is it possible to create a foriegn key relationship between two tables in SQL that relates one column in the primary table to two columns in a secondary table?

For example, say you have a table with user account information, and you want to store some type of interaction (some type of correspondence, for example) between two users. The second table (used to store interaction), among other things, stores the primary keys that indentify the two user profiles (in this scenario, say the primary key for the users is a single column surrogate key). So you store both user's keys in the second table in their own columns (one to note who started the correspondence, the second to note who the correspondence was sent to).

Is there a way to define (in my mind, I see it as two) relationships that would relate the primary key column to both columns in the second table so you can cascade a delete? Enterprise Manager for SQL2k won't let you do this (at least that I can find).

Is there the type of scenario that a Trigger would come into play?Do you mean like:

USE Northwind
GO

SET NOCOUNT ON
CREATE TABLE myUsers99(UserId int PRIMARY KEY, UserType varchar(10))
CREATE TABLE myNotes99(UserId1 int, UserId2 int, Notes varchar(255)
, FOREIGN KEY (UserID1) REFERENCES myUsers99(UserId)
, FOREIGN KEY (UserID2) REFERENCES myUsers99(UserId)
)
GO

SET NOCOUNT OFF
DROP TABLE myNotes99
DROP TABLE myUSers99
GO|||It's called a Many-To-Many relationship.

The values in each dataset can be related to more than one value in the other dataset through an intermediary table. In your case, both datasets are the same table.|||Exactly, except I want to cascade deletes to the child table. If a user is deleted from myUsers99 then any rows in myNotes99 that reference that user ID will cause errors in the code. If you select the Cascade Delete checkbox, then Enterprise Manager throws an error when saving the changes that it creating the contraints "may cause cycles or multiple cascade path", which is actually what I want.

I could do this pretty easily through code, but I have become a fan as of late of moving as much RI maintenance into the database layer instead of runtime.|||Very dangerous. You better be damn sure of your record relationships.

You are best off doing this using a stored procedure to delete your records, but if you insist on having it tied to the schema then you could do it in a trigger.|||Blindman and Brett, thanks for the quick answers. It looks like I will rethink this idea and go about it a little differently.|||Very dangerous.

Ummm...maybe...

I never use cascading updates or deletes, and I do prefer to do all the work in a stored procedure.

As a matter of fact, I prefer to totaly isolate developers to only have EXEC authority to sprocs, so I know that no errant DML will cause any data integrity issues.

Also, the fact of having as much constraints isloated to the database the better...

So without furth ado...my first INSTEAD OF TRIGGER

USE Northwind
GO

SET NOCOUNT ON
CREATE TABLE myUsers99(UserId int PRIMARY KEY, UserType varchar(10))
CREATE TABLE myNotes99(UserId1 int, UserId2 int, Notes varchar(255)
, FOREIGN KEY (UserID1) REFERENCES myUsers99(UserId)
, FOREIGN KEY (UserID2) REFERENCES myUsers99(UserId)
)
GO

CREATE TRIGGER myTrigger99 ON myUsers99 INSTEAD OF DELETE
AS
BEGIN
DELETE FROM myNotes99
WHERE UserID1 IN (SELECT UserId FROM deleted)
OR UserID2 IN (SELECT UserId FROM deleted)

DELETE FROM myUsers99
WHERE UserId IN (SELECT UserId FROM deleted)
END
GO

INSERT INTO myUsers99(UserId, UserType)
SELECT 1,'Manager' UNION ALL
SELECT 2,'Client' UNION ALL
SELECT 3,'Scrub'
GO

INSERT INTO myNotes99(UserId1, UserId2, Notes)
SELECT 1,3,'Get to work' UNION ALL
SELECT 1,2,'Have a nice day' UNION ALL
SELECT 1,1,'Note to self...fire scrub'
GO

SELECT * FROM myNotes99
GO

DELETE FROM myUsers99 WHERE UserID = 1
GO

SELECT * FROM myUsers99
GO

SELECT * FROM myNotes99
GO

SET NOCOUNT OFF
DROP TRIGGER myTrigger99
DROP TABLE myNotes99
DROP TABLE myUSers99
GO|||NEVER use cascading updates and deletes?

Would you NEVER use a self-cleaning oven?

NEVER use cruise control?

NEVER use your home's thermostat?

Implementing cascading updates and deletes doesn't preclude you from limiting user access only to stored procs. It just means you don't have to duplicate built-in functionality with custom code!|||NEVER use cascading updates and deletes?

No. Cascading Updates. Wouldn't you consider that a new Entity? Wouldn't you want to keep history? Oh, wait, you're in the surrogate camp? Yes

Would you NEVER use a self-cleaning oven?

Never...the wife does though

NEVER use cruise control?

Actually, no, I don't...I live in the New York Metro Area...not a chance

NEVER use your home's thermostat?

I assume you mean a programmable one...I haven't figured out to program yet...(I defer to the missus...what say would I have over what the temp was)

Implementing cascading updates and deletes doesn't preclude you from limiting user access only to stored procs. It just means you don't have to duplicate built-in functionality with custom code!

For Key information only...And wasn't your earlier point that it was dangerous?

And whether it was with a trigger, constraint or a sproc, what's the difference?

OK, Here's one. Any inadvertant DML and with cascading, you could blow away an entire relational tree...ooops...

I guess you could always have a recovery procedure if you kept history|||And whether it was with a trigger, constraint or a sproc, what's the difference?the difference is how much time you have to spend writing it

:)|||Ha ha! I knew that post would provoke a heated response! ;)

As far as your comment about inadvertently blowing away a whole relational tree, if you duplicate cascading deletes in your stored proc then you may have shifted that danger, but you haven't eliminated it.|||Relying on CASCADE ON <whatever> is like believing that when you tell your wife to fill up the car, you can hope that she would fill up the windshield wipers flued which light has been on for the past 2 weeks. But guess what, - SHE DOESN'T!!! I guess the pont is that this method is for lazy DBA's, but I guess I am even lazier, which means I don't want to remember 6 months down the road that "there was a CASCADE ON DELETE last time I checked, I swear..." WRITE ONCE, REVISIT...NEVER!!!|||Comment deleted upon consideration of better judgement...|||Comment deleted upon consideration of better judgement...Hey, I liked the original post, before editing :D
Comparing it to a wife is a really unfair!|||Wow...lots to chew on!! Thanks for everyone's input! In this particular case, I am not really concerned with maintaining a history because this data is not very important. So if it gets lost its not a big deal and broken relationships will case problems because the hierarchy being consistent is pretty important for this (lesser of two evils).

In frankness, the user table will almost never have a row (user) deleted. Which is all the more reason to try and plan this in the DB rather than through a SP so programmers don't have to remember that they have to clean up such-and-such table if they delete a row from so-and-so table.

I guess if I used the deleted table method as Brett suggested I could maintain RI (just have to check both tables for messages instead of one) and set some type of scheduled batch to clean up that table from time to time ...just seems like a waste of space to lug around data that shouldn't ever be used in daily operation of the code.

I agree with blindman. Why re-invent the wheel and maintain RI through SP, Triggers, or code when the database can handle it for you automagically? Some may find it lazy (and I agree that it is if you over-rely on it), but its great most of the time.

I know MS probably has a good reason for not allowing this, but it just seems like it would a nice feature (granted, it would probably rarely be used) to be able to link one column in a table to two in another and be able to cascade deletes or updates.|||Well you have a special case, and that's one of the ways to do it.

But Cascading for me has a bigger philisopgical issue. Updates especially. You are not just messing with data.

You're messing with the key.

So if the key of a state table for New Jersey is NJ, and you want to change that key with a cascade update to all of it's children to XX, sure it's easy, but does it make sense?

Wouldn't NJ "live" historically? Wouldn't XX be a brand new entity?

While this thought doesn't apply to Deletes, Deletes are just dangerous. You want to delete a parent and all of it's children, fine, take care of it in a sproc.

MOO|||Wouldn't NJ "live" historically? only in your mind

BARK|||I don't think it would exist.

Example (admittedly very hypothetical, but go with it): If 'NJ' is being updated in your database to be something like 'N.J.' (another example is what happens if New Jersey changes its state name to 'Jersey' and the abbreviation becomes something like 'JY'), then wouldn't you want your child tables to cascade the change? If your code uses the foriegn key in the child table to look up the parent row to get the full name of the state, and you didn't cascade the update, then your code is now broken (or has to be re-written to handle the new state abbreviation...neither is an acceptable option in my opinion).

If the keys are important enough to define a relationship for, I personally think they should be important enough to cascade deletes and updates (assuming of course that the two keys are actually used *in practice* to reference parents/children and have the possibility of changing or being deleted...I know there will be exceptions to that thought). Otherwise, why use a relationship?

In my experience, it saves many-o-bottle of aspirin if the database maintains itself rather than the developers.

Saturday, February 25, 2012

Quick and Easy SQL Question . . .

I don't have much experience with writing Sql, which is why i'm not sure.

But basically, I have a MSSQL 2005 Database that a person can list a property with,

and if the property listing expires by date, the user can relist the listing.

The records on the search function are automatically sorted by date, and I want the relisted records to update the datecreated.

I added "DateCreated" to the relisting storedprocedure to change DateCreated to todays date, but I am guessing.

Specials = @.Specials,

ExpirationDate = @.ExpirationDate ,

DateCreated =GetDate(),

DateApproved = @.DateApproved,

This seems to work, but I just wanted to check to make sure it's in the proper format.

Thank you

Daniel Meis

darkknight187:

DateCreated =GetDate()

That is the right way to do it.

|||

Thank you for your reply, just wanted to be sure.