Here is an example: 1 2 3 4 5 6 7 USE Northwind SELECT CategoryID, MIN(ProductName) as MinName FROM Products GROUP BY CategoryID HAVING MIN(ProductName) < 'C' Output: Conclusion In this article, we learned ho
In a typical example for MyFood.dll, in which all types are in the MyFood namespace, the EXTERNAL NAME value could be MyFood.[MyFood.MyClass].MyStaticMethod. By default, SQL Server can't execute CLR code. You can create, modify, and drop database objects that reference common language...
Later, we use the SQL Server session context function SESSION_CONTEXT() and retrieve the key for it. 1 2 EXEC sp_set_session_context 'CustomerID', 101 SELECT SESSION_CONTEXT(N'CustomerID') AS CustomerID Example 2: Update value for a key in the session In this example, we update a...
Works in:SQL Server (starting with 2008), Azure SQL Database, Azure SQL Data Warehouse, Parallel Data Warehouse More Examples Example Delete 1 character from a string, starting in position 13, and then insert " is fun!" in position 13: ...
ExampleGet your own SQL Server Return the length of an expression (in bytes): SELECTDATALENGTH('W3Schools.com'); Try it Yourself » Definition and Usage The DATALENGTH() function returns the number of bytes used to represent an expression. ...
All connection and statement attributes successfully set by the application for the connection persist until SQLFreeHandle is called on the connection. For example, if an application calls SQLSetConnectAttr before connecting to a data source, the attribute persists even if SQLSetConnectAttr fails in the...
It replaces the ODBC 2.0 functions SQLFreeConnect (for freeing a connection handle) and SQLFreeEnv (for freeing an environment handle). SQLFreeConnect and SQLFreeEnv are both deprecated in ODBC 3*.x*. SQLFreeHandle also replaces the ODBC 2.0 function SQLFreeStmt (with the SQL_DROP Option)...
Applies to: SQL ServerAs described in the topic, Binding Relational Data Inside XML, you can use the sql:column(() function when you use XML Data Type Methods to expose a relational value inside XQuery.For example, the query() method (XML data type) is used to specify a query against ...
In a typical example for MyFood.dll, in which all types are in the MyFood namespace, the EXTERNAL NAME value could be MyFood.[MyFood.MyClass].MyStaticMethod. By default, SQL Server can't execute CLR code. You can create, modify, and drop database objects that reference common language...
When using connection pooling, an application must not execute SQL statements that change the database or the context of the database, such as the USE database statement in SQL Server, which changes the catalog used by a data source. Code Example See SQLBindCol, SQLGetData, and Sample ODBC ...