Abundant Code

  • C#
  • C++
  • Elastic Search
  • Entity Framework
  • F#
  • JavaScript
  • ASP.NET
  • C
  • Java
  • SQL Server
  • Assembly Lang
Home ยป SQL Server

Checking the version of a SQL Server using T-SQL

September 16, 2016 by AbundantCode Leave a Comment

There are couple of ways in which you can retreive the version of the SQL Server using T-SQL. Checking the version of a SQL Server using T-SQL 1. using @@VERSION 2. Using SERVERPROPERTY function as shown

Filed Under: SQL Server Tagged With: database, How to, SQL Server, tips, tricks

How to get the first character of a string in SQL Server ?

September 16, 2016 by AbundantCode Leave a Comment

Assume a scenario where you have a column in your table in SQL Server database where you want to retreive the first character of the column value. How to get the first character of a string in SQL Server ? You can use the LEFT function and specify the column name as well as the […]

Filed Under: SQL Server Tagged With: database, How to, SQL Server, tips, tricks

How to change the ‘Edit Top 200 Rows’ in SQL Management Studio ?

September 15, 2016 by AbundantCode Leave a Comment

When working with the SQL Server Management Studio and trying to edit the table records , you would have noticed the context menu option “Edit Top 200 Rows”. How do you change this to display all the records for editing instead of “Edit top 200 rows” in the context menu ? There are couple of […]

Filed Under: SQL Server Tagged With: database, How to, SQL Server, tips, tricks

How to Check if a login exists in SQL Server ?

September 14, 2016 by AbundantCode Leave a Comment

If you need to check if a login exists in SQL Server , you can use query the master.dbo.syslogins for it. How to Check if a login exists in SQL Server ? Here’s a sample query demonstrating how you can query master.dbo.syslogins to find out if the login exists in SQL Server. This would retreive […]

Filed Under: SQL Server Tagged With: database, How to, SQL Server, tips, tricks

What is the equivalent of MySQL’s Now() function in SQL Server ?

September 14, 2016 by AbundantCode Leave a Comment

MySQL has the function Now() which is a Datetime type field which shows the current date as well as the time. What is the equivalent of MySQL’s Now() function in SQL Server ? In SQL Server , you can use the GetDate() function to achieve the same.

Filed Under: SQL Server Tagged With: database, How to, SQL Server, tips, tricks

How to get the first day of the month in SQL Server ?

September 7, 2016 by AbundantCode Leave a Comment

If you want to get the first day of the month of a input datetime variable from a SQL Query , here’s how you do it.

Filed Under: SQL Server Tagged With: database, How to, SQL Server, tips, tricks

Get the date in YYYY-MM-DD format in SQL Server.

September 7, 2016 by AbundantCode Leave a Comment

You can retreive the date in the YYYY-MM-DD format in SQL Server using the CONVERT method as shown in this code snippet. How to get the date in YYYY-MM-DD format in SQL Server ?

Filed Under: SQL Server Tagged With: database, How to, SQL Server, tips, tricks

SQL Server – Saving changes is not permitted. The changes you have made require the following tables to be dropped and re-created.

September 7, 2016 by AbundantCode Leave a Comment

There are times when you get an error stating “Saving changes is not permitted. The changes you have made require the following tables to be dropped and re-created. You have either made changes to a table that can’t be re-created or enabled the option Prevent saving changes that require the table to be re-created.” You […]

Filed Under: SQL Server Tagged With: database, How to, SQL Server, tips, tricks

How do you check if an index exists in a table?

September 6, 2016 by AbundantCode Leave a Comment

You can find out if the index exists for a table by querying the sys.indexes table as shown in this blog post’s code sample. How do you check if an index exists in a table? This will list out all the indexes of the table.

Filed Under: SQL Server Tagged With: database, How to, SQL Server, tips, tricks

How to select N random rows using a T-SQL Query ?

September 4, 2016 by AbundantCode Leave a Comment

You can use the TOP keyword and specify the number to retreive the TOP N records that the query returns. Additionally , order the records by newid() function using the ORDER BY clause to make the records random. How to select N random rows using a T-SQL Query ?

Filed Under: SQL Server Tagged With: database, How to, SQL Server, tips, tricks

  • 1
  • 2
  • 3
  • …
  • 7
  • Next Page »
RSS
Facebook
fb-share-icon
Twitter
Visit Us
Follow Me
Tweet

Recent Posts

  • Collapsible links for subcategories in Docusaurus Sidebar
  • Python Program to Print Fibonacci Series
  • Python Program to Generate Multiplication Table
  • Python Program to Find the Factorial of a Number
  • Python Program to Print Prime Numbers in a Given Interval

Categories

Tags

.NET App Array ASP.NET ASP.NET MVC Assembly Language C# C# programs c lab programs Collection convert C program csharp database Example F# guide How to How to in Java integer Java Javascript Lab programs Lambda LINQ List Python lab programs Python programs SIC/XE SQL Server string tips tricks tutorial tutorials UWP visual studio 2015 Windows Windows 8 Windows 10 Windows Phone Windows Phone 8 Windows Phone 8.1 wp8 XAML

Blog Stats

  • 8,730,872 hits

Archives

Top Posts & Pages

  • C Program to Multiply Two Matrices Using Multi-dimensional Arrays
  • How to open display settings from command line in Windows 10 ?
  • C Program to display half-pyramid using alphabets
  • How to Extract number from a string using C# ?
  • How to Convert a Stream to Byte Array in C# 4.0 ?
  • How to clean up unused PowerPoint master slides in PowerPoint?
  • How to retrieve the URL of the current Page in ASP.NET MVC 4 Controller ?
  • How to get the Relative Server Path in ASP.NET Web API ?
  • Json.NET & VB.NET - How to Serialize an Object ?
  • How to compare two Byte Arrays in C#?

Categories

  • Android
  • Angular 2
  • ASP.NET
  • Assembly Language
  • C
  • C#
  • C++
  • Elastic Search
  • Entity Framework
  • Excel
  • F#
  • HTML
  • Interview Questions
  • Java
  • JavaScript
  • jQuery
  • Microsoft Office
  • MySQL
  • NETWORK
  • News
  • PHP
  • popular
  • PowerShell
  • Python
  • Ruby
  • SharePoint
  • SQL Server
  • SQL Server
  • Unix
  • VB.NET
  • Visual Studio
  • WebAPI
  • Windows
  • Windows Azure
  • Windows Forms
  • XAML

Top Posts & Pages

  • C Program to Multiply Two Matrices Using Multi-dimensional Arrays
  • How to open display settings from command line in Windows 10 ?
  • C Program to display half-pyramid using alphabets
  • How to Extract number from a string using C# ?
  • How to Convert a Stream to Byte Array in C# 4.0 ?
  • How to clean up unused PowerPoint master slides in PowerPoint?
  • How to retrieve the URL of the current Page in ASP.NET MVC 4 Controller ?
  • How to get the Relative Server Path in ASP.NET Web API ?
  • Json.NET & VB.NET - How to Serialize an Object ?
  • How to compare two Byte Arrays in C#?

Recent Posts

  • Collapsible links for subcategories in Docusaurus Sidebar
  • Python Program to Print Fibonacci Series
  • Python Program to Generate Multiplication Table
  • Python Program to Find the Factorial of a Number
  • Python Program to Print Prime Numbers in a Given Interval
  • Python Program to Check Prime Number
  • Python Program to Find the Largest Value Among Three Numbers
  • Python Program to Check If a Given Year is Leap Year
  • Python Program to Check if a Number is Odd or Even
  • Python Program to Check if a Number is Positive, Negative or Zero

Tags

.NET App Array ASP.NET ASP.NET MVC Assembly Language C# C# programs c lab programs Collection convert C program csharp database Example F# guide How to How to in Java integer Java Javascript Lab programs Lambda LINQ List Python lab programs Python programs SIC/XE SQL Server string tips tricks tutorial tutorials UWP visual studio 2015 Windows Windows 8 Windows 10 Windows Phone Windows Phone 8 Windows Phone 8.1 wp8 XAML