Sql Server 2005

Wednesday, June 30, 2004

Service Pack 1 for Microsoft SQL Server 2000 Reporting Services was Released :)






Hi All,


An important and much need information for Sql Server Reporting Services Developers and Others:


Service Pack 1 for Microsoft SQL Server 2000 Reporting Services was Released :)


Key functional enhancements

SQL Server 2000 Reporting Services SP1 provides the following functional enhancements:


<DIR>
<DIR>

An improved Excel rendering extension

By using the new Excel
rendering extension, you can render reports that can be viewed and
modified in the earlier versions of Microsoft Excel (For example, you
can render a report that can be viewed and modified in the Microsoft
Excel 2000 format).


A robust PDF rendering extension

The performance of the PDF rendering extension is improved with SQL Server 2000 Reporting Services SP1.


More control to users to change the display styles of the Chart control in Report Designer


Support for references to external URLs for images and resources in a report


The data caching behavior for previewing the report is now supported


Support for the new line character in expressions


A facility to modify the style of the HTML Viewer toolbar by using a style sheet


New parameters for URL access that offer more options to customize the report presentation at run time


Report Manager proxy persists authentication cookies so that the
authentication cookies can be used by the custom security extensions.


Support for hidden report parameters


Support for compressing the temporary snapshots and storing the snapshots on the file system


Support for disabling the integrated security support for accessing report data sources

</DIR></DIR>

Problems that have been fixed in SQL Server 2000 Reporting Services SP1


For additional information about the problems that have been fixed
in SQL Server 2000 Reporting Services Service Pack 1, click the
following article number to view the article in the Microsoft Knowledge
Base:


842514 <http://support.microsoft.com/default.aspx?kbid=842514> FIX: The report parameters may not appear correctly when you preview a report in a non-English version of Report Designer


842517 <http://support.microsoft.com/default.aspx?kbid=842517>
FIX: The Reporting Services Login dialog box appears repeatedly when
you deploy a report on a remote computer by using Report Designer


842518 <http://support.microsoft.com/default.aspx?kbid=842518> FIX: An XML version tag is included at the beginning of non-XML files


842534 <http://support.microsoft.com/default.aspx?kbid=842534> FIX: Bookmark links in a report that is rendered to the Web archive file format (.mhtml) may not work correctly


842536 <http://support.microsoft.com/default.aspx?kbid=842536>
FIX: Hebrew characters in a report appear in reverse order when you
export the report to the "Acrobat (PDF) file" format in SQL Server 2000
Reporting Services


842537 <http://support.microsoft.com/default.aspx?kbid=842537> FIX: An image in a report does not appear in the preview of the report if the value property of the image is set to a URL path


842538 <http://support.microsoft.com/default.aspx?kbid=842538>
FIX: Subscriptions that use the e-mail delivery method for distribution
may not deliver the report successfully in SQL Server 2000 Reporting
Services



Regards


Mitesh




Wednesday, June 23, 2004

Rendering Extensions in SQL Server Reporting Services:








Rendering Extensions in SQL Server Reporting Services:


SQL Report Services - report
server uses rendering extensions to transform data and layout
information from Report Processor into a device-specific format.
Reporting Services includes six rendering extensions: HTML, Excel,
Text, XML, Image, and PDF. Developers can create additional rendering
extensions to generate reports in other formats. The following sections
describe the rendering extensions provided with Reporting Services..


HTML Rendering Extension:


When you request a report from
the report server, either through a URL or Report Manager, the report
server uses the HTML rendering extension to render the report.


Depending on the browser you
use, the HTML rendering extension renders reports in either HTML 4.0 or
HTML 3.2. Supported HTML 4.0 browsers include:


· Microsoft® Internet Explorer for Windows versions


· Netscape Navigator for Windows version 7.1


HTML 3.2 is used for all other
browsers that support HTML, such as earlier versions of the browsers
mentioned previously and Internet Explorer for Pocket PC. The HTML
rendering extension generates all HTML using UTF-8 encoding.


The HTML rendering extension
supports the MIME Encapsulation of Aggregate HTML Documents (MHTML)
standard. The rendering extension embeds resources such as images,
documents, or other binary files as MIME structures within the report
HTML, in a single file. The encoded resources within the report
increase the size of the report, but embedding the resources is useful
for clients that do not have access to resources stored on the report
server or in another location. MHTML reports are also useful for
embedding within e-mail messages, because all resources are included
with the report.


Excel Rendering Extension:


The Excel rendering extension
renders reports that can be viewed and modified in Microsoft Excel 2002
or later. This rendering extension creates files in MHTML, which carry
a MIME type of ms-excel and contain HTML meta tags and XML data islands
that are specific to Excel. While the Excel rendering extension renders
HTML, the rendered report is intended to be viewed in Microsoft Excel,
not in a browser.


Resources, such as images, are
embedded within the report. For more information about designing
reports for the Excel rendering extension, see Designing for Excel
Output.


CSV Rendering Extension:


The Comma-Separated Value
(CSV) rendering extension renders reports in comma-delimited plain text
files, without any formatting. Users can then open these files with a
spreadsheet application, such as Microsoft Excel, or any other program
that reads text files.


For more information about designing reports for the CSV rendering extension, see Designing for CSV Output.


XML Rendering Extension:


The XML rendering extension renders reports in XML files. These XML files can then be stored or read by other programs.


The XML generated by the XML rendering extension is UTF-8 encoded.


Image Rendering Extension:


The Image rendering extension
renders reports to bitmaps or metafiles. The extension can render
reports in the following formats: BMP, EMF, GIF, JPEG, PNG, TIFF, and
WMF. By default, the image is rendered in TIFF format, which can be
displayed with the default image viewer of your operating system (for
example, Windows Picture and Fax Viewer). You can send the image to a
printer from the viewer.


Using the Image rendering
extension to render reports ensures that the report looks the same on
every client. (When a user views a report in HTML, the appearance of
that report can vary depending on the version of the user's browser,
the user's browser settings, and the fonts that are available.) The
Image rendering extension renders the report on the server, so all
users see the same image. Because the report is rendered on the server,
all fonts that are used in the report must be installed on the server.


PDF Rendering Extension:


The PDF rendering extension renders reports in PDF files that can be opened and viewed with Adobe Acrobat 4.0 or later.


Other than these types, you can develop your own format by extending reporting services rendering extension.




Regards


Mitesh Mehta



SQL Server and Access Query Syntax


SQL Server and Access Query Syntax









SQL Server and Access Query Syntax



The following table shows the corresponding differences between SQL Server and Access query syntax.































Access query syntax


SQL Server query syntax


ORDER BY in queries


ORDER BY in views not supported


DISTINCTROW


DISTINCT


String concatenation with “&”


String concatenation with “+”


Supported clauses/operators:


SELECT
SELECT TOP N
INTO
FROM
WHERE
GROUP BY
HAVING
UNION (ALL)
ORDER BY
WITH OWNERACCESS


Supported clauses/operators:


SELECT
SELECT TOP N
INTO
FROM
WHERE
GROUP BY
HAVING
UNION (ALL)
ORDER BY
COMPUTE
FOR BROWSE
OPTION


Not Supported: COMPUTE, FOR BROWSE, OPTION


Not Supported: WITH OWNERACCESS


Aggregate functions:


AVG


COUNT(column)


COUNT(*)


MIN


MAX


FIRST


LAST


STDEV, STDEVP


SUM


VAR, VARP


Aggregate functions:


AVG([ALL | DISTINCT] expression)


COUNT([ALL | DISTINCT] expression)


COUNT(*)


GROUPING (column_name)


MAX(expression)


MIN(expression)


STDEV, STDEVP


SUM([ALL | DISTINCT] expression)


VAR, VARP


Not supported: FIRST, LAST


TRANSFORM


(SELECT statement)


PIVOT


WITH ROLLUP, WITH CUBE on SELECT statements


MAKE TABLE, ALTER TABLE


Supported clauses:


CONSTRAINT


ADD COLUMN


DROP COLUMN


DROP INDEX


Also, stand-alone statement: DROP INDEX


CREATE TABLE, ALTER TABLE


Supported clauses:


CONSTRAINT


ADD COLUMN


DROP COLUMN


Stand-alone statement: DROP INDEX


Regards


Mitesh








Tuesday, June 22, 2004

Introducing Replication in Sql server 2000





Introducing Replication


Microsoft SQL Server 2000 replication is a set of technologies
for copying and distributing data and database objects from one database
to another and then synchronizing between databases for consistency.


Using definition">replication, you can distribute data to
different locations, to remote or mobile users over a local area
network, using a dial-up connection, and over the Internet. Replication
also allows you to enhance application performance, physically separate
data based on how it is used (for example, to separate online
transaction processing (OLTP) and decision support systems), or
distribute database processing across multiple servers.


Benefits of Replication

Replication offers various benefits depending on the type of
replication and the options you choose, but the common benefit of SQL
Server 2000 replication is the availability of data when and where it is
needed.


Other benefits include:20


  • Allowing multiple sites to keep copies of the same data. This is
    useful when multiple sites need to read the same data or need separate
    servers for reporting applications.


  • Separating OLTP applications from read-intensive applications such
    as online analytical processing (OLAP) databases, data marts, or data
    warehouses.


  • Allowing greater autonomy. Users can work with copies of data while
    disconnected and then propagate changes they make to other databases
    when they are connected.


  • Scale out of data to be browsed, such as browsing data using
    Web-based applications.


  • Increasing aggregate read performance.


  • Bringing data closer to individuals or groups. This helps to reduce
    conflicts based on multiple user data modifications and queries because
    data can be distributed throughout the network, and you can partition
    data based on the needs of different business units or users.


  • Using replication as part of a customized standby server strategy.
    Replication is one choice for standby server strategy. Other choices in
    SQL Server 2000 include log shipping and failover clustering, which
    provide copies of data in case of server failure.

When to Use Replication

With organizations supporting diverse hardware and software
applications in distributed environments, it becomes necessary to store
data redundantly. Moreover, different applications have different needs
for autonomy and data consistency.


Replication is a solution for a distributed data environment when you
need to:20


  • Copy and distribute data to one or more sites.


  • Distribute copies of data on a scheduled basis.


  • Distribute data changes to other servers.


  • Allow multiple users and sites to make changes then merge the data
    modifications together, potentially identifying and resolving
    conflicts.


  • Build data applications that need to be used in online and offline
    environments.


  • Build Web applications where users can browse large volumes of
    data.


  • Optionally make changes at subscribing sites that are transparently
    under transactional control of the title3D"View definition">Publisher.

Collected By


Mitesh



Thursday, June 17, 2004

Overview of Native XML Web Services for Microsoft SQL Server 2005








Overview of Native XML Web Services for Microsoft SQL Server 2005








Introduction


Microsoft® SQL Server™ 2005 provides a standard mechanism for accessing the database engine using SOAP via HTTP. Using this mechanism, you can send SOAP/HTTP requests to SQL Server to execute:



  • Transact-SQL batch statements, with or without parameters.
  • Stored procedures, extended stored procedures, and scalar-valued user-defined functions.

Prior to SQL Server 2005, the only mechanism available to connect to SQL Server was through a custom binary protocol named Tabular Data Stream (TDS). With SOAP/HTTP access, we have provided an open and documented protocol that may be used as an alternative to connect to SQL Server. Providing SOAP/HTTP access enables a broader range of clients to access SQL Server, including "zero foot print" clients, because there is no longer a need to have a Microsoft Data Access Components (MDAC) stack installed on the client device trying to connect to SQL Server. It facilitates interoperability with .NET, SOAP Toolkit, Perl, and more on a variety of platforms. Since the SOAP/HTTP access mechanism is based on well-known technologies such as XML and HTTP, it inherently promotes interoperability and access to SQL Server in a heterogeneous environment. Any device that can parse XML and submit HTTP requests can now access SQL Server.


Many enterprises have heterogeneous environments in which applications that run on UNIX and Linux platforms might require connectivity to SQL Server. Traditionally, the only solution available to such users was to use either JDBC or ODBC drivers. The SOAP/HTTP access now provides another, low-cost alternative. It is extremely useful for scenarios where DBA's have scripts written in Perl that run on UNIX and manage a SQL Server resource. It is also useful in developing client applications that connect to SQL Server using smart integrated development environments (IDEs) that have built-in SOAP/HTTP support, such as Microsoft Visual Studio® .NET or Jbuilder. These IDEs generate proxy code that abstracts the communication with SQL Server and provides objects that the client applications can use. Using SOAP/HTTP also enables anytime, anywhere access to SQL Server, which makes it easier to develop applications for mobile or sporadically connected devices. Once a connection has been
established and the server has started processing requests, it can be monitored using existing mechanisms that TDS-based clients such as sqlclient, ODBC, and OLEDB use.




Requirements


SQL Server 2005–native Web services require Microsoft Windows Server™ 2003 as the operating system, because they rely on the kernel mode http driver http.sys that this version provides. Since SQL Server leverages the kernel mode http.sys driver, you do not necessarily need to have IIS installed to expose Web services out of SQL Server; this simplifies administration. Instead, you should base your decision to install IIS on application requirements. For example, certain applications benefit from having an explicit middle tier. In such cases, IIS would be useful.


HTTP Endpoints


Setting up SQL Server as a Web Service that can listen natively for HTTP SOAP requests requires creating an HTTP endpoint and defining the methods that the endpoint exposes. When an HTTP endpoint is created, it must be created with a unique URL that it uses to listen for incoming HTTP requests. For example, if you create an endpoint with the URL "http://servername/sql," SOAP requests that are sent to http://servername/sql will be picked up by http.sys. Http.sys will then route the SOAP requests to the SQL Server instance that hosts the endpoint associated with the URL. From there, the requests will be handed off to the SOAP processing layer within SQL Server.


A SQL Server instance can have multiple endpoints, each of which can expose any number of stored procedures (implemented using either Transact-SQL or CLR) as WebMethods on the endpoint and can be invoked via SOAP remote procedure calls (RPCs). A WebMethod can have a different name than the actual stored procedure that is being exposed. The WebMethod name is what is shown to the user in WSDL as the operation name.


Note   It is important to call out that the WebMethod clause in the endpoint is specific to SQL Server 2005 and is unrelated to the ASMX WebMethod attribute.

Users have the ability to execute ad-hoc Transact-SQL statements against the endpoints. This is done by enabling batches on the endpoint using an optional clause in the data definition language (DDL). Enabling batches implicitly results in a WebMethod named "sqlbatch" being exposed to the user. These concepts are illustrated further in the next few sections.




CREATE HTTP ENDPOINT


HTTP Endpoints are created and administered using Transact-SQL DDL. Creating an HTTP Endpoint is the first step in enabling HTTP/SOAP access to SQL Server 2005. Each endpoint has a name and a collection of options that when combined define the behavior of the endpoint.


To illustrate how the CREATE HTTP ENDPOINT is used, let's take a look at a Hello World example for invoking a stored procedure via SQL Server Web Services.


First, create a stored procedure called hello world in the master database, using the following T-SQL. This stored procedure simply displays the string provided in the input parameter.

CREATE PROCEDURE hello_world

(@msg nvarchar(256))
AS BEGIN
select @msg as 'message'
END

Next, use the following T-SQL to create the HTTP endpoint which will allow access to this stored procedure as a WebMethod:

CREATE HTTP ENDPOINT hello_world_endpoint

AS
AUTHENTICATON = ( INTEGRATED ),
PATH = '/sql/demo',
PORTS = ( CLEAR ),
STATE = STARTED
FOR SOAP (
METHOD
'http://tempuri.org/'.'hello_world'
(NAME = master.dbo.hello_world)
WITH
BATCHES = ENABLED,
WSDL = DEFAULT
)

All endpoints are stored in master, in the metadata view master.sys.http_endpoints. An endpoint doesn't have any SOAP Methods unless you define them. In the above example, we exposed the stored procedure master.dbo.hello_world as WebMethod 'hello_world'; the WebMethod can have any name and, for example, could have been called as 'testproc1' under the 'http://tempuri.org' namespace. Specifying DEFAULT as the value for WSDL clause enables the endpoint to respond to requests for WSDL generating WSDL using the default format. You can suppress WSDL generation by setting WSDL=NONE in the above statement. We discuss the details of WSDL generation in a subsequent section.




Authentication and Security


HTTP Endpoints support the following standard authentication mechanisms: Basic, Digest, Integrated (NTLM, Kerberos), Anonymous - SQL Auth. You first authenticate at the HTTP transport level. Once that is successful, the users SID is used to authenticate with SQL. This is true for all options except ANONYMOUS. Specifying ANONYMOUS at the endpoint only implies that it is anonymous at the HTTP transport level, the client will still need to provide SQL Auth credentials in order to be able to authenticate with the database. When ANONYMOUS is specified an additional HTTP header is required that encodes user name and password. The header must be called "MS-SQLAuth" and the value must be the base64 encoding of a valid username:password. Administrators can also set IP based Restrictions on an endpoint basis, restricting access to endpoints by only allowing specified IP's or ranges of IP's access to HTTP endpoints. Conceptually, an "endpoint" is an "application"—all the methods that
implement a single application are mapped to an endpoint, and so security is applied to the endpoint to control access to the application. Endpoints are secure by design; listed below are a few items that help make endpoints secure.



  • Off by default. No default endpoints or Web methods mapped; must be explicitly created and specified.
  • Security checks also apply to objects, so a mapped stored procedure is only executable if the user has connect permissions on the endpoint, plus execute permissions on the stored procedure.
  • No anonymous support for connecting to endpoints. All requests, including requests for WSDL are authenticated. Clients must authenticate, against SQL Server principles, in order to submit any request.

When an endpoint is created, only members of the sysadmin role and the owner of the endpoint can connect to the endpoint. You must grant connect permission for users to access your endpoint; this is accomplished by executing the following statement:

GRANT CONNECT ON HTTP ENDPOINT::hello_world_endpoint TO [DOMAIN\USER] 


Clients on non-Microsoft platforms can connect to SQL Server by using either BASIC or SQL Auth. However, using BASIC or SQL Auth requires the channel to be secure, so users can connect only on ports that also have SSL enabled.


WSDL


WSDL is a document written in XML that describes a Web service. It specifies the location of the service and the operations (or methods) the service exposes. WSDL provides the information necessary for a client to interact with a Web service. Tools such as Visual Studio .NET and Jbuilder use the WSDL to generate proxy code that client applications can use to communicate with a Web service. If the endpoint has WSDL enabled, that endpoint will produce WSDL when it receives a request for it. The endpoint created earlier in this article will produce WSDL when an authenticated request is sent to it. A WSDL request is a simple HTTP get request of the form.

http://servername/sql/demo?wsdl


The server queries the metadata associated with the endpoint and generates the WSDL dynamically. The WSDL generated provides rich type description of the parameters of the stored procedure. The server has the ability to generate different flavors of WSDL—we call it simple and complex WSDL, depending on whether we use primitive xsd types or complex types to describe the parameters in a request/response message. The default is to use complex types.




SOAP RPC: Method Invocation


In the endpoint created above we have exposed this stored procedure master.dbo.hello_world as a Web method that we can execute via SOAP RPC. The following is an example of the soap message that is sent to the server to invoke this SP via SOAP over HTTP.

<SOAP-ENV:Envelope 

xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<hello_world xmlns="http://tempuri.org/">
<msg>Hello World!</msg>
</hello_world>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

The result will be a SOAP envelope containing:

<SqlRowSet1 xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1">

<row>
<message>Hello World!</message>
</row>
</SqlRowSet1>



Batches: AdHoc Queries


When BATCHES are ENABLED on an endpoint by using the T-SQL command, another SOAP method, called "sqlbatch," is implicitly exposed on the endpoint. The sqlbatch method allows you to execute T-SQL statements via SOAP. This method takes two parameters. The first parameter is named "<BatchCommands>" and is the batch of T-SQL statements. The second parameter is named "<Parameters>" and is optional; it contains an array of parameter information if the T-SQL statement used any parameters. For example, here is the body of the SOAP request that calls the sqlbatch method and executes a parameterized query.

<sqlbatch xmlns="http://schemas.microsoft.com/SQLServer/2001/12/SOAP">

<BatchCommands>
SELECT EmployeeID, LoginID, Gender
FROM Employee
WHERE EmployeeID=@x
FOR XML AUTO;
</BatchCommands>
<Parameters>
<SqlParameter name="x" sqlDbType="Int" maxLength="20"
xmlns="http://schemas.microsoft.com/SQLServer/2001/12/SOAP/types/SqlParameter">
<Value xsi:type="xsd:string">1</Value>
</SqlParameter>
</Parameters>
</sqlbatch>

The response from this SOAP request will contain the following:

<sqlresultstream:SqlXml xsi:type="sqlsoaptypes:SqlXml">

<SqlXml>
<employees EmployeeID="1" FirstName="Nancy" LastName="Davolio"/>
</SqlXml>
</sqlresultstream:SqlXml>



Administration and Management


We have seen how simple it is to create an endpoint and submit SOAP requests against the endpoint. Administration is simplified because we now have to administer only one component, namely SQL Server. We don't need to administer an IIS component. The endpoint abstraction provides greater flexibility to administrators, who can enable IP filtering. It also eliminates the need to open up another port because we reuse the port used for http/https Web traffic. You can also provision endpoints for access by only certain individuals by explicitly granting CONNECT privileges only to those users.




Conclusion


With native SOAP access we have provided a protocol based on well-known and documented standards such as SOAP/HTTP to access SQL Server. This promotes interoperability and facilitates outreach by enabling a broader range of clients to connect to SQL Server.


Collected By

Rajjan