Home
Search results “Style sql convert”
Cast and Convert functions in SQL Server   Part 28
 
17:26
In this video we will learn, converting one data type to another using cast() and convert() functions. We will also learn how to use the style parameter, with convert() function. Finally we will look at a practical example of using CAST or CONVERT functions, along with group by. We will also talk about the differences between CAST and CONVERT functions and when to choose one over the other. Text version of the video http://csharp-video-tutorials.blogspot.com/2012/09/cast-and-convert-functions-in-sql.html Slides http://csharp-video-tutorials.blogspot.com/2013/08/part-28-cast-and-convert-functions.html All SQL Server Text Articles http://csharp-video-tutorials.blogspot.com/p/free-sql-server-video-tutorials-for.html All SQL Server Slides http://csharp-video-tutorials.blogspot.com/p/sql-server.html All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists
Views: 179427 kudvenkat
How To Convert Default Format Date Styles In SQL Server
 
05:43
Display a specific standard date pattern from default date style in a SQL Server table using convert method
TRY CONVERT function in SQL Server 2012
 
07:46
try convert function in sql sql server try_convert try_convert in sql server 2012 try convert sql try_parse vs try_convert sql server In this video we will discuss TRY_CONVERT function Difference between CONVERT and TRY_CONVERT functions Difference between TRY_PARSE and TRY_CONVERT functions TRY_CONVERT function Introduced in SQL Server 2012 Converts a value to the specified data type Returns NULL if the provided value cannot be converted to the specified data type If you request a conversion that is explicitly not permitted, then TRY_CONVERT fails with an error Syntax : TRY_CONVERT ( data_type, value, [style] ) Style parameter is optional. The range of acceptable values is determined by the target data_type. For the list of all possible values for style parameter, please visit the following MSDN article https://msdn.microsoft.com/en-us/library/ms187928.aspx Example : Convert string to INT. As the string can be converted to INT, the result will be 99 as expected. SELECT TRY_CONVERT(INT, '99') AS Result Example : Convert string to INT. The string cannot be converted to INT, so TRY_CONVERT returns NULL SELECT TRY_CONVERT(INT, 'ABC') AS Result Example : Converting an integer to XML is not explicitly permitted. so in this case TRY_CONVERT fails with an error SELECT TRY_CONVERT(XML, 10) AS Result If you want to provide a meaningful error message instead of NULL when the conversion fails, you can do so using CASE statement or IIF function. Example : Using CASE statement to provide a meaningful error message when the conversion fails. SELECT CASE WHEN TRY_CONVERT(INT, 'ABC') IS NULL THEN 'Conversion Failed' ELSE 'Conversion Successful' END AS Result Output : As the conversion fails, you will now get a message 'Conversion Failed' instead of NULL Example : Using IIF function to provide a meaningful error message when the conversion fails. SELECT IIF(TRY_CONVERT(INT, 'ABC') IS NULL, 'Conversion Failed', 'Conversion Successful') AS Result What is the difference between CONVERT and TRY_CONVERT CONVERT will result in an error if the conversion fails, where as TRY_CONVERT will return NULL instead of an error. Since ABC cannot be converted to INT, CONVERT will return an error SELECT CONVERT(INT, 'ABC') AS Result Since ABC cannot be converted to INT, TRY_CONVERT will return NULL instead of an error SELECT TRY_CONVERT(INT, 'ABC') AS Result Example : Using TRY_CONVERT() function with table data. We will use the following Employees table for this example. SQL Script to create Employees table Create table Employees ( Id int primary key identity, Name nvarchar(10), Age nvarchar(10) ) Go Insert into Employees values ('Mark', '40') Insert into Employees values ('John', '20') Insert into Employees values ('Amy', 'THIRTY') Insert into Employees values ('Ben', '21') Insert into Employees values ('Sara', 'FIFTY') Insert into Employees values ('David', '25') Go The data type of Age column is nvarchar. So string values like (THIRTY, FIFTY ) are also stored. Now, we want to write a query to convert the values in Age column to int and return along with the Employee name. Notice TRY_CONVERT function returns NULL for the rows where age cannot be converted to INT. SELECT Name, TRY_CONVERT(INT, Age) AS Age FROM Employees If you use CONVERT instead of TRY_CONVERT, the query fails with an error. SELECT NAME, CONVERT(INT, Age) AS Age FROM Employees The above query returns the following error Conversion failed when converting the nvarchar value 'THIRTY' to data type int. Difference between TRY_PARSE and TRY_CONVERT functions TRY_PARSE can only be used for converting from string to date/time or number data types where as TRY_CONVERT can be used for any general type conversions. For example, you can use TRY_CONVERT to convert a string to XML data type, where as you can do the same using TRY_PARSE Converting a string to XML data type using TRY_CONVERT SELECT TRY_CONVERT(XML, '[root][child/][/root]') AS [XML] Converting a string to XML data type using TRY_PARSE SELECT TRY_PARSE('[root][child/][/root]' AS XML) AS [XML] The above query will result in the following error Invalid data type xml in function TRY_PARSE Another difference is TRY_PARSE relies on the presence of .the .NET Framework Common Language Runtime (CLR) where as TRY_CONVERT does not. Text version of the video http://csharp-video-tutorials.blogspot.com/2015/10/tryconvert-function-in-sql-server-2012.html Slides http://csharp-video-tutorials.blogspot.com/2015/10/tryconvert-function-in-sql-server-2012_16.html All SQL Server Text Articles http://csharp-video-tutorials.blogspot.com/p/free-sql-server-video-tutorials-for.html All SQL Server Slides http://csharp-video-tutorials.blogspot.com/p/sql-server.html All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists
Views: 26114 kudvenkat
CONVERSION FUNCTION IN SQL SERVER 2014 || CAST AND CONVERT FUNCTION IN SQL SERVER 2014
 
04:48
This video will provide you the details of each Conversion functions in SQL Server 2014. I'll be walking through each and every kinds of build in function which are available in SQL Server in my next videos. Conversion Functions :- CAST and CONVERT (Transact-SQL) Converts an expression of one data type to another.  Syntax -- Syntax for CAST: CAST ( expression AS data_type [ ( length ) ] ) -- Syntax for CONVERT: CONVERT ( data_type [ ( length ) ] , expression [ , style ] ) Implicit Conversion Explicit Conversion Implicit Conversion is done automatically Explicit Conversion is done programmatically. In Implicit conversion, no data loss take place during the data conversion. In explicit conversion, data loss may or may not be take place during data conversion. Hence there is a risk of information loss. No possibility of throwing exception during the conversion and therefore is called type safe. It might throw error if tried to do without type casting. Implicit conversion do not require any special syntax. Explicit conversion do require cast operator to perform conversion. Example : Example : Conversion of smaller number to larger number is implicit conversion. Conversion of larger number to smaller number is explicit conversion.  Arguments expression Is any valid expression. data_type Is the target data type. This includes xml, bigint, and sql_variant. Alias data types cannot be used. length Is an optional integer that specifies the length of the target data type. The default value is 30. style Is an integer expression that specifies how the CONVERT function is to translate expression. If style is NULL, NULL is returned. The range is determined by data_type. For more information, see the Remarks section.  Return Types Returns expression translated to data_type.  Remarks • Date and Time Styles When expression is a date or time data type, style can be one of the values shown in the following table. Other values are processed as 0. . Beginning with SQL Server 2012, the only styles that are supported when converting from date and time types to datetimeoffset are 0 or 1. All other conversion styles return error 9809. SQL Server supports the date format in Arabic style by using the Kuwaiti algorithm. Without century (yy) (1) With century (yyyy) Standard Input/Output (3) - 0 or 100 (1,2) Default for datetime and smalldatetime mon dd yyyy hh:miAM (or PM) 1 101 U.S. 1 = mm/dd/yy 101 = mm/dd/yyyy 2 102 ANSI 2 = yy.mm.dd 102 = yyyy.mm.dd 3 103 British/French 3 = dd/mm/yy 103 = dd/mm/yyyy 4 104 German 4 = dd.mm.yy 104 = dd.mm.yyyy 5 105 Italian 5 = dd-mm-yy 105 = dd-mm-yyyy 6 106 (1) - 6 = dd mon yy 106 = dd mon yyyy 7 107 (1) - 7 = Mon dd, yy 107 = Mon dd, yyyy 8 108 - hh:mi:ss - 9 or 109 (1,2) Default + milliseconds mon dd yyyy hh:mi:ss:mmmAM (or PM) 10 110 USA 10 = mm-dd-yy 110 = mm-dd-yyyy 11 111 JAPAN 11 = yy/mm/dd 111 = yyyy/mm/dd 12 112 ISO 12 = yymmdd 112 = yyyymmdd - 13 or 113(1,2) Europe default + milliseconds dd mon yyyy hh:mi:ss:mmm(24h) 14 114 - hh:mi:ss:mmm(24h) - 20 or 120 (2) ODBC canonical yyyy-mm-dd hh:mi:ss(24h) - 21 or 121 (2) ODBC canonical (with milliseconds) default for time, date, datetime2, and datetimeoffset yyyy-mm-dd hh:mi:ss.mmm(24h) - 126 (4) ISO8601 yyyy-mm-ddThh:mi:ss.mmm (no spaces) Note: When the value for milliseconds (mmm) is 0, the millisecond value is not displayed. For example, the value '2012-11-07T18:26:20.000 is displayed as '2012-11-07T18:26:20'. - 127(6, 7) ISO8601 with time zone Z. yyyy-mm-ddThh:mi:ss.mmmZ (no spaces) Note: When the value for milliseconds (mmm) is 0, the milliseconds value is not displayed. For example, the value '2012-11-07T18:26:20.000 is displayed as '2012-11-07T18:26:20'. - 130 (1,2) Hijri (5) dd mon yyyy hh:mi:ss:mmmAM In this style, mon represents a multi-token Hijri unicode representation of the full month's name. This value will not render correctly on a default US installation of SSMS. - 131 (2) Hijri (5) dd/mm/yyyy hh:mi:ss:mmmAM
Views: 209 Softtech forum
CONVERT, TRY CONVERT(TRY_CONVERT) AND PARSE IN SQL SERVER
 
13:57
CONVERT: Convert expressions from one type to another. Can be used to display date/time data in various formats. TRY_CONVERT : TRY CONVERT New built in function introduced in SQL 2012 TRY_CONVERT function is similar to the CONVERT function if CONVERT function fails to convert the value to the requested type then throws an exception whereas TRY_CONVERT function returns NULL value. PARSE: New built in function introduced in SQL 2012. Converts the string expression to the requested data type. It tries it’s best to translate the string value to requested type but if it fails to translate then raises an exception. CONVERT IN SQL SERVER PARSE IN SQL SERVER TRY_CONVERT IN SQL SERVER Part of SQL Interview Questions , MSBI Interview Questions..
Views: 1618 Training2SQL MSBI
Function -cast and convert function
 
06:03
Cast and Convert functions : a) . Cast is based on ANSI standard and Convert is specific to SQL Server. So, if portability is a concern and if you want to use the script with other database applications, use Cast(). b) Convert provides more flexibility than Cast. For example, it's possible to control how you want DateTime datatypes to be converted using styles with convert function. The general guideline is to use CAST(), unless you want to take advantage of the style functionality in CONVERT(). Syntax of CAST and CONVERT functions from MSDN: CAST ( expression AS data_type [ ( length ) ] ) CONVERT ( data_type [ ( length ) ] , expression [ , style ] )
Views: 21 R K
SQL Server Convert Date from yyyy-mm-dd to dd-mm-yyyy Datetime Column Query Command Line
 
01:14
SQL Server Convert Date from yyyy-mm-dd to dd-mm-yyyy Datetime Column Query Command Line Management Studio.
Views: 182 Saidah Faulia
C# Tutorial 23: How to use DateTimePicker and save date in Database
 
14:04
Visual C# .NET Controls The Date Time Picker - Date Picker C# - How do I set my datetimepicker date? visual C# - DateTimePicker date to string C# How to compare the time of a DateTimePicker control and the How do I get value from Date time picker and Month calendar C# How to pass values to a dateTimePicker control‎ C# How to change DateTimePicker control to 24h time format ? Getting started with the DateTimePicker Visual Studio 2012 RC - Age calculation from Converting date time picker value into t_time type date time picker‎ - 7 posts DateTimePicker - Visual C# assign SYSTEMTIME to DateTimePicker Control‎ C#
Views: 316698 ProgrammingKnowledge
Hello, SQL DBeaver style
 
16:47
Creating a table, inserting data, and simple select using DBeaver and MariaDB (MySQL)
Views: 27542 drprventura
Convert a paper into IEEE - Quick conversion guide
 
14:46
http://www.qcfinance.in/ Learn how to convert a paper into IEEE (Conversion Guide) https://www.meetup.com/New-York-Python-SQL-Bootcamp-Data-Science-Analytics/
Views: 90335 Satyadhar Joshi
How to convert String to Date in java?
 
04:25
string to date java example, string to date java yyyy-mm-dd, string to date java simpledateformat, string to date java 7, string to date java, string to date java conversion
Metasploit Full Tutorials - BRUTE MSSQL , Post exploit, Upgrade Shell Privileges
 
03:31
Here we gain access through a previous brute force, gain a meterpreter shell use ms15_051 to spawn a new shell with SYSTEM level. Upgrade the Shell to a meterpreter session. All done with UAC switched on running as a standard user. This site is designed for Pentesters for Proof of Concept style testing to enhance their security methodology. It is purely for educational purposes and I do not condone or recommend attempting any of the techniques in any of these videos on any network or part of any network you do not have 100% consent to do so on. I hold no responsibility for any loss of service, corruption or loss of data due to taking any of the following the steps in any tutorials from this site. This site has been created for educational purposes to explain techniques for enthusiastic network engineers and security experts to helping understanding how to improve their security and stop unauthorized access.
Views: 1396 Metasploitation
How to convert string to datetime in sqlserver with Queries
 
09:33
http://www.aspnettutorialonline.blogspot.com http://www.jqueryexamplecode.blogspot.com https://www.facebook.com/Aspnettutorialonline/ http://javainterviewquestionsbook.blogspot.com convert varchar to datetime in sql server convert varchar to datetime in sql server 2008 example convert varchar to datetime in sql server 2005 dd mm yyyy convert varchar to datetime in sql server 2012 convert varchar to datetime in sql server 2008 r2 convert varchar to datetime in sql server stored procedure cast string to datetime in sql server 2008 sql server string to datetime conversion sql server interview questions and answers pdf sql server query interview questions sql server interview questions and answers for freshers sql server interview questions by shivprasad koirala sql server interview questions and answers for experienced with examples sql server dba interview questions sql server interview questions for experienced professionals sql interview questions for freshers sql server interview questions and answers for experienced pdf sql server query interview questions sql server dba interview questions sql server interview questions and answers for freshers sql server interview questions and answers for experienced with examples sql server interview questions by shivprasad koirala sql server interview questions for experienced professionals sql interview questions for freshers sql server tutorial pdf sql server tutorial for beginners sql server tutorial point sql server tutorial video sql server tutorial youtube sql server stored procedure tutorial sql server tutorial for experienced sql server 2008 r2 tutorial for beginners
Views: 13030 Ranga Rajesh Kumar
How to Display Data from MySQL Database into HTML Table using PHP
 
03:11
Do you want to learn, How to show data from MySQL database on HTML Table using PHP under 4 minutes? In this video, you will learn which query is used to extract data from a database. Make a connection between HTML Table and MySQL database using PHP. And also about some CSS to make HTML Table looks better. Source Code: http://bit.ly/2Q81lYo Video with database: https://youtu.be/8G7271LAyHY HTML Table Tutorial: https://youtu.be/LIjdXgfC5zM Twitter : https://twitter.com/CodeAndCoins Google+ : https://goo.gl/7vjhrp Blog : https://CodeAndCoins.blogspot.com Share this Video and Subscribe to my channel #CodeAndCoins
Views: 94938 Code And Coins
SheetJS Tutorial - Convert HTML Table to Excel
 
03:15
How to export HTML table to excel file using SheetJS. This tutorial uses only javascript and no server side script is needed. Moreover, users can download the xlsx file from browser using Filesaver.js with correct excel content type (no warning popup when open) Example Code: https://redstapler.co/sheetjs-tutorial-html-table-to-excel/ SheetJS: https://github.com/SheetJS/js-xlsx FileSaver.js: https://github.com/eligrey/FileSaver.js
Views: 8548 Red Stapler
How to convert a String to a DateTime in C# NET 2012
 
04:12
convert a String to a DateTime.
Views: 5986 Mr Code Monster
Exercise 4-2 Converting A Date Format
 
02:31
Microsoft SQL Server 2005 Implementation and Maintenance
Views: 2576 idahotechy
MSSQL - How to create Regions  NET Style in MS SQL in few seconds
 
00:47
Very simple example that shows how to create #Regions in TSQL, for instance inside stored procedure More info; http://howtodomssqlcsharpexcelaccess.blogspot.ca/2015/05/ms-sql-how-to-create-regions.html
Views: 108 Vis Dotnet
convert mssql to sqlite
 
00:53
SQL Converter is a simple application to migrate the database structure from MS SQL Server to SQLite. The program can be downloaded from: https://drive.google.com/file/d/1asG_hAqxrFrBPyMmWifmKz8tt7PZlF_1/view?usp=sharing
Views: 6145 Free Magnetic
Convert JSON object to string
 
07:47
Link for all dot net and sql server video tutorial playlists https://www.youtube.com/user/kudvenkat/playlists?sort=dd&view=1 Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2015/04/convert-json-object-to-string.html In this video we will discuss 1. How to convert JSON object to string 2. How to convert string to JSON object This is continuation Part 18. Please watch Part 18 from jQuery tutorial before proceeding. Replace < with LESSTHAN symbol and > with GREATERTHAN symbol The following example converts JSON array to a string. JSON.stringify() method converts a JSON object (or array) into a string. <html> <head> <title></title> <script src="jquery-1.11.2.js"></script> <script type="text/javascript"> $(document).ready(function () { var employeesJSON = [ { "firstName": "Todd", "lastName": "Grover", "gender": "Male", "salary": 50000 }, { "firstName": "Sara", "lastName": "Baker", "gender": "Female", "salary": 40000 } ]; var JSONString = JSON.stringify(employeesJSON); $('#resultDiv').html(JSONString); }); </script> </head> <body style="font-family:Arial"> <div id="resultDiv"></div> </body> </html> Output : [{"firstName":"Todd","lastName":"Grover","gender":"Male","salary":50000}, {"firstName":"Sara","lastName":"Baker","gender":"Female","salary":40000}] The following example converts a string to a JSON array. JSON.parse() method converts a JSON string to JSON array. We then use the jQuery each() method to loop thru each employee JSON object and retrieve the respective property values. <html> <head> <title></title> <script src="jquery-1.11.2.js"></script> <script type="text/javascript"> $(document).ready(function () { var JSONString = '[{ "firstName": "Todd", "lastName": "Grover", "gender": "Male", "salary": 50000 }, { "firstName": "Sara", "lastName": "Baker", "gender": "Female", "salary": 40000 }]'; var employeesJSON = JSON.parse(JSONString); var result = ''; $.each(employeesJSON, function (i, item) { result += 'First Name = ' + item.firstName + '<br/>'; result += 'Last Name = ' + item.lastName + '<br/>'; result += 'Gender = ' + item.gender + '<br/>'; result += 'Salary = ' + item.salary + '<br/><br/>'; }); $('#resultDiv').html(result); }); </script> </head> <body style="font-family:Arial"> <div id="resultDiv"></div> </body> </html>
Views: 104795 kudvenkat
Best Way to Write Basic SQL Queries
 
13:33
SQL Server Query writing strategies is something I have yet to find in any book. When enthusiastic SQL students do this, they experience a revelation. The number of errors drops significantly and the speed at writing complex queries increases immediately. Knowing how to narrow down what we are looking for amongst a vast list of choices helps immensely. Grabbing the right tables first and then the fields second is akin to grabbing the right menu before ordering an item from it. In fact, one student named Tim took this back to his team of SQL developers and they immediately implemented this process. We are all used to following steps. Most of the time, actions are sequential from top to bottom or left to right. Other times we complete things in phases. The two phases we are going to use in this exercise apply to joining tables. This is easy to implement as we only need remember to organize first and clean up second. When visiting a new restaurant, we will ask to see the menu, because we want to see all they have to offer. The odds are that we might be interested in half of the items, but only need a few dishes for our group at the table. Looking at the menu is like starting a query with a ‘SELECT *’ statement. Once we have looked at all the fields, we narrow our choice(s) to only the items we want at the time. Sometimes restaurants have multiple menus. My favorite restaurant has a kids’ menu, an adult menu, a gluten-free menu and a drink menu. These menus were each gathered at our table. Ultimately, in my head, a selection was narrowed to what was needed. Phase I: Organize. When building a new query from many tables, we often find ourselves wondering, “Where do I start?” First, lay the steps out by identifying which tables contain the essential data. Second, get all the table joins working with a basic ‘SELECT *’ statement. Third, add any basic filtering criteria. Phase II: Itemize. Once all joins and criteria, such as SELECT, FROM and WHERE are working, we are ready for Phase II. This entails going back and changing our ‘SELECT *’ to an itemized SELECT field list as the final step. Let’s explore how this two-phase process of Organize and then Itemize can be a big time-saver. We are going to use one of the challenges from the last lab. In Lab 3.2 (Outer Joins), Skill Check 2, we needed to get four fields from two different tables. If we were to list all four desired fields and test one table at time, we will get an error as seen on the right side of the figure below. In the figure below we write a SELECT statement and part of the FROM clause. When completed, the FROM clause will have two tables, but for now we just want to get the Location table working. By using the ‘SELECT *’ strategy, we remove any possible errors from line 1. From there, we can focus on the more complicated logic used for joining tables together. We can add tables one at a time until everything is working. This is the Organize phase. NOTE: SELECT * never results in an Error message stating “invalid column name”, however; a SELECT list with itemized field(s) can have this error. After our query is organized and working, we can go back and itemize the SELECT field list to display only the fields that are necessary. This is done during Phase II (Itemize). The steps for this system are broken down as follows: Since SELECT is always the first statement in a query, it’s natural to want to write the field names before writing the FROM clause. However; we can save time and trouble by using the ‘*’ until the entire query is working properly. When this is complete, it is very easy to itemize the field list, with the confidence of knowing it will not cause any problems. Exercise: Simple membership for a club: Table1 (id_Member,name_Member, email_member, title, age, company) Table2 (id_Club,club_name, club_Location, address) Table3 (id_club, id_member,membership_date) Q1: Show all member names, email, age, and company from Table1 Q2: Show all club name, location, and address data Q3: Show member name, club name, club location (hint: Use joins and all 3 tables) You can find all other classes related to this video here: http://www.joes2pros.com/joes2pros/Course/Introduction_To_Microsoft_SQL_Server Enroll Today & Get the First Month for only $1! Use code: YOUTUBE1
Views: 227576 Joes2Pros SQL Trainings
Oracle SQL Developer: Query Builder Demo
 
08:13
How to build queries with your mouse versus the keyboard. 2018 Update: If you'd like to see how to convert your Oracle style JOINS to ANSI style (in the FROM vs the WHERE clause) see this post https://www.thatjeffsmith.com/archive/2018/10/query-builder-on-inline-views-and-ansi-joins/
Views: 73715 Jeff Smith
Converting strings to numbers in JavaScript
 
17:14
Link for all dot net and sql server video tutorial playlists http://www.youtube.com/user/kudvenkat/playlists Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2014/11/converting-strings-to-numbers-in.html In this video we will discuss different methods that are available in JavaScript to convert strings to numbers. This example allows the user to enter 2 numbers and add them. Along the way we will learn the use of the following functions 1. parseInt() 2. parseFloat() 3. isNan() Here is the HTML for the web form [table style="border:1px solid black; font-family:Arial"] [tr] [td]First Number[/td] [td][asp:TextBox ID="txtFirstNumber" runat="server"][/asp:TextBox][/td] [/tr] [tr] [td]Second Number[/td] [td][asp:TextBox ID="txtSecondNumber" runat="server"][/asp:TextBox][/td] [/tr] [tr] [td]Result[/td] [td][asp:TextBox ID="txtResult" runat="server"][/asp:TextBox][/td] [/tr] [tr] [td] [/td] [td] [input type="button" value="Add" id="btnAdd"/] [/td] [/tr] [/table] Include the following JavaScript in the head section of the web form. [script type="text/javascript"] function addNumbers() { var firstNumber = document.getElementById("txtFirstNumber").value; var secondNumber = document.getElementById("txtSecondNumber").value; document.getElementById("txtResult").value = firstNumber + secondNumber; } [/script] Set the onclick attribute of the Add button to call the addNumbers() function. The HTML for the button should be as shown below. [input type="button" value="Add" id="btnAdd" onclick="addNumbers()" /] Run the application and enter 20 as the first number and 10 as the second number. Click Add buton. Notice that JavaScript concatenates the numbers instead of adding them. This is because the value property of the textbox is returning the number in a string format. So we need to explicitly do the conversion. This is when parseInt() function is useful. Modify the addNumbers() JavaScript function as shown below. function addNumbers() { var firstNumber = parseInt(document.getElementById("txtFirstNumber").value); var secondNumber = parseInt(document.getElementById("txtSecondNumber").value); document.getElementById("txtResult").value = firstNumber + secondNumber; } Run the application and test. Notice that we now get 30 as expected. Let's do another test. Enter 20.5 as the first number and 10.3 as the second number. Click the Add button. Notice that the decimal part is ignored. To retain the decimal places, use parseFloat() function. function addNumbers() { var firstNumber = parseFloat(document.getElementById("txtFirstNumber").value); var secondNumber = parseFloat(document.getElementById("txtSecondNumber").value); document.getElementById("txtResult").value = firstNumber + secondNumber; } If you leave first number and second number textboxes blank or if you enter text instead of a number, and when you click the Add button, NaN is displayed in result textbox. NaN in JavaScript stands for Not-a-Number. In JavaScript we have isNaN() function which determines whether a value is an illegal number. This function returns true if the value is not a number, and false if not. Modify the addNumbers() JavaScript function as shown below. function addNumbers() { var firstNumber = parseFloat(document.getElementById("txtFirstNumber").value); if (isNaN(firstNumber)) { alert("Please enter a valid number in the first number textbox"); return; } var secondNumber = parseFloat(document.getElementById("txtSecondNumber").value); if (isNaN(secondNumber)) { alert("Please enter a valid number in the second number textbox"); return; } document.getElementById("txtResult").value = firstNumber + secondNumber; } Now, when you leave first number and second number textboxes blank or if you enter text instead of a number, and when you click the Add button, you get relevant validation error messages as expected. Let's make the validation error message a little more relevant: If the first number and second number textboxes are left blank, then we want to display the following validation messages a) First Number is required b) Second Number is required If you enter text instead of number a) Please enter a valid number in the first number textbox b) Please enter a valid number in the second number textbox
Views: 117698 kudvenkat
Convert Getdate Part 2a
 
10:58
SELECT CONVERT (time, SYSDATETIME()) ,CONVERT (time, SYSDATETIMEOFFSET()) ,CONVERT (time, SYSUTCDATETIME()) ,CONVERT (time, CURRENT_TIMESTAMP ()) , CONVERT (time, GETDATE ()) ,CONVERT (time, GETUTCDATE());
Views: 22 WORLD COUTOUR
Code completion, formatting, and refactoring with SQL Prompt
 
04:15
SQL Prompt is a code completion, code formatting, and refactoring tool for SQL Server. It’ll plug into SQL Server Management Studio or Visual Studio. You’ll find you can work more quickly and accurately with SQL queries, as well as standardize across your team by sharing formatting styles and commonly used SQL snippets. Try it free for 28 days at www.red-gate.com/sqlprompt Transcript: Introduction: SQL Prompt is a code completion, code formatting, and refactoring tool for SQL Server. It’ll plug into SQL Server Management Studio or Visual Studio. You can rely on SQL Prompt for speed and accuracy, and save yourself time writing and exploring SQL, so you can focus on the important stuff. We’ve found it can speed up SQL coding by 52%. SQL Prompt has a host of features you’ll find useful everyday – from customizable snippets for the code you use most, which you can share with your team, to tab coloring, so you don’t execute code in the wrong environment. You can work super-fast with data from the Results grid – exporting them straight to Excel, or even scripting them out as an INSERT statement. Let’s jump into SQL Prompt and see these features in action. Code completion: By simply typing J, SQL Prompt autocompletes JOIN, gives you table suggestions, and JOIN conditions, so you don’t have to memorize column names or aliases. We’ve got a SELECT * here: SQL Prompt expands the wildcard so you can keep just the columns you need. Or, use the Column Picker, and hit Tab. These tooltips give you hints about keyboard shortcuts too. We’re using an alias here. SQL Prompt lets you easily rename an alias or variable – it’ll rename every alias in the script, which is great if you’re doing a bit of refactoring. Just right click, or hit F2. Hit Shift+F5 and SQL Prompt will execute just the statement under your cursor. And that tip about working with data in the Results grid? Just right click here, and choose to Export to Excel, copy as an IN clause, or script as an INSERT statement. Code formatting: Here’s how to format your code to your preferred style. Say you’ve got an organizational standard, but you want to code in your own style first. Go to Options, and under Format you’ll find a variety of settings including casing and commas. See the changes in the sample window, and save or export your settings to share with your colleagues. In the query window, just hit CTRL+K+Y to format your code. We’ve got new formatting options coming soon, too, so keep an eye out! Code snippets: Another handy feature in SQL Prompt is snippets, which save you time with repeat blocks of code. Type SSF then hit Tab and you’ll see SQL Prompt inserts SELECT * FROM. This is just one of many built-in snippets. You can easily customize these or create your own. Open the Snippet Manager and click New. Give your snippet a name, insert your code, and save. Now it’s ready for you to use. Or, you can access snippets from the Actions List, as well as comment out code, or surround it with a function like BEGIN/END. Code refactoring: If you’re refactoring code, SmartRename will help you out – it’ll catch every reference for you, so nothing breaks. This is built on Redgate SQL Compare, the industry’s most trusted comparison tool, so you’re in safe hands. From here, you can view actions, warnings, and dependencies. Other time savers: Here’s a little life saver for you – say you write a DELETE statement without a WHERE clause, SQL Prompt will ask you if you really want to execute it. Not only that, but you can specify colours for each environment, so it’s easy to see if you’re connected to development or production. Notice the green tab? That’s the color we’ve picked for development. This bright red one tells us we’re in production. You can set the colours at the database or server level. While we’re looking at tabs, check out Tab History. If SQL Server Management Studio crashes, SQL Prompt will reopen all your tabs the next time you launch SSMS. Or say you get distracted and close a tab without thinking, you can explore and reopen closed tabs. Summary: Alongside all this, we’re regularly adding new features and improvements based on the top suggestions from our users. To see how SQL Prompt can make you more productive and save you from some nasty errors, try it free at www.red-gate.com/sqlprompt
Views: 13301 Redgate Videos
MSSQL -  how to return only date from sql server DateTime datatype
 
00:13
Convert datetime to date in SQL Server More info https://howtodomssqlcsharpexcelaccess.blogspot.com/2018/11/mssql-how-to-return-only-date-from-sql.html
Views: 22 Vis Dotnet
Top 10 ShortCut Keys For MsSql Server 2008 2010 2012 2014 2016
 
13:05
In this session you will find top 10 important MsSql server keys.Which every developer should have to know.These shortcut key/Commands basically supported by MsSql Server 2008,2010 2012,2014,2016.If .net developer or MsSql developer want to improve his working style or working time with MsSql Server.Then have to use those command/Shortcut keys in real life.So find those all commands for in my description below tag. Ctrl+N - Open a new Query Window with current connection (Ctrl + N) Ctrl + Tab - Toggle between opened tabs Ctrl + R - Show/Hide Results pane Ctrl + E - Execute highlighted query Alt + Break or Alt + Scroll Lock: Cancel the executing query (Ctrl + Shift + U, Ctrl + Shift + L): Make selected text uppercase or lowercase (Ctrl + L): Display estimated execution plan (Ctrl + M) : Include actual execution plan (Ctrl + Space, Tab): Intellisense list member and complete word (Ctrl + G) : Go to line (Ctrl + K & Ctrl + C; Ctrl + K & Ctrl + U) : Comment and uncomment lines of code (Ctrl+Shift+N) : Display the New Project dialog box to create a new project (Ctrl+O)/(Ctrl+Shift+G) : Display the Open File dialog box to open an existing file (Shift+Alt+Enter) : Toggle full screen mode Shift+Esc : Close the current tool window F8: Disaply Object explorer F7 : Display the Summary Window F4 : Display the Properties Window F9: For BreakPoints BreakPoints F10: Step Over In Break Point or just go for another breakpoint F11: Step In the code or lines
Model Your Relational Database Data as NoSQL Document Data
 
11:06
Learn how to model your relational database (RDBMS) data as NoSQL document data. Relational databases include, but are not limited to, MySQL, Oracle, and SQL Server. The document data being stored is complex JSON format. This is useful if you're coming from relational database experience and want to learn NoSQL. Data in this example is queried using Couchbase and its N1QL technology which allows you to use SQL queries.
Views: 27193 Nic Raboy
Convert DateTime Format to Other Date Format in ASP NET
 
06:11
In this video i'm going to show you how to convert DateTime Format to Other Format
Views: 5317 NET Code Snippet
converting data types from numeric to character and vise versa
 
02:36
Quick tutorial on converting data types. email: [email protected]
Views: 7982 Long Beach
Convert A Column Of Data Into Comma Separated Values
 
03:59
This is the video about how to get the comma separated values in the microsoft excel please subscribe to youtube.com/svcreativity Keywrods: pl sql comma separated list,how to insert comma separated values in sql table,sql query comma separated values,how to get values separated by comma in sql,sql comma delimited string to rows,sql rows to comma delimited string,separated translate,using comma in a list,how to add commas to a list,convert space delimited to comma delimited,insert comma separated values in sql server,how to insert comma separated values in sql,convert csv to list,delimiter separated values,separate csv into columns,how to separate comma separated values in sql,comma separate,comma seperated list,file delimiter,convert text to column,comma delineated,comma in lists,coma separated,convert csv to columns,comma separated values example,how to get comma separated values in sql server,comma delimited sql,convert list to csv,split comma separated values in sql,column delimiter,text delimiter,column to text,comma seperated,parse comma delimited string sql,list separated by semicolons,how to get comma separated values in sql server 2008,sql convert rows to columns,comma in a list,text delimited,convert text to columns,sql server delimited string,convert csv to text comma delimited,get comma separated values in sql server,csv comma,separated by a comma,delimited text,numbers separated by commas,comma delimited list sql,convert csv to comma delimited text file,comma in list,comma separated variable,list comma,sql server comma separated list to table,sql delimited string,comma id,comma separation,csv delimiter,comma delimited text file,text names,comma separated file,sql comma,comma separated values in sql server 2008,comma separator,delimited text file,text to column,comma delimited list,comma list,csv number,csv separator,delimited file,delimited list,sql concatenate rows,from to comma,csv comma delimited,convert column to comma separated list,tsql coalesce,separate with comma,convert txt to xls,comma delimited,comma delimited file,comma separated value,list to comma separated string,comma separated list,convert comma separated string to list,csv file,comma separated,comma separated values,convert a column of data into comma separated values
Views: 2775 SV Creativity
Binary to hexadecimal conversion
 
01:32
Hello guys! Converting Binary numbers may be difficult if not understood properly. Here's how you can effectively convert those rigid 0&1. Don't wait to steal my tip and grab your grades. You can get more such useful tips to score. Do subscribe🤗 Good luck!
Views: 23 Sonu Bhavsar
MSSQL EXPLOITING WEAK PASSWORDS to GAIN METERPRETER SHELL PART 1
 
03:03
This First Part of 2 Videos Show how we can see MS SQL Server 2008 R2 with Remote Access switched on, on Port 1433 (Default Port). Now we can see there is an open MS SQL Server running an opened it is highly likely that the password configured for the SQL Server is a very weak Password. This is because the passwords for the Databases are configured by the Developer usually and not by the Security Consultant or System/Network Administrators. Therefore we can brute force the password in a few minutes, hours or days depending on the processing power. With the Password found in Part 2 we move onto using a reverse TCP Payload and spawn a Meterpreter Shell. This site is designed for Pentesters for Proof of Concept style testing to enhance their security methodology. It is purely for educational purposes and I do not condone or recommend attempting any of the techniques in any of these videos on any network or part of any network you do not have 100% consent to do so on. I hold no responsibility for any loss of service, corruption or loss of data due to taking any of the following the steps in any tutorials from this site. This site has been created for educational purposes to explain techniques for enthusiastic network engineers and security experts to helping understanding how to improve their security and stop unauthorized access.
Views: 1314 Metasploitation
SQL Prompt - actions list
 
00:59
SQL Prompt is a code completion, code formatting, and refactoring tool for SQL Server. It’ll plug into SQL Server Management Studio or Visual Studio. You’ll find you can work more quickly and accurately with SQL queries, as well as standardize across your team by sharing formatting styles and commonly used SQL snippets. Try it free for 28 days at www.red-gate.com/sqlprompt In this tip Redgate product marketing manager Carly Meichen explains how to quickly jump to some really handy SQL Prompt actions in the query window. This means you can unformat code, for example, in just a few keystrokes. For more tips for writing SQL effortlessly check out the #SuperSQLTips playlist: https://www.youtube.com/playlist?list=PLhFdCK734P8A_q6XHDXi4CQzys3R0Jw3X Transcript: Hi I’m Carly Meichen and I’m part of the SQL Prompt team here at Redgate. When writing SQL, you can use SQL Prompt to quickly jump to some really handy actions. For example, say you’re copying a list of items from Excel, you can save yourself time manually adding quotes and commas, by selecting the block of text, hit CTRL to bring up the Actions List, and select ‘Add quotes & commas’. Or perhaps you have an application that uses the SQL via external files where the formatting won’t work. Save yourself from manually removing the formatting, and instead highlight the block of text, hit CTRL and select ‘Unformat’. It’ll remove any formatting, compacting the script as much as possible. Another timesaving tip from SQL Prompt for you. Try it free, or get the latest update, and give it a go for yourself.
Views: 2422 Redgate Videos
MSSQL ile veritabanı oluşturma
 
07:13
MSSQL ile veritabanı oluşturma www.csharptr.com
Views: 7859 Mertcan Kurtaran
SQL Prompt Pro in Visual Studio - using placeholders
 
01:39
SQL Prompt Pro is a code completion, code formatting, and refactoring tool for SQL Server. It’ll plug into SQL Server Management Studio or Visual Studio. You’ll find you can work more quickly and accurately with SQL queries, as well as standardize across your team by sharing formatting styles and commonly used SQL snippets. Try it free for 28 days at www.red-gate.com/sqlprompt In this tip Data Platform MVP Steve Jones explains how to use SQL Prompt in Visual Studio, to write SQL quickly and accurately with the help of code snippets and placeholders. For more tips for writing SQL effortlessly check out the #SuperSQLTips playlist: https://www.youtube.com/playlist?list=PLhFdCK734P8A_q6XHDXi4CQzys3R0Jw3X
Views: 1142 Redgate Videos
Using XSLT to Transform Your XML
 
18:19
This is a short presentation introducing XSLT and showing how it can be used to transform the data in an XML file into a different format including web pages. This is part of my online course, Web Services offered by Computer Careers at South Central College in North Mankato, MN 56003 USA. http://cc.southcentral.edu Created by Peter K. Johnson - Web Explorations http://WebExplorations.com
Views: 192393 Peter WebExplorations
MSSQL - Get database name by database id
 
00:45
More Info http://howtodomssqlcsharpexcelaccess.blogspot.ca/2017/02/mssql-get-database-name-by-database-id.html
Views: 317 Vis Dotnet
Export gridview to excel in asp.net - Part 57
 
17:41
The HTML and the code used in the demo, can be found at the link below. http://csharp-video-tutorials.blogspot.com/2013/04/export-gridview-to-excel-in-aspnet-part.html Link for csharp, asp.net, ado.net, dotnet basics and sql server video tutorial playlists http://www.youtube.com/user/kudvenkat/playlists In this video, we will discuss about exporting gridview data to excel. Step 1: Create an asp.net web application project. Step 2: Drag and drop a gridview control and a button control on webform1.aspx. Autoformat the gridview control to use "BrownSugar" scheme. Set the following properties of the button control. ID="btnExportToExcel" Text="Export to excel" OnClick="btnExportToExcel_Click" Step 3: Copy and paste the following code in webform1.aspx.cs. The code is well commented and is self-explanatory. protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { BindData(); } } private void BindData() { string CS = ConfigurationManager.ConnectionStrings["DBCS"].ConnectionString; using (SqlConnection con = new SqlConnection(CS)) { SqlDataAdapter da = new SqlDataAdapter("Select * from tblEmployee", con); DataSet ds = new DataSet(); da.Fill(ds); GridView1.DataSource = ds; GridView1.DataBind(); } } protected void btnExportToExcel_Click(object sender, EventArgs e) { // Clear all content output from the buffer stream Response.ClearContent(); // Specify the default file name using "content-disposition" RESPONSE header Response.AppendHeader("content-disposition", "attachment; filename=Employees.xls"); // Set excel as the HTTP MIME type Response.ContentType = "application/excel"; // Create an instance of stringWriter for writing information to a string System.IO.StringWriter stringWriter = new System.IO.StringWriter(); // Create an instance of HtmlTextWriter class for writing markup // characters and text to an ASP.NET server control output stream HtmlTextWriter htw = new HtmlTextWriter(stringWriter); // Set white color as the background color for gridview header row GridView1.HeaderRow.Style.Add("background-color", "#FFFFFF"); // Set background color of each cell of GridView1 header row foreach (TableCell tableCell in GridView1.HeaderRow.Cells) { tableCell.Style["background-color"] = "#A55129"; } // Set background color of each cell of each data row of GridView1 foreach (GridViewRow gridViewRow in GridView1.Rows) { gridViewRow.BackColor = System.Drawing.Color.White; foreach (TableCell gridViewRowTableCell in gridViewRow.Cells) { gridViewRowTableCell.Style["background-color"] = "#FFF7E7"; } } GridView1.RenderControl(htw); Response.Write(stringWriter.ToString()); Response.End(); } Step 4: Run the application and click on "Export to excel" button. You will get an error stating - Control 'GridView1' of type 'GridView' must be placed inside a form tag with runat=server. This is because, we are calling GridView1.RenderControl(htmlTextWriter) method. This causes .net to think that a Server-Control is being rendered outside of a Form. To fix this error, we need to override VerifyRenderingInServerForm() method. Copy and paste the following method in webform1.aspx.cs. public override void VerifyRenderingInServerForm(Control control) { } At this point, run the application and click on "Export to excel button. The data gets exported to excel as expected. However, when you try to open the file you will get a warning message stating - The file you are trying to open, 'Employee.xls', is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now? According to MSDN - The warning message is a user-notification function that was added to Excel 2007. The warning message can help prevent unexpected problems that might occur because of possible incompatibility between the actual content of the file and the file name extension. One way to resolve this error, is to edit the registry. Microsoft knowledge base article related to this error http://support.microsoft.com/kb/948615 If you want to export the same data to microsoft word, there are only 2 changes that you need to do. First Change: Change the file extension to ".doc" instead of ".xls" Response.AppendHeader("content-disposition", "attachment; filename=Employees.doc"); Second Change: Set the content type to word Response.ContentType = "application/word";
Views: 53343 kudvenkat
Creating HTML Reports with PowerShell
 
47:46
My presentation for the SQL Pass Virtual PowerShell group on creating styling HTML based reports with Windows PowerShell. Recorded July 17, 2013. Updated demos can be downloaded from http://jdhitsolutions.com/blog/powershell/3361/creating-styling-html-reports-with-powershell/
Views: 26288 Jeffery Hicks
Conversion Functions and Conditional Expressions - Oracle SQL*Plus
 
12:06
- TO_CHAR and TO_DATE functions - Conditional expressions such as DECODE and CASE.
Views: 142 MrFphunter
SQL Tutorial -   Rounding numbers
 
01:15
SQL Tutorial - Rounding numbers
Views: 110 Tutorials Spot
MSSQL - Assign result of dynamic sql to a variable
 
02:17
More info https://howtodomssqlcsharpexcelaccess.blogspot.com/2018/11/mssql-assign-result-of-dynamic-sql-to.html
Views: 9 Vis Dotnet
MSSQL EXPLOITING WEAK PASSWORDS to GAIN METERPRETER SHELL PART 2
 
01:06
Here in Part 2 we use the Password we Brute Forced in theory from Part 1 and Gain Access to a metepreter shell using a reverse TCP Payload. As mentioned in the previous video, Developers usually leave weak passwords when configuring MSSQL Servers and therefore they are easily brute forced. Most don't realize the implications we can see form this video. This site is designed for Pentesters for Proof of Concept style testing to enhance their security methodology. It is purely for educational purposes and I do not condone or recommend attempting any of the techniques in any of these videos on any network or part of any network you do not have 100% consent to do so on. I hold no responsibility for any loss of service, corruption or loss of data due to taking any of the following the steps in any tutorials from this site. This site has been created for educational purposes to explain techniques for enthusiastic network engineers and security experts to helping understanding how to improve their security and stop unauthorized access.
Views: 572 Metasploitation
SQLServer on Mac Using Docker
 
08:32
This screencast demonstrates how to run a Microsoft SQLServer database inside of a Docker container on a Mac. Two techniques are demonstrated. "Docker for Mac" runs Docker natively on a Mac. Older versions of Mac use Docker Toolbox in which Docker is supported using an intermediate VirtualBox VM where Docker runs.
Views: 26665 C S
using dbtranslator convert oracle plsql outer join+ to MYSQL
 
02:00
oracle style outer join (+) to MYSQL conversion ,dbtranslatorc.om
Views: 9 zeradata sale
TSQL: Using A SELECT To Calculate Rates
 
08:06
Sponsored post: https://www.fintekdev.com/tsql-rate-calculation/ Previous video that uses a function to calculate rates: http://www.youtube.com/watch?v=YzB46p8shZE
Views: 62 SQLInSix Minutes