Showing posts with label isnt. Show all posts
Showing posts with label isnt. Show all posts

Tuesday, March 27, 2012

Convert a Date to a Day of the Week.

Hey, Im pretty sure this is possible, but let me know if it isnt.

I have a table of dates in the format "DD/MM/YYYY", is there a way of converting it to output the day of the week? for example 16/11/2007 would display Friday insted.

Thanks in advance John

selectdatepart(dw,GETDATE())

selectdatename(dw,GETDATE())

|||

Hi u can check out this

select datepart(dw,date_created) from users

select datename(dw,date_created) from users

Thank u

Baba

Please remember to click "Mark as Answer" on this post if it helped you.

|||

Thanks to the both of you, both methods worked amazingly faultlessly. Thanks John

Thursday, March 8, 2012

Contracting Rates in Canada

Appologies if this isnt the correct group for this post.
I'm about to start looking for my first Short term Contract in Canada
probably Toronto.
Have been in Perm DB Dev/DBA position in London for 3.5 years,
Exp is SQL Server (3.5 yrs) & Oracle (1 yr).
What sort of daily rates should I be looking/asking for. Am feeling
like I'm at the mercy of recruitment sharks having never contracted
before.
Any comments at all would be appreciated.
Bob
Wait for Tom Moreau reading the post. (He is a respected SQL Server
professional from Toronto)
"Bob" <casey_182@.hotmail.com> wrote in message
news:1e95514c.0411240419.1d6ba99f@.posting.google.c om...
> Appologies if this isnt the correct group for this post.
> I'm about to start looking for my first Short term Contract in Canada
> probably Toronto.
> Have been in Perm DB Dev/DBA position in London for 3.5 years,
> Exp is SQL Server (3.5 yrs) & Oracle (1 yr).
> What sort of daily rates should I be looking/asking for. Am feeling
> like I'm at the mercy of recruitment sharks having never contracted
> before.
> Any comments at all would be appreciated.

Contracting Rates in Canada

Appologies if this isnt the correct group for this post.
I'm about to start looking for my first Short term Contract in Canada
probably Toronto.
Have been in Perm DB Dev/DBA position in London for 3.5 years,
Exp is SQL Server (3.5 yrs) & Oracle (1 yr).
What sort of daily rates should I be looking/asking for. Am feeling
like I'm at the mercy of recruitment sharks having never contracted
before.
Any comments at all would be appreciated.Bob
Wait for Tom Moreau reading the post. (He is a respected SQL Server
professional from Toronto)
"Bob" <casey_182@.hotmail.com> wrote in message
news:1e95514c.0411240419.1d6ba99f@.posting.google.com...
> Appologies if this isnt the correct group for this post.
> I'm about to start looking for my first Short term Contract in Canada
> probably Toronto.
> Have been in Perm DB Dev/DBA position in London for 3.5 years,
> Exp is SQL Server (3.5 yrs) & Oracle (1 yr).
> What sort of daily rates should I be looking/asking for. Am feeling
> like I'm at the mercy of recruitment sharks having never contracted
> before.
> Any comments at all would be appreciated.

Contracting Rates in Canada

Appologies if this isnt the correct group for this post.
I'm about to start looking for my first Short term Contract in Canada
probably Toronto.
Have been in Perm DB Dev/DBA position in London for 3.5 years,
Exp is SQL Server (3.5 yrs) & Oracle (1 yr).
What sort of daily rates should I be looking/asking for. Am feeling
like I'm at the mercy of recruitment sharks having never contracted
before.
Any comments at all would be appreciated.Bob
Wait for Tom Moreau reading the post. (He is a respected SQL Server
professional from Toronto)
"Bob" <casey_182@.hotmail.com> wrote in message
news:1e95514c.0411240419.1d6ba99f@.posting.google.com...
> Appologies if this isnt the correct group for this post.
> I'm about to start looking for my first Short term Contract in Canada
> probably Toronto.
> Have been in Perm DB Dev/DBA position in London for 3.5 years,
> Exp is SQL Server (3.5 yrs) & Oracle (1 yr).
> What sort of daily rates should I be looking/asking for. Am feeling
> like I'm at the mercy of recruitment sharks having never contracted
> before.
> Any comments at all would be appreciated.

Tuesday, February 14, 2012

Constraints: disable / enable constraints issue

Isn't there a way, other then Enterprise Manager, to disable and / or enable
constraints, in particular primary and foreign keys? I am migrating data
daily from one system to SQL and to disable and enable manually is
inconvenient and combersome. I looked through BOL and cannot find a direct
answer on how to create a process to automatically disable and / or enable
constraints. Thanks.
You can use ALTER TABLE to disable a foreign key. You cannot disable a
primary key, since it uses a unique index.
Tom
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com
"Leida" <Leida@.discussions.microsoft.com> wrote in message
news:AD81D4EF-060C-41FA-82D0-A223EB41BD9A@.microsoft.com...
Isn't there a way, other then Enterprise Manager, to disable and / or enable
constraints, in particular primary and foreign keys? I am migrating data
daily from one system to SQL and to disable and enable manually is
inconvenient and combersome. I looked through BOL and cannot find a direct
answer on how to create a process to automatically disable and / or enable
constraints. Thanks.
|||Hi Leida
Foreign keys can be disabled using the ALTER TABLE command. Please see Books
Online for full syntax, or have Enterprise Manager script the operation to
show you the syntax to use.
Primary Keys cannot be disabled since they are supported by a unique index.
A unique index always must be maintained, so the only way to not enforce the
Primary Key is to drop the index, which means dropping the constraint.
HTH
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Leida" <Leida@.discussions.microsoft.com> wrote in message
news:AD81D4EF-060C-41FA-82D0-A223EB41BD9A@.microsoft.com...
> Isn't there a way, other then Enterprise Manager, to disable and / or
> enable
> constraints, in particular primary and foreign keys? I am migrating data
> daily from one system to SQL and to disable and enable manually is
> inconvenient and combersome. I looked through BOL and cannot find a direct
> answer on how to create a process to automatically disable and / or enable
> constraints. Thanks.
|||"Leida" <Leida@.discussions.microsoft.com> wrote in message
news:AD81D4EF-060C-41FA-82D0-A223EB41BD9A@.microsoft.com...

> Isn't there a way, other then Enterprise Manager, to disable and / or
enable
> constraints, in particular primary and foreign keys?
ALTER TABLE tablename NOCHECK CONSTRAINT ALL
|||Leida,
Importing dirty data is a common problem. This is typically handled as
follows:
1) Load the data in a load table. This is a table with no constraints,
and may just have varchar columns
2) Clean up the data
3) Copy the data in the right order to the target table(s).
The target tables will have all their constraints in place and need not
be removed or disabled. This guarantees a consistent database at all
times.
By the way: please note that when you enable constraints after they have
been disabled the existing data will *not* be validated. This means you
can introduce invalid data in the table.
Also note that when you disable a constraint, this is not just for your
connection, but server wide. So if you do not insert invalid data,
another user might...
Hope this helps,
Gert-Jan
Leida wrote:
> Isn't there a way, other then Enterprise Manager, to disable and / or enable
> constraints, in particular primary and foreign keys? I am migrating data
> daily from one system to SQL and to disable and enable manually is
> inconvenient and combersome. I looked through BOL and cannot find a direct
> answer on how to create a process to automatically disable and / or enable
> constraints. Thanks.
|||Thank you for your response. I have not tried this way of loading the data. I
will definately try this out.
"Gert-Jan Strik" wrote:

> Leida,
> Importing dirty data is a common problem. This is typically handled as
> follows:
> 1) Load the data in a load table. This is a table with no constraints,
> and may just have varchar columns
> 2) Clean up the data
> 3) Copy the data in the right order to the target table(s).
> The target tables will have all their constraints in place and need not
> be removed or disabled. This guarantees a consistent database at all
> times.
> By the way: please note that when you enable constraints after they have
> been disabled the existing data will *not* be validated. This means you
> can introduce invalid data in the table.
> Also note that when you disable a constraint, this is not just for your
> connection, but server wide. So if you do not insert invalid data,
> another user might...
> Hope this helps,
> Gert-Jan
>
> Leida wrote:
>
|||Thank you for your response, and the syntax. It was helpful.
"Mark Wilden" wrote:

> "Leida" <Leida@.discussions.microsoft.com> wrote in message
> news:AD81D4EF-060C-41FA-82D0-A223EB41BD9A@.microsoft.com...
> enable
> ALTER TABLE tablename NOCHECK CONSTRAINT ALL
>
>