1 2 3 4 5 6 > >>   ∑:464  Sort:Date

DEFAULT - Providing Default Values to Function Parameters in SQL Server
How To Provide Default Values to Function Parameters in SQL Server Transact-SQL? If you add a parameter when creating a stored procedure, you can provide a default value so that the execution statement is not required to pass input value to this parameter: To define a default value to a parameter wh...
2023-03-03, 29424🔥, 1💬

💬 2023-03-03 yk: ok

Converting Date and Time Values into Integers in SQL Server
Can Date and Time Values Be Converted into Integers in SQL Server Transact-SQL? Can date and time values be converted into integers? The answer is yes. The resulting integer will be the number days relative the base date: Jan 1, 1900. The time of the day will be rounded to days. But there several ru...
2017-02-22, 28979🔥, 0💬

AdventureWorksLT - Downloading and Installing the Sample Database in SQL Server
How to download and install the scaled-down database AdventureWorksLT in SQL Server? If you want to practice you DBA skills with the scaled-down version of the sample database AdventureWorksLT provided by Microsoft, you should follow this tutorial to download and install it first: 1. Go to the SQL S...
2019-08-04, 12718🔥, 1💬

💬 2019-08-04 Marc: many thanks

CONTINUE to Next Loop Iteration in SQL Server Transact-SQL
How to continue to the next iteration of a WHILE loop in SQL Server Transact-SQL? How to use CONTINUE statements? You can use the CONTINUE statement to continue to the next iteration of a WHILE loop by skipping the rest of statement block of the current iteration using this syntax: WHILE condition B...
2017-01-11, 11081🔥, 0💬

Precision and Rounding of FLOAT Values in SQL Server Transact-SQL
How REAL and FLOAT Literal Values Are Rounded in SQL Server Transact-SQL? By definition, FLOAT(n) should store the mantissa of the floating number in n bits. For example, FLOAT(16) should have a precision one-byte less than FLOAT(24). However, SQL Server Transact-SQL only supports two precisions for...
2017-04-19, 10616🔥, 0💬

Binary Literals in SQL Server Transact-SQL
What are binary literals supported in SQL Server Transact-SQL? Binary literals in Transact-SQL are sequences of bytes written in hexadecimal digits with 0x prefixes. Binary literals are used to provide values to binary variables or table columns like BINARY, VARBINARY, IMAGE, etc. Here are some simp...
2017-05-05, 10185🔥, 0💬

Calculating Age in Days, Hours and Minutes in SQL Server
How To Calculate Age in Days, Hours and Minutes in SQL Server Transact-SQL? On many Web sites, news items or blog articles are displayed with a publishing data and time represented in days, hours and minutes. To do this you can use the DATEDIFF() function with a simple algorithm as shown in the tuto...
2017-02-14, 9821🔥, 0💬

SQL Server Database Tutorials
Where to find SQL Server database server tutorials? Here is a collection of tutorials, tips and FAQs for SQL Server DBA and SQL Server database application developers. Clear explanations and sample scripts provided can be used as learning tutorials or interview preparation guides. It doesn't matter ...
2016-10-18, 9347🔥, 0💬

Out-of-Range DATETIME Values in SQL Server Transact-SQL
What Are Out-of-Range Errors with DATETIME values in SQL Server Transact-SQL? When you enter DATETIME values, you may get out-of-range errors due to two common mistakes: The date value is a valid calendar date, but it is not in the range covered by DATETIME data type: from January 1, 1753, to Decemb...
2017-04-08, 8809🔥, 0💬

AdventureWorksLT Entity Relation Diagram in SQL Server
How AdventureWorksLT tables are related in SQL Server? There are 12 user tables defined in AdventureWorksLT: USE AdventureWorksLT GO SELECT s.name, t.name, t.type_desc FROM sys.tables t, sys.schemas s WHERE t.schema_id = s.schema_id ORDER BY s.name GO s.name t.name t.type_desc dbo BuildVersion USER_...
2016-12-02, 7365🔥, 0💬

bin2hex - Converting Binary Strings into Hexadecimal Character Strings in SQL Server
How To Convert Binary Strings into Hexadecimal Character Strings in SQL Server? When a query returns a binary string value to the client tool, it will be displayed by the client tool as hexadecimal digits in a character string format. But they are hexadecimal digits on the display window, not in the...
2018-06-19, 6897🔥, 1💬

💬 2018-06-19 ramesh adhikari: sdafdffddf

Underflow and Overflow of FLOAT Values in SQL Server Transact-SQL
What Are the Underflow and Overflow Behaviors on FLOAT Literals in SQL Server Transact-SQL? If you enter a floating number that is too big or too small for the FLOAT data type, Transact-SQL will behave as: FLOAT(24) Underflow: If a floating number is too small for FLOAT(24), it will be stored as 0 w...
2017-04-19, 6679🔥, 0💬

Unicode Character String Literals in SQL Server Transact-SQL
How To Enter Unicode Character String Literals in SQL Server Transact-SQL? Unicode characters are multi-byte characters. They are very hard to be entered as string literals, because it requires: The SQL client tool to support Unicode characters. The command line tool 'sqlcmd' does not support Unicod...
2019-12-05, 6369🔥, 1💬

💬 2019-12-05 gopala krishna: gopala krishna

SQL Server Transact-SQL Tutorials
Where to find tutorials to answer some frequently asked questions on Microsoft SQL Server Transact-SQL? I want to know how to write database scripts to run on SQL Server. Here is a list of frequently asked questions and their answers compiled by FYIcenter.com DBA team about Microsoft SQL Server Tran...
2023-11-18, 6038🔥, 0💬

sys.procedures - Listing All Stored Procedures in SQL Server
How To List All Stored Procedures in the Current Database in SQL Server Transact-SQL? If you want to see a list of stored procedures in your current database, you can use the system view, sys.procedures as shown in this tutorial exercise: USE FyiCenterData; GO SELECT * FROM sys.procedures; GO Name o...
2017-01-05, 5997🔥, 0💬

RAND() - Generating Random Numbers in SQL Server
How To Generate Random Numbers with the RAND() Function in SQL Server Transact-SQL? Random numbers are very useful for generating test data, passwords, or other security related data. SQL Server 2005 offers you the random number generator function RAND in two format: RAND(seed) - Starting a new sequ...
2017-03-11, 5886🔥, 0💬

Inserting New Line Characters into Strings in SQL Server
How To Insert New Line Characters into Strings in SQL Server Transact-SQL? If you want to break a string into multiple lines, you need to insert new line characters into the string. With some client tools like SQL Server Management Studio, it is not so easy to insert a new line character. One work a...
2022-05-12, 5734🔥, 1💬

sys.sql_modules - Getting Stored Procedure Definitions Back in SQL Server
How To Get the Definition of a Stored Procedure Back in SQL Server Transact-SQL? If you want get the definition of an existing stored procedure back from the SQL Server, you can use the system view called sys.sql_modules, which stores definitions of views and stored procedures. The sys.sql_modules h...
2017-01-05, 5617🔥, 0💬

ROUND() - Rounding Values to Specific Precisions in SQL Server
How To Round a Numeric Value To a Specific Precision in SQL Server Transact-SQL? Sometimes you need to round a numeric value to a specific precision. For example, you may want to round values in your financial statement to the precision of 1000.00. This can be done by the ROUND() function with the f...
2017-03-11, 5132🔥, 0💬

Downloading and Installing SQL Server 2005 Express Edition
Where to find answers to frequently asked questions on Downloading and Installing SQL Server 2005 Express Edition? Here is a list of frequently asked questions and their answers compiled by FYIcenter.com DBA team on Downloading and Installing SQL Server 2005 Express Edition. Clear answers are provid...
2022-04-30, 5119🔥, 5💬

💬 2022-04-30 sarot: for using

sys.database_principals - Listing All User Names in SQL Server
How To List All User Names in a Database in SQL Server? If you want to see a list of all user names defined in a database, you can use the system view, sys.database_principals as shown in this tutorial exercise: -- Login with sa -- Select a database USE FyiCenterData; GO -- List all user names SELEC...
2017-08-25, 5039🔥, 0💬

sys.server_principals - Listing All Login Names in SQL Server
How To List All Login Names on the Server in SQL Server? If you want to see a list of all login names defined on the server, you can use the system view, sys.server_principals as shown in this tutorial exercise: -- Login with sa SELECT name, sid, type, type_desc FROM sys.server_principals WHERE type...
2016-10-20, 4978🔥, 0💬

Ending Stored Procedures Properly in SQL Server
How To End a Stored Procedure Properly in SQL Server Transact-SQL? Where the end of the "CREATE PROCEDURE" statement structure? The answer is simple, the end of the statement batch. Even if you are using a "BEGIN ... END" statement block, the stored procedure structure is not going to end at the end...
2017-01-05, 4970🔥, 0💬

FLOOR, CEILING, ROUND - Converting Values to Integers in SQL Server
How To Convert Numeric Values to Integers in SQL Server Transact-SQL? Sometimes you need to round a numeric value into an integer. SQL Server 2005 offers you a number of ways to do this: FLOOR(value) - Returning the largest integer less than or equal to the input value. The returning data type is th...
2017-03-22, 4956🔥, 0💬

1 2 3 4 5 6 > >>   ∑:464  Sort:Date