IMDTouchKnowledge BaseShop main store

Explainer

Why WinCC SQL instructions depend on the installed version

HMI and touchscreens Published 6 min read By IMDTouch engineering team

Short answer

WinCC V6.0 is the release that moved archiving onto Microsoft SQL Server 2000; anything older ran a proprietary database, so SQL Server instructions have no target there. From V6.0 on, archived values are queried through the WinCC OLE DB provider, User Archives are written through connected and control tags, and external client access at V6.0 required the Connectivity Pack option. Identify the installed release first, then follow the access route that release documents.

On this page
  1. Which WinCC release first used Microsoft SQL Server?
  2. Why can't SQL instructions be reused between WinCC versions?
  3. How do I confirm which WinCC version and database I have?
  4. How do I query WinCC archive values with SQL?
  5. What is the CC_ExternalBrowsing database for?
  6. How do I write external SQL data into a User Archive?
  7. Which SQL access path fits each WinCC generation?
  8. Questions asked

SQL instructions for WinCC are valid only for the release they were written against, because the database behind the product changed once and the access routes around it changed again afterwards. WinCC V6.0 is the release whose delivery documentation first describes an archiving system based on Microsoft SQL Server; releases before it ran a proprietary database. The routes then split by task: archives are read through the WinCC OLE DB provider, current values sit in a runtime database with its own access path, and User Archives are written through tags. This article maps each generation to its documented route, so you can tell at once which instructions fit the machine in front of you. If the package itself is new to you, what WinCC does in an HMI and SCADA system covers its role first.

Which WinCC release first used Microsoft SQL Server? #

WinCC V6.0 is that release: its delivery documentation describes a powerful archiving system based on Microsoft SQL Server 2000 with integrated Historian functionality, and the generations that followed kept a SQL Server based archive. Anything older sits on a proprietary database that never heard of SQL Server, so a query, a connection string or a driver aimed at SQL Server finds no target there. The gap is wider than syntax: storage layout, the client tools that work and the way reports get built all follow from the engine underneath, which is the ground covered by a comparison of SQL Server and proprietary HMI database historians. For comparison work this means one rule: sort every SQL instruction you collect by the release it names before it goes near a project.

Why can't SQL instructions be reused between WinCC versions? #

Because the database product, the access interface and the object names change together, an instruction set only holds for the generation whose documentation ships it. SQL scripting that another HMI builds in belongs to that product's interface, and its functions do not exist in WinCC under the same names, if at all. The same trap exists inside the WinCC family across time: a Visual Basic recipe from the V6.0 era leans on the Connectivity Pack option, while a V8.0 query leans on the OLE DB provider, and neither document describes the other's route. Three items must therefore match before any instruction is reusable: the database product, the interface that reaches it, and the names of the archives, tags and tables the instruction touches.

How do I confirm which WinCC version and database I have? #

Take the version from the About dialog of the installed WinCC engineering software and write the service pack beside it, because manuals, delivery notes and the access routes they describe are published per release and service pack. The About dialog is where that kind of information lives in any Windows engineering tool, and the installed-programs list of the operating system confirms it independently. The 6.0 line ran through service packs up to 6.0 SP4, and the service pack level changes which notes apply, so a bare version 6 label is not a complete identification. With version and service pack recorded, the backend follows from the table at the end of this article, and the only open question is which interface your release documents.

How do I query WinCC archive values with SQL? #

Query through the WinCC OLE DB provider: the V8.0 information system documents that OLE DB provides access to all WinCC archive data, and it names the SQL Server Import / Export Wizard as the tool that runs standard SQL queries against it. For WinCC RT Professional the TIA Portal documentation gives the process value archive query section, with filter criteria selecting the data; write the query exactly as your release's documentation gives it instead of carrying syntax over from another generation. A plain SELECT against the archive files from a generic SQL client is not among the documented routes, and the volume explains why the provider filters.

Worked example, calculated rather than measured: take 200 tags archived once per minute. Each tag contributes 60 values per hour, so the archive grows by 200 × 60 = 12,000 values per hour, and 12,000 × 24 = 288,000 values per day. Tighten the cycle to one value every 10 seconds and the rate rises sixfold, to 288,000 × 6 = 1,728,000 values per day. That is why a query goes through the provider with a tag and time-window filter instead of dragging whole archives into a report tool.

When the real goal is long-term reporting rather than an operator screen, keep that load off the HMI and follow the architecture in logging PLC data to SQL with a gateway instead of the HMI. And write nothing into the archive database by hand: those files belong to WinCC, and the provider and the tag routes are the only doors its documentation opens.

What is the CC_ExternalBrowsing database for? #

It merges the two stores for browsing: when a project is activated, runtime and archive data are brought together automatically in an SQL database named CC_ExternalBrowsing, so a browsing client sees current and historical values in one place. Keep the division of labor straight. Current tag values live in the runtime database, reached the way reading the WinCC runtime database through the ODBC DSN describes; time-stamped history comes through the OLE DB provider; and the merged database is the convenience view where a browsing tool finds both. Use it for browsing, not as a substitute for the provider's filtered archive queries, and never as a writing target.

How do I write external SQL data into a User Archive? #

Through tags, not SQL writes: at WinCC V7 the documented procedure is to read the source data, write it into the tags connected to the User Archive's columns and fields, and then drive the transfer with the control tags. The control tags are the command path: they tell the User Archive when to move the tag values into its rows, so an external system never needs table-level write access to the archive database. If a supplier hands you an integration that inserts rows into the archive database directly, treat it as unsupported and ask for the tag-based route instead.

Which SQL access path fits each WinCC generation? #

Match by generation: systems before V6.0 follow only their own release manuals, V6.0 pairs its SQL Server base with the Connectivity Pack option for external clients, and the V7 and V8 generation queries archives through the WinCC OLE DB provider.

Generation Database basis Documented access route
Earlier than V6.0 Proprietary, not SQL Server Its own release manuals only; SQL Server instructions have no target
V6.0, service packs to 6.0 SP4 SQL Server 2000 as the archive basis Connectivity Pack option for external clients such as Visual Basic
V7.x SQL Server based archives OLE DB provider for archive queries; User Archives written through connected and control tags
V8.0 SQL Server based archives OLE DB provider for all archive data; standard queries through the SQL Server Import / Export Wizard

One licensing fact belongs with the V6.0 row: the Connectivity Pack option is purchased separately, so count it on the license list before you promise a Visual Basic or reporting integration on that generation. The decisions, case by case: on anything before V6.0, treat every SQL Server instruction as inapplicable and work from that release's own manuals; on V6.0, expect a SQL Server archive underneath and plan the Connectivity Pack option for any external client; on V7 or later, query archives through the OLE DB provider with your release's own query section, write User Archives through the connected and control tags, and use the merged browsing database when a tool must see current and historical data together.

Questions asked

Where do I get the manual that matches my WinCC version?

The manuals ship with the delivered software media, so check that media first. When they are missing, request version-matched documentation from Siemens or one of its distributors, and ask for the delivery release notes as well: the V6.0 note is where the archive engine and the integrated Historian functionality are named. For WinCC RT Professional, the archive query section lives in the TIA Portal online documentation rather than in a printed manual.

Can the SQL Server instance delivered with WinCC 6.0 also host my other applications' databases?

Give other applications their own database instance. The V6.0 delivery documentation presents SQL Server 2000 as the foundation of the WinCC archiving system with its Historian functionality, and nothing in it offers that instance as a general-purpose server. Pointing another application's tables at it puts that load on the same engine that stores the plant's process history.

Can Excel or a Visual Basic program read WinCC archives?

Yes, whenever the client works as an OLE DB consumer: the SQL Server Import / Export Wizard that the V8.0 documentation names for standard queries is one such consumer, and spreadsheet or VB clients that speak OLE DB can use the same provider. On a 6.0 system the equivalent job went through the Connectivity Pack option, so the answer follows the installed generation rather than the client you prefer.

Keep reading

  • Selection guide

    Why WinCC Flexible Builds SQL Batch Tables Without a Grid

    WinCC Flexible 2008 SP3 has no native DataGrid control, so it cannot scroll a variable-length SQL result set. For a single-user batch plant, build a short fixed-row table from scripts and I/O fields, launch a separate reporting application on a Windows PC runtime, or move the reporting scope to WinCC Explorer or WinCC Professional.

    HMI and touchscreens

  • Explainer

    Why redundant WinCC single-user stations need no WinCC/Server

    WinCC/Server is required only when the redundant pair runs multi-user (server) projects. Two single-user stations paired by the WinCC/Redundancy option, one license covering two installations, synchronize their archives and carry on when one station fails, without any WinCC/Server license. Clients never host redundancy because they do not archive.

    HMI and touchscreens

  • How-to

    WinCC Unified SES and PI option release status before install

    If a WinCC Unified SES or PI option cannot be downloaded or activated, its release status comes first: an option that is not released for your engineering and runtime version has nothing to install. Then treat version match, the option's own installation notes and the ES and runtime licenses as separate checks.

    HMI and touchscreens

WinCC Flexible Migration Fails at 9% on Missing SQL Database