<< < 12 13 14 15 16 17 18 19 20 > >>   ∑:464  Sort:Date

"TOP" - Return the Top 5 Rows from a SELECT Query in SQL Server
How To Return the Top 5 Rows from a SELECT Query in SQL Server? If you want the query to return only the first 5 rows, you can use the "TOP 5" clause. The TOP clause takes one parameter to indicate how many top rows to return. The following statements returns the first 5 rows and 3 rows from the fyi...
2016-10-29, 1298🔥, 0💬

"DELETED" - Old Record of an DML Event Instance in SQL Server
How To Access the Deleted Record of an Event in SQL Server? When a DML event occurs, SQL Server will prepare a temporary table called "DELETED", which contains the old record of the affected row, which is: A copy of the deleted row for a DELETE statement. A copy of the row to be updated for an UPDAT...
2016-10-24, 1297🔥, 0💬

Getting a List of All Databases on the Server in SQL Server
How to get a list all databases on the SQL server in SQL Server? If you don't remember database names you have created, you can get a list of all databases on the server by query the "sys.databases" view as shown in this tutorial example: CREATE DATABASE FyiCenterData GO SELECT name, database_id, cr...
2016-11-24, 1295🔥, 0💬

"DROP TABLE" - Deleting Existing Tables in SQL Server
How To Drop an Existing Table with "DROP TABLE" Statements in SQL Server? If you want to delete an existing table and its data rows, you can use the "DROP TABLE" statement as shown in the tutorial script below: SELECT * FROM tipBackup GO id subject description create_date 1 Learn SQL Visit dev.fyice...
2016-11-15, 1294🔥, 0💬

Subtracting a DATETIME Value from Another DATETIME Value in SQL Server
Can a DATETIME Value Be Subtracted from Another DATETIME Value in SQL Server Transact-SQL? Can a datetime value be subtracted from another datetime value? The answer is yes. The subtract operation can be performed by the subtract operator (-) as: datetime1 - datetime2: Returning a DATETIME value cal...
2017-02-20, 1291🔥, 0💬

PHP ODBC - Query Multiple Tables Jointly
PHP ODBC - How To Query Multiple Tables Jointly? If you want to query information stored in multiple tables, you can use the SELECT statement with a WHERE condition to make an inner join. Assuming that you have 3 tables in a forum system: "users" for user profile, "forums" for forums information, an...
2023-12-30, 1285🔥, 0💬

Security Principals Used in SQL Server 2005 in SQL Server
What Are Security Principals Used in SQL Server 2005 in SQL Server? SQL Server 2005 supports several basic security principals located at different levels: Windows-Level Principals: Windows Local Login and Windows Network Domain Login - Used to control accesses to SQL Server instances. SQL Server-Le...
2016-10-20, 1285🔥, 0💬

Creating a New Table in a Given Schema in SQL Server
How To Create a New Table in a Given Schema in SQL Server? When you create a new table, you can specify in which schema you want this table to be located by prefixing the table name with the schema name. In the tutorial example below, a new table "test" is created in schema "fyi": USE FyiCenterData;...
2016-10-22, 1283🔥, 0💬

Joining Two Tables in a Single Query in SQL Server
How To Join Two Tables in a Single Query in SQL Server? Two tables can be joined together in a query in 4 ways: Inner Join: Returns only rows from both tables that satisfy the join condition. Left Outer Join: Returns rows from both tables that satisfy the join condition, and the rest of rows from th...
2016-10-30, 1279🔥, 0💬

DROP VIEW - Deleting Existing Views in SQL Server
How To Drop Existing Views from a Database in SQL Server? If you don't need a specific view any more, you can use the DROP VIEW statement to delete it from the database. The following tutorial exercise shows you how to delete the view, fyi_links_view: USE FyiCenterData; GO SELECT * FROM sys.views; G...
2016-11-05, 1277🔥, 0💬

Providing Column Names in INSERT Statements in SQL Server
How to provide column names in INSERT Statements in SQL Server? If you don't want to specify values for columns that have default values, or you want to specify values to columns in an order different than how they are defined, you can provide a column list in the INSERT statement. If a column is om...
2016-11-02, 1275🔥, 0💬

"OPEN" - Executing the Query of a Cursor in SQL Server
How To Execute the Cursor Queries with "OPEN" Statements in SQL Server Transact-SQL? Once a cursor is declared, you need to execute the query attached to the cursor so that the result set returned from the query can be accessed through the cursor. To execute the cursor query, you should use the OPEN...
2016-10-17, 1275🔥, 0💬

What Is a Schema in SQL Server 2005 in SQL Server
What Is a Schema in SQL Server 2005 in SQL Server? A schema is a container of database objects with the following interesting related rules: A schema may contain different object types, like tables, indexes, views, procedures, functions, etc. A database user can be assigned with a default schema. Ob...
2016-10-22, 1274🔥, 0💬

Adding More Test Data for Query Statements in SQL Server
How To Add More Data to the Testing Table in SQL Server? If you want to continue with other tutorial exercises in this FAQ collection, you need to add more data to the testing table. Follow the script below to add a new column and more rows: ALTER TABLE fyi_links ADD tag VARCHAR(8) GO UPDATE fyi_lin...
2016-10-26, 1273🔥, 0💬

Using Subqueries with the IN Operators in SQL Server
How To Use Subqueries with the IN Operators in SQL Server? A subquery can be used with the IN operator as "expression IN (subquery)". The subquery should return a single column with one or more rows to form a list of values to be used by the IN operation. The following tutorial exercise shows you ho...
2016-10-29, 1272🔥, 0💬

Using Group Functions in the SELECT Clause in SQL Server
How To Use Group Functions in the SELECT Clause in SQL Server? If group functions are used in the SELECT clause, all rows that meet the criteria defined in the WHERE clause will be treated as a single group. The group functions will be apply all rows in that group as a whole. The final output of the...
2016-10-25, 1271🔥, 0💬

Installing DTS on Windows XP Systems
How To Install DTS (Data Transformation Services) on Windows XP Systems? SQL Server 2000 is not supported on Windows XP systems, but you can still install DTS (Data Transformation Services) as client component your XP system. This allows you to continue to use DTS with SQL Server 2005, if you don't ...
2024-01-31, 1270🔥, 0💬

Inserting Data into a View in SQL Server
Can You Insert Data into a View in SQL Server? Can you insert data into a view? The answer is no. But if the question is "Can you insert data into the underlying table through view?" The answer is then yes. SQL Server will allow you to insert data into the underlying table through a view with a cond...
2016-11-04, 1270🔥, 0💬

Transferring Tables from One Schema to Another in SQL Server
How To Transfer an Existing Table from One Schema to Another Schema in SQL Server? If you want to move an existing table from one schema to another schema, you can use the "ALTER SCHEMA ... TRANSFER ..." statement as shown in the tutorial exercise below: -- Login with "sa" USE FyiCenterData; GO -- C...
2016-10-22, 1270🔥, 0💬

Deleting Data from a View in SQL Server
Can You Delete Data from a View in SQL Server? Can you delete data in a view? The answer is no. But if the question is "Can you delete data from the underlying table through view?" The answer is then yes. SQL Server will allow you to delete data from the underlying table through a view. The tutorial...
2016-11-03, 1267🔥, 0💬

Security Model Used in SQL Server 2005 in SQL Server
What Is the Security Model Used in SQL Server 2005 in SQL Server? SQL Server 2005 uses a very standard security model involves 3 concepts: Securables - Entities representing resources that need to be secured. For example, a database table is a securable. Principals - Entities representing users that...
2016-10-20, 1264🔥, 0💬

PHP MSSQL - Updating Existing Rows in a Table
PHP MSSQL - How To Update Existing Rows in a Table? Updating existing rows in a table requires to run the UPDATE statement with a WHERE clause to identify the row. The following sample script updates one row with two new values: &lt;?php $con = mssql_connect('LOCALHOST','sa' ,'FYIcenter');mssql_...
2024-02-18, 1262🔥, 0💬

HAVING - Apply Filtering Criteria at Group Level in SQL Server
How To Apply Filtering Criteria at Group Level with The HAVING Clause in SQL Server? Let's say you have divided the query output into multiple groups with the GROUP BY clause. Now you are only interested in some of the groups, not all the groups. If you want to filter out some groups from the query,...
2016-10-25, 1259🔥, 0💬

PHP MSSQL - Dropping an Existing Table
PHP MSSQL - How To Drop an Existing Table? If you need to delete a table created before, you can run the DROP TABLE SQL statement using the mssql_query() function, as shown in the following sample script: &lt;?php $con = mssql_connect('LOCALHOST','sa' ,'FYIcenter');mssql_select_db('FyiCenterData ...
2024-03-07, 1256🔥, 0💬

<< < 12 13 14 15 16 17 18 19 20 > >>   ∑:464  Sort:Date