<< < 4 5 6 7 8 9 10 11 12 13 14 > >>   ∑:469  Sort:Date

Passing Name-Value Pairs as Parameters in SQL Server
What Are the Advantages of Passing Name-Value Pairs as Parameters in SQL Server Transact-SQL? When calling a stored procedure defined with parameters, you can pass values to those parameters in two ways: Passing only values in the same order as parameters defined in the stored procedure. Passing nam...
2016-12-28, 1639🔥, 0💬

"GRANT EXECUTE" Statements - Granting EXECUTE permission in SQL Server
How to grant a permission using "GRANT EXECUTE" statements in SQL Server? This is the fourth tutorial of a quick lesson on creating login and configure users for databases with Transact-SQL statements. Granting a user access to a database involves three steps. First, you create a login. The login le...
2016-11-27, 1637🔥, 0💬

"CREATE FUNCTION" - Creating User Defined Functions in SQL Server
How To Create a Simple User Defined Function in SQL Server Transact-SQL? If you want to create a simple user defined function, you can use the "CREATE FUNCTION" command with a statement block in a simple format as shown in below: CREATE FUNCTION function_name() RETURNS data_type AS BEGIN statement_1...
2016-12-24, 1632🔥, 0💬

Assigning New Column Names in a View in SQL Server
How To Assign New Column Names in a View in SQL Server? By default, column names in a view are provided by the underlying SELECT statement. But sometimes, the underlying SELECT statement can not provide names for output columns that specified as expressions with functions and operations. In this cas...
2016-11-03, 1632🔥, 0💬

Attaching AdventureWorksLT Physical Files to the Server in SQL Server
How to attach AdventureWorksLT physical files to the server in SQL Server? After installed the sample database AdventureWorksLT, you need to attach it to your SQL server to make it available by follow this tutorial: EXEC sp_attach_db @dbname=N'AdventureWorksLT', @filename1=N'C:\Program Files\Microso...
2016-12-02, 1631🔥, 0💬

Differences of CHAR and VARCHAR in SQL Server Transact-SQL
What Are the Differences between CHAR and VARCHAR in SQL Server Transact-SQL? CHAR and VARCHAR are both used to store code page based 1-byte character strings in Transact-SQL. But they have the following main differences: CHAR(n) stores character strings with a fixed length, n bytes, storage format....
2017-04-04, 1629🔥, 0💬

Creating User Defined Functions with Parameters in SQL Server
How To Create User Defined Functions with Parameters in SQL Server Transact-SQL? Very often, you need to create a function with one or more parameters so that the function can be more generic. You only supply values to those parameters at the time of executing the function. User defined functions wi...
2016-12-18, 1627🔥, 0💬

Selecting Some Specific Rows from a Table in SQL Server
How To Select Some Specific Rows from a Table in SQL Server? If you don't want select all rows from a table, you can specify a WHERE clause to tell the query to return only the rows that meets the condition defined in the WHERE clause. The WHERE clause condition is a normal Boolean expression. If an...
2016-10-26, 1625🔥, 0💬

Testing Table for DML Statements in SQL Server
How To Create a Testing Table with Test Data in SQL Server? If you want to practice DML statements, like INSERT, UPDATE and DELETE statements, you should create a testing table. The tutorial exercise shows you a good example: CREATE TABLE fyi_links (id INTEGER PRIMARY KEY, url VARCHAR(80) NOT NULL, ...
2016-11-03, 1622🔥, 0💬

Using ORDER BY to Define a View in SQL Server
Can You Use ORDER BY When Defining a View in SQL Server? Sometimes you want the data in a view to be sorted and try to use the ORDER BY clause in the SELECT statement to define the view. But SQL Server will not allow you to use ORDER BY to define a view without the TOP clause. The tutorial exercise ...
2016-11-04, 1620🔥, 0💬

"sp_columns" - Getting a List of Columns in a Table in SQL Server
How To Get a List of Columns using the "sp_columns" Stored Procedure in SQL Server? If you have an existing table, but you don't remember what are the columns defined in the table, you can use the "sp_columns" stored procedure to get a list of all columns of the specified table. The following tutori...
2016-11-17, 1618🔥, 0💬

Approximate Numeric Literals in SQL Server Transact-SQL
What are approximate numeric literals supported in SQL Server Transact-SQL? Approximate numeric literals in Transact-SQL are numbers written in scientific notation formats. Approximate numeric literals are used to provide values to approximate numeric variables or table columns like LOAT(24), DOUBLE...
2017-05-05, 1617🔥, 0💬

Get System Date and Time in SQL Server Transact-SQL
How to get system date and time in SQL Server Transact-SQL? I want a list of functions for getting current system date and time. Here is a comparison of all functions that you can use to get the current date and time from the data base server system: Function Return type Precision ------------------...
2017-02-25, 1616🔥, 0💬

Passing Values to User Defined Function Parameters in SQL Server
How To Provide Values to User Defined Function Parameters in SQL Server Transact-SQL? If a user defined function is created with parameters, you need pass values to those parameters when calling the function with one of two formats listed below: expression... function_name(value_1, value_2, ... valu...
2016-12-18, 1609🔥, 0💬

ONLINE/OFFLINE - Database States in SQL Server
What are database states in SQL Server? A database is always in one specific state. For example, these states include ONLINE, OFFLINE, or SUSPECT. To verify the current state of a database, select the state_desc column in the sys.databases catalog view. The following table defines the database state...
2016-11-20, 1609🔥, 0💬

Passing Expressions to Stored Procedure Parameters in SQL Server
Can You Pass Expressions to Stored Procedure Parameters in SQL Server Transact-SQL? Can you pass expressions to stored procedure parameters? The answer is no. When executing stored procedures, all input values must be entered as data literals, which can be specified within single quotes ('), or with...
2016-12-28, 1604🔥, 0💬

Getting Started with Transact-SQL Statements in SQL Server
Where to find answers to frequently asked questions on Getting Started with Transact-SQL Statements in SQL Server? Here is a list of frequently asked questions and their answers compiled by FYIcenter.com DBA team on Getting Started with Transact-SQL Statements in SQL Server. Clear examples are provi...
2016-12-02, 1604🔥, 0💬

Mixing Group Functions with Non-group Selection Fields in SQL Server
Can Group Functions Be Mixed with Non-group Selection Fields in SQL Server? If a group function is used in the SELECT clause, all other selection fields must be group level fields. Non-group fields can not be mixed with group fields in the SELECT clause. The script below gives you an example of inva...
2016-10-25, 1602🔥, 0💬

"CREATE DATABASE" Statement - Creating New Databases in SQL Server
How to create new databases with "CREATE DATABASE" statements in SQL Server? This is the first tutorial of a quick lesson on creating database objects with Transact-SQL statements. This lesson shows you how to create a database, create a table in the database, and then access and change the data in ...
2016-12-02, 1596🔥, 0💬

"ALTER AUTHORIZATION" - Changing the Ownership of a Schema in SQL Server
How To Change the Ownership of a Schema in SQL Server? If you want to change the owner of a schema, you can use the "ALTER AUTHORIZATION" statement using the following syntax: ALTER AUTHORIZATION ON SCHEMA::schema_name TO user_name The following tutorial example shows you how to change ownership of ...
2016-10-22, 1596🔥, 0💬

Managing Tables and Columns in SQL Server
Where to find answers to frequently asked questions on Managing Tables and Columns in SQL Server? Here is a list of frequently asked questions and their answers compiled by FYIcenter.com DBA team on Managing Tables and Columns in SQL Server. Clear answers are provided with tutorial exercises on crea...
2016-11-20, 1594🔥, 0💬

Using Old Values to Define New Values in UPDATE Statements in SQL Server
How to use old values to define new values in UPDATE statements in SQL Server? If a row matches the WHERE clause in a UPDATE statement, existing values in this row can be used in expressions to provide new values in the SET clause. Existing values are represented by column names in the expressions. ...
2016-11-02, 1594🔥, 0💬

Date and Time Data Types in SQL Server Transact-SQL
What are date and time data types supported in SQL Server Transact-SQL? Date and time data types are used to hold dates and times. There are 6 date and time data types supported in SQL Server Transact-SQL: 1. DATETIME - Use to hold date and times with a large precision using 8-byte storages: 4 bytes...
2017-04-15, 1592🔥, 0💬

Compilation Error in a Statement Batch in SQL Server
What happens to a Transact-SQL statement batch if there is a compilation error? If a Transact-SQL statement batch has multiple statements, and one of them has compilation error, none of the statements in the batch will be executed. The tutorial exercise below gives you some good examples: SELECT get...
2017-05-29, 1590🔥, 0💬

<< < 4 5 6 7 8 9 10 11 12 13 14 > >>   ∑:469  Sort:Date