Constraint on a Date Column to Not Allow Setting Weekend Dates

We are utilizing SQL Server 2008 R2 for scheduling AD user migrations. We keep track of all user accounts to be migrated and have a column for Migration_DATE with data type "Date". 
I am looking to add a constraint to the Migration_DATE column to not allow scheduling dates on weekends. In other words I don't want anyone setting dates that fall on the weekend or a list of dates on a table.  Can anyone help me with how to do this
or point me in the right direction. 
Thanks much!

Hello,
Based on your description, you had a table which used for track AD user migration. And you wan to alter the date column "Migration_DATE" to not allow insert weekend date. If I understanding correctly, you can add a constraint to check the insert values.
ALTER TABLE teble_name ADD constraint ck_Migration_date
CHECK (DATENAME(WEEKDAY,Migration_DATE) NOT IN ('Saturday','Sunday'))
Reference:Creating and Modifying CHECK Constraints
Regards,
Fanny Liu
If you have any feedback on our support, please click here. 
Fanny Liu
TechNet Community Support

Similar Messages

  • SharePoint List Form using InfoPath 2010 "Cannot insert the value NULL into column 'tp_DocId', table 'Content_SP_00003.dbo.AllUserData'; column does not allow nulls"

    I am experiencing issue with my SharePoint site , when I am trying to add new Item in List . Error given below :--> 02/03/2015 08:23:36.13 w3wp.exe (0x2E04) 0x07E8 SharePoint Server Logging Correlation Data 9gc5 Verbose Thread change; resetting trace
    level override to 0; resetting correlation to e2e9cddc-cf35-4bf8-b4f3-021dc91642da c66c2c17-faaf-4ff9-a414-303aa4b4726b e2e9cddc-cf35-4bf8-b4f3-021dc91642da 02/03/2015 08:23:36.13 w3wp.exe (0x2E04) 0x07E8 Document Management Server Document Management 52od
    Medium MetadataNavigationContext Page_InitComplete: No XsltListViewWebPart was found on this page[/sites/00003/Lists/PM%20Project%20Status/NewForm.aspx?RootFolder=&IsDlg=1]. Hiding key filters and downgrading tree functionality to legacy ListViewWebPart(v3)
    level for this list. e2e9cddc-cf35-4bf8-b4f3-021dc91642da 02/03/2015 08:23:36.17 w3wp.exe (0x1B94) 0x1A0C SharePoint Server Logging Correlation Data 77a3 Verbose Starting correlation. b4d14aec-5bd4-4fb1-b1e3-589ba337b111 02/03/2015 08:23:36.17 w3wp.exe (0x1B94)
    0x1A0C SharePoint Server Logging Correlation Data 77a3 Verbose Ending correlation. b4d14aec-5bd4-4fb1-b1e3-589ba337b111 02/03/2015 08:23:36.31 w3wp.exe (0x2E04) 0x07E8 SharePoint Foundation Database 880i High System.Data.SqlClient.SqlException: Cannot insert
    the value NULL into column 'tp_DocId', table 'Content_SP_00003.dbo.AllUserData'; column does not allow nulls. INSERT fails. The statement has been terminated. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at
    System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject
    stateObj) at System.Data.SqlClient.SqlDataReader.ConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavi... e2e9cddc-cf35-4bf8-b4f3-021dc91642da 02/03/2015
    08:23:36.31* w3wp.exe (0x2E04) 0x07E8 SharePoint Foundation Database 880i High ...or runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream,
    Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior,
    RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior) at Microsoft.SharePoint.Utilities.SqlSession.ExecuteReader(SqlCommand
    command, CommandBehavior behavior,

    Are you trying to setup P2P? Could you explain the process you followed completely? By anychance you create the backup and then created the publication?
    Regards, Ashwin Menon My Blog - http:\\sqllearnings.com

  • Create Materialized View ORA-01723: zero-length columns are not allowed

    I am trying to create a materialized view which derives a column from a function and I get: ORA-01723: zero-length columns are not allowed.
    I am using 10gR2 with the following definition (simple version):
    CREATE MATERIALIZED VIEW AS
    SELECT
    function_name(column_name) COLUMN_ALIAS
    FROM table_name;
    I have even tried to cast it like below:
    CREATE MATERIALIZED VIEW AS
    SELECT
    CAST(function_name(column_name) AS VARCHAR2(200)) COLUMN_ALIAS
    FROM table_name;
    My function does have an exception to return a value even if no values are found.
    I have looked all over for the solution. Does anyone have a way around this issue? I really need my function to derive the column as it has business rules which I cannot join into my materialized view definition. My only hope around this is to insert the values into a table and then create a materialized view from that table, I don't want to do that if someone has a solution around this.
    Any help would be greatly appreciated.
    Thank you,
    Kyle
    Edited by: Kyle Miller on Apr 19, 2011 8:28 AM

    Have you tried creating a table with the correct structure and then creating the materialized view based on the prebuilt table as described here...
    http://www.oaktable.net/content/ultra-fast-mv-alteration-using-prebuilt-table-option
    Cheers
    Ben

  • APP-PAY-07185 date track delete not allowed'

    When i am trying to terminate the employee for older date i am getting this errror.

    Hi,
    What is the application release?
    Please see these docs.
    While Attempting To Terminate an Employee, Receive Error APP-PAY-07185: Date Track Delete Not Allowed [ID 357192.1]
    APP-PAY-07185 Error when Terminating Employees [ID 429343.1]
    PERWSTEM APP-PAY-7185 - Reverse Termination of an Employee [ID 866802.1]
    Unable To Rehire App-Pay -07185** [ID 257769.1]
    Thanks,
    Hussein

  • How to retrieve latest date column comparing with rest of the date columns ??

    Hi Friends,
    I have 6 Date columns (some of col has Null data)  I need to compare all 6 columns date, how can I produce recent date to
    new Column! can you please help me Tsql Code or Function.
    Thanks for advance.

    Hej 
    create table datetest(id int,date1 datetime,date2 datetime,date3 datetime,date4 datetime)
    insert into datetest values(1,GETDATE(),GETDATE()-1,GETDATE()-2,GETDATE()-3)
    go
    SELECT  MAX(date_columns) AS max_dateFROM    ( (SELECT   date1 AS date_columns FROM     datetest         )          UNION          ( SELECT  date2 AS date_columns            FROM    datetest          )          UNION          ( SELECT  date3 AS date_columns            FROM    datetest          )  UNION          ( SELECT  date4 AS date_columns            FROM    datetest          )        ) AS date_query

  • How to Implement 30 days Range Partitioning with Date column. Not Interval

    Hi,
    I am using the db:
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit
    Current table structure is:
    CREATE TABLE A
    a NUMBER,
    CreationDate DATE
    PARTITION BY RANGE (CreationDate)
    INTERVAL ( NUMTODSINTERVAL (30, 'DAY') )
    (PARTITION P_FIRST
    VALUES LESS THAN (TIMESTAMP ' 2001-01-01 00:00:00'))
    How can I define virtual column based partitioning with RANGE partitioning without using INTERVAL partitioning.
    And that is with Intervals of 30 days.
    For monthly I am trying as
    CREATE TABLE A
    a NUMBER,
    CreationDate DATE,
    monthly_interval date as (to_char(CreationDate,'MM-YYYY')) VIRTUAL
    PARTITION BY RANGE (monthly_interval)
    partition p_AUG12 values less than (to_date('08-2012','mm-yyyy')),
    partition p_SEP12 values less than (to_date('09-2012','mm-yyyy')),
    partition p_OCT12 values less than (to_date('10-2012','mm-yyyy'))
    Enable ROw Movement
    BUT CAN'T INSERT the data even for that:
    Insert into a (a, CreationDate)
    Values (1, '12-10-2012')
    Insert into a (a, CreationDate)
    Values (1, '12-10-2012')
    Please suggest..

    Hi rp,
    Interval Partitioned to Range. Created Daily Partitions from Monthly Part. got complicated so I am posting here.
    Basically,
    I know Interval Partitioning is a kind of Range partitioning. But explicitly for Interval Partitioned tables XML Indexes are not allowed as discussed here:
    XMLIndexes on an Interval Partitioned Table??
    I can do monthly partitions as :
    CREATE TABLE A
    a NUMBER,
    CreationDate DATE,
    monthly_interval varchar2(8) as (to_char(CreationDate,'MM-YYYY')) VIRTUAL
    PARTITION BY RANGE (monthly_interval)
    partition p_AUG12 values less than ('09-2012'),
    partition p_SEP12 values less than ('10-2012'),
    partition p_OCT12 values less than ('11-2012')
    ) Enable ROw Movement
    Insert into a (a, CreationDate)
    Values (1, '12-SEP-2012')
    Insert into a (a, CreationDate)
    Values (1, '14-SEP-2012')
    Select * from A partition (p_SEP12)
    Select * from A partition (p_AUG12)
    Select * from A partition (p_OCT12)
    Can we do it for 30 days partitions, instead of the monthly partitions. ANY suggestions..
    Thanks..

  • System does not allow to enter data into cube

    Hello
    I use BPS NW2004s. I created a layout and execute "enter plan data". I realized that system does not allow me to enter data. Why?
    Alex

    I guess your cube is not transactional. Try to switch it to transactional

  • Upgradation issue 4.6C to 4.7 for DP90-Data transfer module not allowed

    Hi All.
    We have a issue in upgradation project form 4.6C to 4.7.
    Process we follow is Contract,Notification,Service order,Debit memo request.
    While doing DP90 for service order we are facing a error as <b>Data transfer module is not allowed</b>
    Afetr this system gives you only option to EXIT.
    In the log display we get following message :
    Data transfer module is not allowed
    Message no. V1247
    Diagnosis
    A wrong data transfer module was entered in Customizing for copying control. When you enter a sales order with reference to a quotation, you cannot copy header data from an invoice, for example. The module number is 306.
    System Response
    Processing is terminated.
    Procedure
    Check the copying control for your transaction in Customizing or contact your system administrator.
    Any idea how to deal with this
    Regards,
    Amrish Purohit

    Hi Amrish,
    There is a standard SAP program: SDTXT1AID. Start it, and the upper section you can find your incomplete parameters. Sign your relevant parameters (or all) and F8
    (not test case).
    I hope it will help you.
    regards,
    Zsuzsa

  • Deep Data Type is not allowed

    hi,
    Am writing this code and i am getting an error msg...
    type-pools : TRWBO.
    SELECTION-SCREEN BEGIN OF BLOCK b1.
    PARAMETERS : p_par type TRWBO_REQUEST.
    SELECTION-SCREEN end of BLOCK b1.
    theerror msg being :
    Deep Data Type "TRWBO_REQUEST" is not allowed
    so wat am i to do to remove this..???

    hi,
    try to declare as an internal table and then in select-option define with this internal table name insted of type-pools name.
    thanks,
    anupama.

  • COPA data source does not allow delta

    Hello,
    I wanna generate new COPA data source. I did it but it doies not allow to establish delta.
    Where I go to Simulate initialization of delta method and try to determinate time stamp the system tells me that "Function is not possible because data source is defined for generic delta"
    How can I establish delta???

    Aleksandrs, normally you only have to run a init load from BW. Then only delta packages.
    regards
    Siggi

  • In schedule line before delivery date , grc should not allow

    Hi MM expert,
    i am using schedule line process.
    now i want that i could not do Goods reciept before shedule line.
    kindly help.
    Regards,
    santosh

    Hi 
    Have you gone through entire Cycle process of Sceduleing agreement .
    If you have created Schedule agreement in -ME31L
    Then maitained delivery date [Schedule lines date]-in ME38
    Then SAP-System will not allow you to do the GR till the date as per the Delevery schedule lines date.
    After reaching that date you can do any time GR.
    Try it you will get it
    with regards
    Shrinivas gangoor

  • Error: columns are not equal when writeback data from Essbase to Oracle

    I got an error when writeback Budget data from Essbase to Oracle that: The number of columns returned by script [14] is less than the source data columns exposed [15] while my returned columns from script is 15
    My report script:
    <Sym
    {MISSINGTEXT ""}
    { SUPMISSINGROWS }
    //{SUPPAGEHEADING}
    {SUPBRACKETS}
    {SUPFEED}
    {SUPCOMMAS}
    { TABDELIMIT }
    { NAMESON }
    { ROWREPEAT }
    { NOINDENTGEN }
    {DECIMAL 0}
    //<COLUMN ("Version")
    <ROW ("Account","Sector","Resident / Non-Resident","HSP_Rates","Year","Profit_Center","Period","SubAccount","Currency","Branch","Scenario","Elements","Spare","Version")
    <IDESCENDANTS "Account"
    "S_NA"
    "R_0"
    "HSP_InputValue"
    "FY11"
    "Jan" "Feb" "Mar" "Apr" "May""Jun" "Jul" "Aug" "Sep" "Oct" "Nov" "Dec"
    <IDESCENDANTS "Profit_Center"
    "T_00"
    "Local"
    "P_682"
    "B_01"
    "Budget"
    "Amount"
    "E_0000"
    "Approved"
    *

    the solution to uncomment -> //{SUPPAGEHEADING}

  • Hide/disable a row of a list when "date" column is less than today's date.

    Hi,
    We are using a "Finalsubmitted" date column in my list. my requirement is once that date of Finalsubmitted column is expired(less than today's date), total row should be in hide/disable mode.Could you help me to achieve this.
    Thanks.

    that is a drop down, showing the results from another list based on our selection.
    We have used SP services for that.
    But, date conversion is wrong on  var pubdate= new date(dateselected.value) line.
    It is showing "NaN(Not a number)" . date format it is giving DDMMYYYY.
    But, i need MMDDYYYY. How can we convert in JavaScript.
    Plz check below code.
    <script language="javascript" type="text/javascript">
    $(document).ready(function()
    today = new Date();
    getTagFromIdentifierAndTitle("select","Lookup","Dates").onchange = function() {ChangeEvent1()};
    function ChangeEvent1()
    var dateSelected = document.getElementById("Dropdown ID");
    var pubdate = new Date(dateSelected.value);
    if(pubdate<=today)
    $("input[value$='Save']").attr('disabled', true); //button hides
    alert("Publishing Date should be greater than Today's Date");
    else
    $("input[value$='Save']").attr('disabled', false); //button shown
    function getTagFromIdentifierAndTitle(tagName, identifier, title) {
    var len = identifier.length;
    var tags = document.getElementsByTagName(tagName);
    for (var i=0; i < tags.length; i++) {
    var tempString = tags[i].id;
    if (tags[i].title == title && (identifier == "" || tempString.indexOf(identifier) == tempString.length - len)) {
    return tags[i];
    return null;
    }</script>

  • Master data loads Request not updated to any data target using delta

    When checking the PSA the request updated ICON has red triangle and the mouse over says
    "Request not updated to any data target using delta".
    I am doing full loads for text data and both full and delta's loads for Attributes. This is BI 7.0 system but the loads are still from 3.1.  DTP has not been implemented yet. The system was just upgraded in July.  I am unable to schedule deletes from the PSA for successful loads.  However, I think the data is updating to the info objects.  My Info package has the selection to PSA then in the InfoObject package by package.  
    How do I schedule the deletes from PSA and why does the Request updated show red but the monitor for the info package show green?
    Edited by: Joe Mallorey on Jan 27, 2009 5:46 PM

    Hi shikha,
    The load has not failed but I am unable to delete the load from the PSA.
    If you do a manage on the Data Source or go to PSA from RSA1 the first column has the green gear icon instead of a green check mark I have red triangle the mouse over says "request not updated to any data target using delta" The data has loaded to info object. I am trying to schedule deletes from the PSA and using the option to "delete only successfully booked/updated requests" So how do I get the request updated column to show a green check mark so my deletes will Process? This is for master data only. My transactions load fine and delete properly according to my settings.
    Thanks for the reply.
    Regards,
    JoeM

  • Date modified/Date Created/Date Added(timestamp) - not showing the actual date?

    In finder, none of the date info seems to be accurate.
    By example, I just downloaded a new app from a website (onyx in this case), todays date is Nov 13th and when I install the new app (i.e. drag and drop into Apps folders) in finder the Date modified says Nov. 1st, Date created says October 31. Should one of these columns not reflect the true date that the app actually got onto my mac? I understand that one of these clumns probably relfects the info contained within the downloaded app, but surely one column can tell me that I installed this app on November 13! The "Last opened" columns is the only "accurate" date column I have. (as I write this however, i've noticed that the 'Date Added column does say "Today").
    I gues my question is what columne reflect what the file itself has imbedded in it, and what relfects the actions i've done (I.e. installed the app on Nov 13)
    Any help would be very much appreciated. Note sure if this is somehting more worrisome or not, but i've had it for a while with no major issues other than frsutration of not understanding this. i'm on 10.7.2

    The Date Modified column for the Applications folder itself will reflect the actual installation date. The others aren't supposed to.
    (61530)

Maybe you are looking for

  • Games and friends??

    I am new to the game center, not sure this is where I post or not, how do I find friends that play the same games as I do? I play Moonlight Mahjong and looking for friends? Thanks

  • Parsing String to date

    This is my function to convert a string into a desired output format.But my Date in the desired output format is coming out to be null.Could smeone plz point out my mistake. Date getDateInDesiredFormat(String strInputDate,String strInputFormat,String

  • Bean-managed stateless session bean can't roll back using JTA

    I use weblogic6.1sp2 + jdk131 a stateless session bean must do 2 things: insert a record to A table and delete another record in A table this bean has the same structure as the example in j2eetutorial/examples/src/ejb/teller I use TxDataSource in web

  • What to do if Itunes has charged me twice for the same "in-app" purchase?

    It is clearl seen in the Itunes invoice. How can I get my money back? BTW, I used a german Itunes account for it. Thanks in advance for any help you could offer to me.

  • Converting .fla or .swf to .mov (Quicktime)

    I've read the thread about Quicktime 7.3.1 which I have not supporting Flash files. That being said, is there anyway to open a .swf or .fla file and convert to .mov to be used with Final Cut Pro? Thanks in advance, Shelley