RANGE BETWEEN in SQL Server

Hi All,
I am trying to convert following Oracle query to SQL Server and having issues in defining calculation in the BETWEEN of the PARTITION.
ORACLE Query:
SELECT  
  head.acct_unit, head.company,head.role_id,    
   AVG(head.HEADCOUNT) over 
      (partition by head.acct_unit, head.company,head.role_id
       order by head.posting_month 
       range between  head.posting_month - trunc(head.posting_month,'YYYY') PRECEDING and current row)  YTD_HEADCOUNT
FROM
TABLE_A head
SQL Server:
SELECT  
  HEAD.ACCT_UNIT, HEAD.COMPANY,HEAD.ROLE_ID, 
  AVG(HEAD.HEADCOUNT) OVER 
      (PARTITION BY HEAD.ACCT_UNIT, HEAD.COMPANY,HEAD.ROLE_ID
       ORDER BY HEAD.POSTING_MONTH 
       -- RANGE BETWEEN DATEDIFF(dd,DATEADD(yy, DATEDIFF(yy,0,HEAD.POSTING_MONTH), 0),HEAD.POSTING_MONTH)
PRECEDING AND CURRENT ROW
FROM
TABLE_A head
Any help in this regard is highly appreciated.
Regards,
Shijith
SE

hi,
when asking these kind of questions, you should provide a script to create an example table and data.
I presume you want the range from the beginning of the year to the present record;
if so, you could try this (again: I have no idea what datatype posting_month is, and how many records there are, and what you want to see)
SELECT  
  HEAD.ACCT_UNIT, HEAD.COMPANY,HEAD.ROLE_ID, 
  AVG(HEAD.HEADCOUNT) OVER 
      (PARTITION BY HEAD.ACCT_UNIT, HEAD.COMPANY,HEAD.ROLE_ID
       ORDER BY HEAD.POSTING_MONTH 
       RANGE BETWEEN (DATEPART(mm,HEAD.POSTING_MONTH)) PRECEDING
AND CURRENT ROW )
FROM
TABLE_A head
Regards, Nico
pdfaid, my blog

Similar Messages

  • What are the Major and Minor Diffs between oracle,sql server,MSAccess

    Hi all,
    Can any one explain or send me all the diff between
    oracle ,sql server,access..like how much data can each
    support,...
    Thanks

    Dear sir,
    here it is.
    http://www.oracle.com/database/product_editions.html

  • Problem with range page with SQL Server

    Please help
    JDev version JDEVADF_11.1.1.7.0_GENERIC_130226.1400.6493
    I am using range paging for one of the VOs. The VO is based on single table. The VO is bounded to af:table. We need to support both Oracle and SQL server.
    When database is Oracle , the range paging works fine.
    But when database is SQLServer only first page is fetched properly, all the other pages are just copy of first page. The pagesize is default (25).
    Did I miss anything ?
    With accessMode=Scrollable the table show correct data for both Oracle and SQLServer.
    This is my VO XML
    <?xml version="1.0" encoding="windows-1252" ?>
    <!DOCTYPE ViewObject SYSTEM "jbo_03_01.dtd">
    <!---->
    <ViewObject
      xmlns="http://xmlns.oracle.com/bc4j"
      Name="MessagesROVO"
      Version="11.1.1.64.93"
      InheritPersonalization="true"
      OrderBy='"TIMESTAMP" desc'
      BindingStyle="JDBC"
      CustomQuery="true"
      RowClass="model.bc4j.queries.admin.MessagesROVORowImpl"
      ComponentClass="model.bc4j.queries.admin.MessagesROVOImpl"
      FetchMode="FETCH_AS_NEEDED"
      PageIterMode="Full"
      UseGlueCode="false"
      Passivate="All"
      AccessMode="RANGE_PAGING">
      <DesignTime>
        <Attr Name="_codeGenFlag2" Value="Access|Coll|VarAccess"/>
        <Attr Name="_isExpertMode" Value="true"/>
        <Attr Name="_isCodegen" Value="true"/>
      </DesignTime>
      <Properties>
        <SchemaBasedProperties>
          <LABEL
            ResId="model.bc4j.queries.admin.MessagesROVO_LABEL"/>
        </SchemaBasedProperties>
      </Properties>
      <Variable
        Name="BINDApplicationName"
        Kind="viewcriteria"
        Type="java.lang.String">
        <AttrArray Name="ExtendedDataInts">
          <Item Value="0"/>
        </AttrArray>
      </Variable>
      <Variable
        Name="BINDServerName"
        Kind="viewcriteria"
        Type="java.lang.String">
        <AttrArray Name="ExtendedDataInts">
          <Item Value="1"/>
        </AttrArray>
      </Variable>
      <Variable
        Name="BINDStartTimestamp"
        Kind="viewcriteria"
        Type="java.lang.Float">
        <AttrArray Name="ExtendedDataInts">
          <Item Value="3"/>
        </AttrArray>
      </Variable>
      <Variable
        Name="BINDEndTimestamp"
        Kind="viewcriteria"
        Type="java.lang.Float">
        <AttrArray Name="ExtendedDataInts">
          <Item Value="4"/>
        </AttrArray>
      </Variable>
      <SQLQuery>
        <![CDATA[SELECT
        ERRORLOG.SGUID GUID,
        ERRORLOG.LLOGTYPE LOGTYPE,
        ERRORLOG.DTIMESTAMP TIMESTAMP,
        ERRORLOG.SSERVERNAME SERVERNAME,
        ERRORLOG.SAPPNAME APPNAME,
        ERRORLOG.SXMLERROR XMLERROR
    FROM
        ERRORLOG ERRORLOG]]>
      </SQLQuery>
      <ViewAttribute
        Name="Guid"
        IsUpdateable="false"
        IsPersistent="false"
        IsNotNull="true"
        PrecisionRule="true"
        Precision="40"
        Scale="0"
        Type="java.lang.String"
        ColumnType="NVARCHAR2"
        AliasName="GUID"
        Expression="GUID"
        SQLType="VARCHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="40"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="LogType"
        IsUpdateable="false"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="6"
        Scale="0"
        Type="java.lang.Integer"
        ColumnType="NUMBER"
        AliasName="LOGTYPE"
        Expression="LOGTYPE"
        SQLType="INTEGER">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="7"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="Timestamp"
        IsUpdateable="false"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="54"
        Scale="0"
        Type="java.lang.Float"
        ColumnType="FLOAT"
        AliasName="TIMESTAMP"
        Expression="TIMESTAMP"
        SQLType="FLOAT">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="18"/>
        </DesignTime>
        <Dependencies>
          <Item
            Value="OccuredAt"/>
        </Dependencies>
      </ViewAttribute>
      <ViewAttribute
        Name="ServerName"
        IsUpdateable="false"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="64"
        Scale="0"
        Type="java.lang.String"
        ColumnType="NVARCHAR2"
        AliasName="SERVERNAME"
        Expression="SERVERNAME"
        SQLType="VARCHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="64"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="AppName"
        IsUpdateable="false"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="10"
        Scale="0"
        Type="java.lang.String"
        ColumnType="NVARCHAR2"
        AliasName="APPNAME"
        Expression="APPNAME"
        SQLType="VARCHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="10"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="XmlError"
        IsUpdateable="false"
        IsQueriable="false"
        IsPersistent="false"
        PrecisionRule="true"
        Type="java.lang.String"
        ColumnType="LONGVARCHAR"
        AliasName="XMLERROR"
        Expression="XMLERROR"
        SQLType="VARCHAR"/>
      <ViewAttribute
        Name="OccuredAt"
        IsUpdateable="false"
        IsSelected="false"
        IsPersistent="false"
        PrecisionRule="true"
        Type="java.sql.Date"
        ColumnType="DATE"
        AliasName="VIEW_ATTR"
        SQLType="DATE"/>
      <ViewAttribute
        Name="Summary"
        IsUpdateable="false"
        IsSelected="false"
        IsPersistent="false"
        PrecisionRule="true"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="VIEW_ATTR"
        SQLType="VARCHAR"/>
      <ViewAttribute
        Name="TechnicalError"
        IsUpdateable="false"
        IsSelected="false"
        IsPersistent="false"
        PrecisionRule="true"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="VIEW_ATTR"
        SQLType="VARCHAR"/>
      <ViewCriteria
        Name="MessagesROVOCriteria"
        ViewObjectName="model.bc4j.queries.admin.MessagesROVO"
        Conjunction="AND">
        <Properties>
          <CustomProperties>
            <Property
              Name="displayOperators"
              Value="InAdvancedMode"/>
            <Property
              Name="autoExecute"
              Value="false"/>
            <Property
              Name="allowConjunctionOverride"
              Value="true"/>
            <Property
              Name="showInList"
              Value="false"/>
            <Property
              Name="mode"
              Value="Basic"/>
          </CustomProperties>
        </Properties>
        <ViewCriteriaRow
          Name="vcrow6"
          UpperColumns="1">
          <ViewCriteriaItem
            Name="Timestamp"
            ViewAttribute="Timestamp"
            Operator="BETWEEN"
            Conjunction="AND"
            Required="Optional">
            <ViewCriteriaItemValue
              Name="MessagesROVOCriteria_vcrow6_Timestamp_vcval0"
              Value=":BINDStartTimestamp"
              IsBindVarValue="true"/>
            <ViewCriteriaItemValue
              Name="MessagesROVOCriteria_vcrow6_Timestamp_vcval1"
              Value=":BINDEndTimestamp"
              IsBindVarValue="true"/>
          </ViewCriteriaItem>
          <ViewCriteriaItem
            Name="ServerName"
            ViewAttribute="ServerName"
            Operator="="
            Conjunction="AND"
            Value=":BINDServerName"
            IsBindVarValue="true"
            Required="Optional"/>
          <ViewCriteriaItem
            Name="MessagesROVOCriteria_vcrow6_AppName"
            ViewAttribute="AppName"
            Operator="="
            Conjunction="AND"
            Value=":BINDApplicationName"
            IsBindVarValue="true"
            Required="Optional"/>
        </ViewCriteriaRow>
      </ViewCriteria>
      <AttrArray Name="KeyAttributes">
        <Item Value="Guid"/>
      </AttrArray>
      <ResourceBundle>
        <XliffBundle
          id="model.resource.ViewObjectsBundle_en"/>
      </ResourceBundle>
    </ViewObject>

    ADF does not support VO Range Paging with MS SQL Server. ADF supports VO Range Paging only with Oracle DB:
    Oracle ADF Business Components with Multiple Databases
    As far as the document above is not quite clear, I took a look inside the source code of the methods buildRangePagingQuery(...) of classes oracle.jbo.server.ViewObjectImpl, oracle.jbo.server.BaseSQLBuildeImpl, oracle.jbo.server.SQLServerSQLBuilderImpl and oracle.jbo.server.OracleSQLBuilderImpl (ADF 11.1.1.7) in order to confirm my statement.
    In my opinion, it is possible to add Range Paging support for a SQLServer-backed VO by implementing a custom VO class and overriding the method ViewObjectImpl.buildRangePagingQuery(...). Your method implementation should take into account the specifics of MS SQL Server and its SQL syntax.
    Dimitar
    Message was edited by: DimitarDimitrov
    P.S. The oracle.jbo.server.SQLServerSQLBuilderImpl class does not implement its own buildRangePagingQuery() method and uses the method implementation from its base class oracle.jbo.server.BaseSQLBuilderImpl, The base implementation just returns the original VO query intact. This is the reason you get the same rows as from the 1st page when you try to navigate through the pages.

  • Create linked server between MS SQL Server 2008 standard edition to MS SQL Server 2008 express edition

    For the captioned issue, is it possible?  We have successfully created linked server between 2 MS SQL server 2008 standard edition, but failed for the standard and express edition.  Is there any trick to setup?  Thanks.

    Hello,
    SQL Server Management Studio Express Edition may not allow to create a linked server, but the workaround is to use the T-SQL. You can use sp_addlinkedserver and sp_addlinkedsrvlogin.
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • Syncronize between multiple SQL server 2008 Databases

    II am developing an application for a waterborne shipping company. The main office is running SQL server 2008 and holds an employee database. They would like each ship to have access to the Db. Each ship is also running SQL 2008. In addition each ship will
    have multiple user needing update access to the Db.
    I'm not sure it is smart (or even Possible) to sync between multiple copies of a SQL Server 2008 DB. I started (and am not opposed to using .net Sync Services, creating compact edition (.sdf) files on the servers and 'sharing' it with the users. The
    problem with this is the sdf file would have to be replicated on each user machine. This would make data integrity a challenge.
    I should note that the ships are only occasionally connected to the internet, so working directly with the office db is not possible.
    Does anyone have any ideas, or shoud I resolve myself to using a shared copy of a compact edition of the DB?
    Thanks

    Merge replication han handle occasionally connected "devices". But you need to figure out whether update conflicts are acceptable and/or whether you can write your software so they don't happen in the first place.
    Tibor Karaszi, SQL Server MVP |
    web | blog
    Thanks. That gives me a starting point. I'm sure I'll have many questions.
    Thans again.

  • Crossroads: SQL Server or Oracle

    I am at a crossroads now between learning SQL Server or Oracle. It appears to me that Oracle is a much harder learning curve but that experience and qualifications in this area set someone up with more sought after skills.
    Am wondering how long it would take to get to grips with Oracle 11g (if this is principally used in most firms) and if there is any free training on the Oracle site?

    meridius10 wrote:
    I am at a crossroads now between learning SQL Server or Oracle. Been there many years ago...
    It appears to me that Oracle is a much harder learning curve but that experience and qualifications in this area set someone up with more sought after skills.Correct. And I would say much more rewarding too ito job satisfaction.
    When I moved from SQL-Server to Oracle, I initially dislike the "complexity" of Oracle. SQL-Server was simply point and click and shoot. But then once you get to know the Oracle architecture, the flexibility, and the performance and scalability that can be achieved, SQL-Server seems like MS-Access.
    Am wondering how long it would take to get to grips with Oracle 11g (if this is principally used in most firms) and if there is any free training on the Oracle site?Depends on what exactly you want to get a grip on. Database administration? Development? And each of these are very broad areas and cover a wide range of specialised areas and technologies.

  • Re: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server

    Hi,
    I'm encountering an issue with "Named Pipes Provider, error: 40 windows" and am having problems determining how to fix it due to the environment I'm using.  I have two SQL Servers installed on two separate Win2K3 Server boxes, one is SQL Server 2000 and the other is SQL Server 2005.  The SQL Server 2000 contains the actual application data.  The 2005 database is used only for Reporting Services.  I've set up the reports on SSRS such that their datasources hit the 2000 server.  This is using SQL Server authentication.
    When testing the reports via SSRS (in Visual Studio 2005), the connection to the data works and the reports are generated fine.  When I deploy them to the reporting server and launch IE to test locally (still on the 2005 box), I get this "Named Pipes Provider, error 40" issue.  I made sure that Named Pipes and TCP were enabled and the port set at 1433 (to match that on the 2000 box). 
    Now I changed the datasource's authentication from SQL Server to Windows authentication.  I tested this in SSRS and this works too.  When I redeployed the reports with this authentication change, testing the reports via IE locally (on the 2005 box) worked.  Great.  Now when I open IE on an external box, i.e. on the 2000 box, and try to test the reports, I get this same error 40 issue.  I've been through a few threads describing the error 40, fiddling around with the SQL Server configuration as well as SSRS, to no avail.  I have a feeling this error 40 issue has to due with permissions/authentication between the SQL Server boxes but I can't really be sure.  Anyone have any ideas on how to troubleshoot my situation.  Thanks.
    larry

    Named Pipes Provider, error: 40 - Could not open a connection to SQL Server :
    I.   Incorrect connection string, such as using SqlExpress.
    Check out: http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=558456&SiteID=17
                    https://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1245564&SiteID=1
    The typical error when dealing with Express includes:
    a.  User is not aware of SqlExpress was installed as a named instance, consequently, in his/her connection string, he/she only specify ".","localhost" etc instead of ".\SqlExpress" or "<machinename>\Sqlexpress".
    b. Np was disabld by default after installing SqlExpress.
    c. If Sqlexpress was installed on the remote box, you need to enable remote connection for Express.
    Please read the following blog for best practice of connecting to SqlExpress.
    http://blogs.msdn.com/sql_protocols/archive/2006/03/23/558651.aspx
    II. Named Pipes(NP) was not enabled on the SQL instance.
    Check out: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=136253&SiteID=1
    Oppose to SQL 2000 which turn on all protocols, SQL 2005 SKUs turn off NP by default. So, when you see this error, please check:
    1) Go to SQL Server Configuration Manager, See Server has NP enabled.
    2) %windir%\program files\microsoft sql server\mssql.1\mssql\log, notepad ERRORLOG, see whether Server is listening on NP.  You should see "Server named pipe provider is ready to accept connection on [ \\.\pipe\sql\query ] or [\\.\pipe\mssql$<InstanceName>\sql\query]"
    3) Notice that "sql\query" is the default pipe name, so you need to know server is listening on which pipe name. eg: if you specify server pipe name is "sql\query1", then you would see in the errorlog that server listening on [ \\.\pipe\sql\query1 ], and go to SQL Server Configuration Manager, click client Named Pipe properties, see whether the pipe name is same with the one server listening on.
    4) If you are using SQL Native Client ODBC/OLEDB provider({SQL Native Client} or SQLNCLI), go to SQL Configuration Manager, click client protocols, make sure NP and TCP are both enabled. Right click properties of NP, make sure client is using the same pipe name as server for connection.
    5) If you are using MDAC ODBC/OLEDB({SQL Server} or SQLOLEDB) provider, in command line, launch "cliconfg.exe" and make sure NP enabled and right pipe name specified.
    III. Remote connection was not enabled. 
    Check out: when you right click on the Server in SQL Server Management Studio, in Connections, the Remote server connections part, you have enabled the "Allow remote connections to this server" check box
    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=322792&SiteID=1
    https://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=763875&SiteID=1
    If you are making a remote connection, namely, your target SQL Server is on the different box as client application, you might need to check whether:
    a. "File and Printer Sharing" was opened in Firewall exception list.
    b. Please see the blog for enabling remote connection for express and troubleshooting tips of remote connection.
    http://blogs.msdn.com/sql_protocols/archive/2005/11/14/492616.aspx
    http://blogs.msdn.com/sql_protocols/archive/2006/09/30/SQL-Server-2005-Remote-Connectivity-Issue-TroubleShooting.aspx
    IV. Server not started, or point to not a real server in your connection string.
    Check out: Open SQL Server Surface Area Configuration and ensure all the required services are started, Remote Connections are configured.
    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=348662&SiteID=1
    a. use "sc query mssqlserver" for default instance or "sc query mssql$<instancename>" to make sure SQL Server was started. Sometimes, reseason behind the broken of your client application w/ this error:40 might be SQL server restarted and failed, so, it'd better for you to double check.
    b. User specified wrong server in their connection string, as described in the forum discussion, "MSSQLSERVER" is an invalid instance name. Remember, when you connect to default instance, <machinename> could be best representitive for the instance, when you connect to a named instance such as sqlexpress, you should specify <machinename>\<instancename> as data source in your connection string.
     V. Other reasons such as incorrect security context.
    Check out: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=192622&SiteID=1
    Such error also occured during user operation such as moving database or db mirroring or cluster, any DB OP that might invovle different sql instances, namely, the destination database is located in another sql instance and user is not aware of the state of the destination. I recommend you first isolate whether this fail is during connection stage or data operation stage.
    a. During data operation, you are normally asked to type in the destination server name whether it is default to "(local)" or another server "<remotemachinename>". So, remember the exact string that represent the target instance, then when the error repros, open command line, use "sqlcmd -S<representitive> -E" ,see what happens, if the connection fail, please follow up above I - IV troubleshooting lists. otherwise continue.
    b. If you can make basic conection, but still face the error, then there must be something that server reject the connection or client close the connection for some reason.
    VI. Please try basic connectivity tests between the two mahcines you are working on. One simple way to verifty connectivity is to use command line tools, such as osql.exe. For example, osql -E -Stcpervername\instancename. If it connects cross-machine successfully, please also verify that your connection string in your scenario is correct.
    Here are some blogs which could be helpful: just follow the basic connectivity troubleshooting guidelines on the SQL Protocols blog, see:
    SQL Server 2005 Connectivity Issue Troubleshoot - Part I
    http://blogs.msdn.com/sql_protocols/archive/2005/10/22/483684.aspx
    and
    SQL Server 2005 Connectivity Issue Troubleshoot - Part II
    http://blogs.msdn.com/sql_protocols/archive/2005/10/29/486861.aspx
    Hope this helps.

  • SQL Server Bulk Copy

    The performance optimization guide shows you how to switch between the SQL Server ODBC bulk copy API and SQLBulkOperations API but does not recomend which one works better. Since the default is SQL Server ODBC bulk copy API I assume that is the best option but I wish to test that assumption to see if that is true?
    Edited by: Richard Sherman on Oct 3, 2008 11:53 AM

    Hello,
    we have to use the bulk options with data services and have the same question. Anyone know where a document comparing the two options?
    Thank you very much, Silvia

  • Connection between two SQL Azure Databases

    We have a requirement to move data (partial data in a table based on policy conditions) between two SQL Azure Databases. Want to know the best possible way to do this.
    We are not looking at Data Sync Framework - as this is only a Preview version and we have to use this in an ongoing basis in Production and the volume of data is quite high.
    The option that we have currently is to use an on premise stored procedure - that will have two link servers to the source and target SQL Azure Databases and do the data movement in one transaction.
    Are there any other better options to do this ? Any pointers will be helpful.

    Hi Kothai Ramanathan,
    According to your description, if you just want to moving part of the data from a huge table between two different SQL Server database, you can use
    SQL Server replication to sync the part of data via articles. However, in SQL Azure database, it does not support SQL Server replication, if you want to migrate database, as other post, you
    can use Data-Tier Application Import and Export or other ways.
     In addition, for just moving the part of data,  you can also create two Linked Servers between local SQL Server database and two different SQL azure database. For example, you can get the changed data from the first Linked
    Server and saved the data to Local database, then insert these data to the other azure database via the second Linked Server.
     For more information, see:
    http://azure.microsoft.com/blog/2012/09/19/announcing-updates-to-windows-azure-sql-database/
    http://blogs.msdn.com/b/sqlcat/archive/2011/03/08/linked-servers-to-sql-azure.aspx
    Regards,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

  • Debug in sql server 2012

    Hi,
    I have 3 sql server (2005,2008,2012) In 2005 and 2008 remote debug (from sql management studio installed on the client) works without problems.
    In sql 2012 debugging only works on sql management studio installed locally, why?
    The server 2012 and the client are in the same domain, and both have the firewall disabled
    to connect to all 3 I always use the same sql server management studio 2014
    thanks!

    Hi matti157,
    As your description, you fail to use remote T-SQL Debugger in the instance of SQL Server 2012. Please help to post the error information here for analysis. Based on my research, the issue could be due to the RPC or authentication issue. You could pay attention
    to the points below to troubleshoot your issue.
    1.It is recommended to verify if the configuration of the T-SQL Debugging  was done correctly. To verify that, you can follow the steps from the link:
    http://msdn.microsoft.com/en-us/library/cc646024(v=sql.100).aspx
    2.Verify if the SQL Server Management Studio was started with Administrator permissions (Run as Administrator);
    3.Verify if the account used to connect remote to T-SQL Debugger has the right of ‘sysadmin’ on SQL Server Instance and if it is in the Local Administrators Windows Group
    4.Verify if the following services are started:
    a.TCP/IP NetBIOS Helper;
    b.Remote Registry;
    c.RPC Service;
    5.Verify if DCOM is active on the server and client. To do  that please follow the steps described in the link:
    http://technet.microsoft.com/en-us/library/cc771387.aspx.
    6.If you have intermediary devices between SQL Server and client, it is absolutely necessary to configure on this devices the  necessary rules and ports , so the communication between the SQL Server and the client not to be blocked;
    7.To verify if you have any issues with the permissions at DCOM level, you can activate the DCOM logging using the following link:
    http://support.microsoft.com/kb/892500.  To verify if the DCOM works fine you can do the test from the following article
    http://support.microsoft.com/kb/259011/en-us.
    For more information about the process, please refer to the article:
    http://blogs.technet.com/b/beatrice_popa/archive/2012/11/28/quot-unable-to-start-t-sql-debugging-could-not-attach-to-sql-server-process-on-databasename-the-rpc-server-is-unavailable-quot.aspx
    Regards,
    Michelle Li

  • Data Sharing with SQL Server

    I am working with another consultant that has a customer that is mainly .NET and SQL Server. They are looking at ways to share data between current SQL Server databases (up to 100) and a Oracle database. I figured a SQL Server/ Oracle Gateway may help but I am getting push back from about using either streams or replication. The question is how explain to the customer how to setup one or the other of these

    Can you clarify what "share" is intended to mean here? In particular, which system(s) are the source and which system(s) are the target?
    Streams is used to publish and consume changes in the form of Logical Change Records (LCRs). It would be possible to write code that would publish LCRs from a non-Oracle database, but that would require a potentially hefty amount of code. Consuming LCRs in a non-Oracle system tends to be the easier option.
    You can use Heterogeneous Services to create a database link from an Oracle database to a non-Oracle database (much like creating a linked server in SQL Server to a non-SQL Server database). With those database links in place, you can use materialized views to pull the data from the SQL Server systems into Oracle.
    http://tahiti.oracle.com has all the Oracle documentation online. There are multiple manuals that describe how to implement these various options.
    Justin

  • Why I've choosed Oracle Certifications over SQL Server's : Highly Specified

    Since doing my Internship on SQL Analysis/Optimization on both Oracle and SQL Server as we support both for our Products, I wanted to target a relevant certification to enforce my experience and as a consequence my CV.
    I was in hesitation on choosing between an SQL Server certification or an Oracle Database Certification.
    Instinctly I would have gone for SQL server for the following reasons
    1. As I'm new and totally unexperienced it feels much easier and appealling to me
    2. It is more simple and thus easier than Oracle
    3. I've Experienced it more - since the first weeks as introductive, while Oracle was and is a more misty field
    But the basic reason I decided to head towards Oracle was Simple : Highly Specified Certification.
    In my placemnt, I primarly analyse and optimize preset API SQL Statements. So what I learn and do, is SQL and SQL optimization techniques.
    And on Oracle I can be provided certifications specifically for this. SQL Expert, PL/SQL, SQL Tuning.
    On the other side, Microsoft hasn't such a thing at all, with the only Certification available being MCSA.
    To get the MCSA certification I need 3 different Exams 1 Querying 2 Administering 3 Implementing a Data Warehouse with Microsoft SQL Server 2012
    Sector on which I dont have a clue. So a logic +"Either Everything or Nothing"+ No thank you sir I wont take.
    At the best I can take just the 1.Querying BUT
    1. It combines SQL, T-SQL, Optimization in one Exam. But I dont work much with T-SQL, I would prefer an exam just on SQL or Optimization. AND
    2. Its not even considered a full Certification
    While in Oracle I can (if I'll make it and find time for their bigger extend) take a Certification on SQL, and a Certification on Tunning which are the exact fields of my Placement.
    And if i suceed I can extend to PL/SQL, but until then I dont have to bother for PL/SQL which I dont use much.
    I dont care if I need separate payments and procedures, since I can organise Studies & Exercise one field at a time, than having to care for both PLUS a field I dont actually use much.
    And then there is also the positive that you will gain certification for the Top and mos advanced DBMS. And that its not only about that Oracle Devs are less and thus maybe more easy to get hired but also that "if you learn the Difficult(Oracle), then if you have to learn the Easy (SQL Server) it would be easier possible, than the opposite"
    So Oracle Certs have in my case that positive Frame
    1. Specified Certifications Mirroring Exactly your Sectors
    2. Helps self-organisation your Study-Learning Distincting each sector
    3. No1 DBMS, more promitment,
    4. As more difficult, it will be surely easier to transfer to SQL Server if there will be need afterwards , than the opposite
    While SQL Server Certifications on the opposite have a negative Frame
    1. Only Full Certification is MCSA for the Entire SQL Serve Set, things I dont know
    2. Only an Exam 1.Querying is possible, which is Not A full Certification
    3. Mischiefs 3 fields to 1 SQL, Optimizing, T-SQL in one for which I dont operate all on the same level and will fragment the study organisation (no educative logic at all)
    4. SQL Server is Easier than Oracle. Being 22 yet, if need comes up it will be harder to transfer to Oracle. The opposite will be easier i think.
    Well under these circumstances for my situation, to set on Oracle Path I think it was more than clearly better.
    It outpasses even the needing of X4 funds for the same knowledge (SQL+Tuning+PL/SQL)

    Goodfire George wrote:
    1. As I'm new and totally unexperienced it feels much easier and appealling to me
    2. It is more simple and thus easier than OracleWhy do you say that?
    It might seem easier on the surface, a point and click interface might be easier acessible for some, but both are complex product suits and neither database engine/platform has a small or "easy" feature set.
    My view is sort of the opposite of yours (of course, it might be a natural view from a long experience with databases and data systems); Oracle DBAs have to be good at what they do, when on the other hand almost anyone can fool themselves thinking they are MSSS DBAs (clicking around in a "explorer" like interface, how hard can it be?). But in reality, it will takes ten's of years of learning and doing on each platform and their applications to be really great at it.
    3. I've Experienced it more - since the first weeks as introductive, while Oracle was and is a more misty fieldSeems like this is the key - you'll only really learn when you dive in and try, fail and try again... (different thresholds on learning curve/steps may vary).
    On the other side, Microsoft hasn't such a thing at all, with the only Certification available being MCSA.You seem to have completely missed the Pro, Master and even Architect levels. Also, for the more "specified", there's implementor, db developer, BI developer tracks with TS and ITP exams/certifications.
    For your case you may want to compare with MCITP Developer track, which has a certificate after each exam (TS, then ITP).
    Remember that MS has a different certification layout. There may be 3 or even 5 steps (exams) before you'll get certified on some level, where as you might need 1 or 2 exams completed to get a Oracle Database cert.
    To get the MCSA certification I need 3 different Exams 1 Querying 2 Administering 3 Implementing a Data Warehouse with Microsoft SQL Server 2012See previous points :)
    At the best I can take just the 1.Querying BUT
    1. It combines SQL, T-SQL, Optimization in one Exam. But I dont work much with T-SQL, I would prefer an exam just on SQL or Optimization. AND
    2. Its not even considered a full Certification Again, look at and compare with Querying/Development and Designing Database Solutions.
    Depending on your outset and "point of view" on things, on the road ahead you could choose to not be blind to "the other side" (whichever one) but learn to discern and apply, reinforcing knowledge from whatever aspect you'll learn and see and know. Be open and open to re-learning stuff. If you don't take things too literally, sql and performance and scalability matters exists on both platforms. You might be able to learn e.g troubleshooting and optimization, not O* troubleshooting and optimization. Also this is a wast area, about performance, becuase you'll need to know systems, how systems fit toghether and maybe more importantly how the users use the system, how they think they use the system, getting to know them and how to hear and control their expectations (yes, you'll be amazed in ten or twenty yers from now how much "psychology" this really is about).
    The (hopefully long) road towards/before exams and certification is what you should put your mind and effort to. As with most other aspects of life; there are no quick fixes - that is just how we "ignore" things we not really want to invest in.
    >
    While in Oracle I can (if I'll make it and find time for their bigger extend) take a Certification on SQL, and a Certification on Tunning which are the exact fields of my Placement.Yes, and for you and your outset that might be a good place to start. But consider actually learning SQL and learning tuning (which will take years) not just "take a certification".
    And if i suceed I can extend to PL/SQL, but until then I dont have to bother for PL/SQL which I dont use much.This might be a sign of "narrow tracking" too early. Learning a little PL/SQL or whatever skills will help in ways you do not yet know. Read what EdStevens has written on the forums on the topic of studying (learning systems from having a major within music).
    It outpasses even the needing of X4 funds for the same knowledge (SQL+Tuning+PL/SQL)Knowledge does not come from taking exams (if you don't mean the "I know how to do multiple choice tests"-kind of knowledge).
    Perhaps it is better in the long run if you study and experience and do the things you like to do, and let the certificates come later on when the time is right.
    Edited by: orafad on May 26, 2013 12:00 PM
    Edited by: orafad on May 26, 2013 12:01 PM

  • What is difference between 32 bit and 64 bit sql server memory management

    What is difference between 32 bit and 64 bit sql server memory management
    Thanks
    Shashikala

    This is the basic difference...check if helps:
    A 32-bit CPU running 32-bit software (also known as the x86 platform) is so named because it is based on an architecture that can manipulate values that are up to 32 bits in length. This means that a 32-bit memory pointer can store a value between 0 and
    4,294,967,295 to reference a memory address. This equates to a maximum addressable space of 4GB on 32-bit platforms
    On the other hand 64-bit limit of 18,446,744,073,709,551,616, this number is so large that in memory/storage terminology it equates to 16 exabytes. You don’t come across that term very often, so to help understand the scale, here is the value converted to
    more commonly used measurements: 16 exabytes = 16,777,216 petabytes (16 million PB)➤ 17,179,869,184 terabytes (17 billion TB)➤ 17,592,186,044,416 gigabytes (17 trillion GB)➤
    As you can see, it is significantly larger than the 4GB virtual address space usable in 32-bit systems; it’s so large in fact that any hardware capable of using it all is sadly restricted to the realm of science fiction. Because of this, processor manufacturers
    decided to only implement a 44-bit address bus, which provides a virtual address space on 64-bit systems of 16TB. This was regarded as being more than enough address space for the foreseeable future and logically it’s split into an 8TB range for user mode
    and 8TB for kernel mode. Each 64-bit process running on an x64 platform will be able to address up to 8TB of VAS.
    Please click the Mark as answer button and vote as helpful if this reply solves your problem

  • There is a compatibility range mismatch between the Web server and database

    HI,
    Taken backup form production environment through TSM backup utility and restore same db on UAT environment by TSM Utility, after restore got below issue, past i had done many time but working fine this time
    it’s not working. Production environment have SP2010 and sql server 2008 ,UAT have same thing also.
    Server Error in '/' Application.
    There is a
    compatibility range mismatch between the Web server and database "Portal_Contain", and connections to the data have been blocked to due to this incompatibility. This can
    happen when a content database has not been upgraded to be within the compatibility range of the Web server, or if the database has been upgraded to a higher level than the web server. The Web server and the database must be upgraded to the same version and
    build level to return to compatibility range.
    Description: An unhandled exception occurred during the execution of the current
    web request. Please review the stack trace for more information about the error and where it originated in the code. 
    Exception Details: Microsoft.SharePoint.Upgrade.SPUpgradeCompatibilityException:
    There is a compatibility range mismatch between the Web server and database "Portal_Contain", and connections to the data have been blocked to due to this incompatibility. This can happen when a content database has not been upgraded to be within
    the compatibility range of the Web server, or if the database has been upgraded to a higher level than the web server. The Web server and the database must be upgraded to the same version and build level to return to compatibility range.
    Source Error:
    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack
    trace below.
    Stack Trace:
    [SPUpgradeCompatibilityException: There is a compatibility range mismatch between the Web server and database "Portal_Contain", and connections to the data have been
    blocked to due to this incompatibility. This can happen when a content database has not been upgraded to be within the compatibility range of the Web server, or if the database has been upgraded to a higher level than the web server. The Web server and the
    database must be upgraded to the same version and build level to return to compatibility range.]
       Microsoft.SharePoint.Administration.SPPersistedUpgradableObject.ValidateBackwardsCompatibility() +542
       Microsoft.SharePoint.SPSite.PreinitializeServer(SPRequest request) +63
       Microsoft.SharePoint.SPWeb.InitializeSPRequest() +258
       Microsoft.SharePoint.WebControls.SPControl.EnsureSPWebRequest(SPWeb web) +365
       Microsoft.SharePoint.WebControls.SPControl.SPWebEnsureSPControl(HttpContext context) +520
       Microsoft.SharePoint.ApplicationRuntime.SPRequestModule.GetContextWeb(HttpContext context) +27
       Microsoft.SharePoint.ApplicationRuntime.SPRequestModule.PostResolveRequestCacheHandler(Object oSender, EventArgs ea) +918
       System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +80
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +171
    Hasan Jamal Siddiqui(MCTS,MCPD,ITIL@V3),Sharepoint and EPM Consultant,TCS
    |
    | Twitter

    Hi Bhavik,
    UAT Portal_Contain DB version given below:
    Version ID
    Version
    id
    00000000-0000-0000-0000-000000000000
    12.0.0.4518
    1
    00000000-0000-0000-0000-000000000000
    12.0.0.6219
    3
    00000000-0000-0000-0000-000000000000
    12.0.0.6327
    4
    00000000-0000-0000-0000-000000000000
    12.0.0.6421
    5
    00000000-0000-0000-0000-000000000000
    12.0.0.6510
    6
    00000000-0000-0000-0000-000000000000
    12.0.0.6514
    7
    00000000-0000-0000-0000-000000000000
    14.0.6123.5006
    9
    1A707EF5-45B2-4235-9327-021E5F9B8BB0
    4.1.6.0
    8
    6333368D-85F0-4EF5-8241-5252B12B2E50
    4.1.18.0
    2
    Production Version given below:
    00000000-0000-0000-0000-000000000000
    12.0.0.4518
    00000000-0000-0000-0000-000000000000
    12.0.0.6219
    00000000-0000-0000-0000-000000000000
    12.0.0.6327
    00000000-0000-0000-0000-000000000000
    12.0.0.6421
    00000000-0000-0000-0000-000000000000
    12.0.0.6510
    00000000-0000-0000-0000-000000000000
    12.0.0.6514
    00000000-0000-0000-0000-000000000000
    14.0.6123.5006
    1A707EF5-45B2-4235-9327-021E5F9B8BB0
    4.1.6.0
    6333368D-85F0-4EF5-8241-5252B12B2E50
    4.1.18.0
    I have matched both are the exact same.
    Run the below command on App server:
    Upgrade-SPContentDatabase
    cmdlet Upgrade-SPContentDatabase at command pipeline position 1
    Supply values for the following parameters:
    Identity: Portal_Contain
    Confirm
    Are you sure you want to perform this action?
    Performing operation "Upgrade-SPContentDatabase" on Target "Portal_Contain".
    [Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help
    (default is "Y"):y
    WARNING: Database [SPContentDatabase Name=Portal_Contain] cannot be upgraded.
    Kindly suggest 
    Hasan Jamal Siddiqui(MCTS,MCPD,ITIL@V3),Sharepoint and EPM Consultant,TCS
    |
    | Twitter

  • What is the different between Sharepoint fast search service and Sql server fulltext search?

    HI ,
    I want to kow what is the different between Sharepoint fast search service and Sql server fulltext search?
    Or Can I abstract the Sharepoint fast search from the Sharepoint platform as a isolate component?
    Thank you.
    James

    They are very, very different beasts.
    Firstly FAST Search for SharePoint is the old name for the product and is only relevant for SharePoint 2010 not 2013. It got merged into the standard SharePoint search for the 2013 release.
    SharePoint search is aimed at providing a Bing or Google like experience for your intranet content, as well as providing some nifty features that are purely SharePoint releated along the way. That means it can crawl SharePoint content, file shares,
    outlook mailboxes, internal and external websites and probably fifty other different things if you really tried. Whilst i'm not an expert on SQL full text search I believe it's intended to provide a search feature for content held within SQL databases
    and tables.
    Can you run SharePoint purely for Search? Yes, definitely.

Maybe you are looking for

  • How can I prevent children from shrinking to infinitesimal values on MouseEvents?

    Hi. I have the following code: //http://forums.adobe.com/message/3450898#3450898 //square_mc.y property edited by kglad AND NedMurphy both // but kglad introduced the yGap variable, allowing for // user defined space between movie clips.  This solved

  • New to OS X - questions

    I got myself a MacBook Air yesterday after long time of wondering if I should. First impression - I'm quite happy for this sturdy little machine with great battery life. I have OS X 10.9.2 with the latest updates. It will take me a while to get used

  • 'Query not returning string values as expected

    Hi Why would this be happening? I have an insert statement that looks like this; UNION ALL SELECT '59','','last','first','','','','WILLIAMTA','BEB92C5B52566E6594707C69729624BE','','','Senior Officer','Town Name','2','','SUSTAINABLE FOREST MANAGEMENT

  • Tools for UCCE/CVP Project phase?

    Hi, there are plenty of customer phasing/ post project wallboards, reporting tools, admin tools out there. My compnay is looking into some UCCE/CVP Project phase tools which can help the engineers in deisgn, deploy, call flow dev, testing etc phase o

  • Operation modes in oracle form

    please share difference between enter query mode and normal mode in oracle form precticaly. and how can change mode Edited by: 964427 on Mar 12, 2013 3:21 AM