Showing posts with label SQL. Show all posts
Showing posts with label SQL. Show all posts

Monday, 16 April 2018

SQL Server 2012 64 Bit installation issues

I was installing SQL server 2012 and I have to say it is not at all easy task. I got below issues and solutions:

Issue 1 - Not able to complete installation if you have visual studio 2012 / 2013 installed before.
Solution - make sure you install SQL server 2012 before installation of visual studio 2012 / 2013.
https://stackoverflow.com/questions/14162947/using-ssis-bids-with-visual-studio-2012-2013

If you have installed visual studio, the simplest way is go for SQL server 2014.


Issue 2 - No separate SQL server management studio installation.
Solution - You need to start installation again and run installation again.

Some blog will tell you to go with add feature in installation. but you need to go new installation if you are go with 64 bit.
https://stackoverflow.com/questions/11276167/how-to-install-sql-server-management-studio-2012-ssms-express

Thursday, 17 December 2015

How to find the SQL Instance edition ?

Q: How to find the SQL Instance edition ?

Ans: First I thought, its Microsoft. Go to help menu and click on About. It will give you the edition you have installed. But the answer is no. This time it displayed numbers and something which was little bit hard to understand.

So what we do? google it.

And first you find links of Microsoft which is confusing to people like me. So here is the solution.

Follow below steps :

  1. Open you SQL server and connect your database.
  2. Open (Ctrl + n) new querywindow for master database.
  3. And write below query to get understandable answer:
SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY('productlevel'), SERVERPROPERTY('edition')

Note: Above query works for SQL Server 2000 and above 

In other scenario you can use

SELECT @@VERSION
Output will be like :
       Microsoft SQL Server 2012 (SP1) - 11.0.3401.0 (X64) 

Jan  9 2014 13:22:15 

Copyright (c) Microsoft Corporation

Standard Edition (64-bit) on Windows NT 6.2 <X64> (Build 9200: ) (Hypervisor)

Original Source: 

http://stackoverflow.com/questions/59444/how-do-you-check-what-version-of-sql-server-for-a-database-using-tsql

Thursday, 8 October 2015

Country Table SQL Script

Recently I was asked to create three tables of country, state and city of world. I thought this data will be useful to every one. Here is my script for Country table. I will add others soon...

CREATE TABLE [dbo].[Country](
[ID] [int] IDENTITY(1,1) NOT NULL,
[CountryName] [nvarchar](100) NOT NULL
) ON [PRIMARY]

GO
SET IDENTITY_INSERT [dbo].[Country] Off 

GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Afghanistan')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Albania')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Algeria')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'American Samoa')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Andorra')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Angola')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Anguilla')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Antarctica')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Antigua And Barbuda')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Argentina')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Armenia')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Aruba')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Australia')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Austria')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Azerbaijan')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Bahamas')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Bahrain')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Bangladesh')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Barbados')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Belarus')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Belgium')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Belize')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Benin')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Bermuda')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Bhutan')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Bolivia')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Bosnia And Herzegowina')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Botswana')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Bouvet Island')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Brazil')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'British Indian Ocean Territory')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Brunei Darussalam')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Bulgaria')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Burkina Faso')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Burundi')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Cambodia')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Cameroon')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Canada')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Cape Verde')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Cayman Islands')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Central African Republic')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Chad')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Chile')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'China')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Christmas Island')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Cocos (Keeling) Islands')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Colombia')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Comoros')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Congo')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Cook Islands')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Costa Rica')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Cote D''Ivoire')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Croatia (Local Name: Hrvatska)')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Cuba')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Cyprus')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Czech Republic')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Denmark')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Djibouti')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Dominica')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Dominican Republic')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'East Timor')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Ecuador')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Egypt')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'El Salvador')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Equatorial Guinea')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Eritrea')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Estonia')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Ethiopia')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Falkland Islands (Malvinas)')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Faroe Islands')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Fiji')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Finland')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'France')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'French Guiana')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'French Polynesia')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'French Southern Territories')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Gabon')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Gambia')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Georgia')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Germany')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Ghana')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Gibraltar')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Greece')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Greenland')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Grenada')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Guadeloupe')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Guam')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Guatemala')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Guinea')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Guinea-Bissau')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Guyana')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Haiti')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Heard And Mc Donald Islands')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Holy See (Vatican City State)')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Honduras')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Hong Kong')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Hungary')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Iceland')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'India')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Indonesia')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Iran (Islamic Republic Of)')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Iraq')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Ireland')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Israel')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Italy')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Jamaica')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Japan')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Jordan')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Kazakhstan')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Kenya')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Kiribati')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Korea, Dem People''S Republic')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Korea, Republic Of')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Kuwait')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Kyrgyzstan')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Lao People''S Dem Republic')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Latvia')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Lebanon')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Lesotho')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Liberia')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Libyan Arab Jamahiriya')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Liechtenstein')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Lithuania')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Luxembourg')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Macau')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Macedonia')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Madagascar')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Malawi')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Malaysia')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Maldives')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Mali')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Malta')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Marshall Islands')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Martinique')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Mauritania')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Mauritius')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Mayotte')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Mexico')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Micronesia, Federated States')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Moldova, Republic Of')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Monaco')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Mongolia')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Montserrat')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Morocco')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Mozambique')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Myanmar')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Namibia')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Nauru')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Nepal')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Netherlands')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Netherlands Ant Illes')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'New Caledonia')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'New Zealand')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Nicaragua')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Niger')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Nigeria')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Niue')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Norfolk Island')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Northern Mariana Islands')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Norway')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Oman')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Pakistan')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Palau')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Panama')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Papua New Guinea')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Paraguay')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Peru')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Philippines')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Pitcairn')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Poland')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Portugal')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Puerto Rico')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Qatar')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Reunion')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Romania')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Russian Federation')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Rwanda')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Saint K Itts And Nevis')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Saint Lucia')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Saint Vincent, The Grenadines')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Samoa')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'San Marino')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Sao Tome And Principe')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Saudi Arabia')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Senegal')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Seychelles')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Sierra Leone')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Singapore')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Slovakia (Slovak Republic)')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Slovenia')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Solomon Islands')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Somalia')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'South Africa')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'South Georgia , S Sandwich Is.')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Spain')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Sri Lanka')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'St. Helena')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'St. Pierre And Miquelon')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Sudan')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Suriname')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Svalbard, Jan Mayen Islands')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Sw Aziland')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Sweden')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Switzerland')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Syrian Arab Republic')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Taiwan')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Tajikistan')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Tanzania, United Republic Of')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Thailand')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Togo')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Tokelau')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Tonga')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Trinidad And Tobago')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Tunisia')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Turkey')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Turkmenistan')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Turks And Caicos Islands')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Tuvalu')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Uganda')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Ukraine')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'United Arab Emirates')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'United Kingdom')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'United States')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'United States Minor Is.')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Uruguay')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Uzbekistan')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Vanuatu')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Venezuela')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Viet Nam')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Virgin Islands (British)')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Virgin Islands (U.S.)')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Wallis And Futuna Islands')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Western Sahara')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Yemen')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Yugoslavia')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Zaire')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Zambia')
GO
INSERT [dbo].[Country] ([CountryName]) VALUES (N'Zimbabwe')
GO
SET IDENTITY_INSERT [dbo].[Country] OFF
GO

Tuesday, 13 January 2015

Seperate comma seperated value and store in temp data table

If you want to seperate values by comma or something here is the solution.


DECLARE @data NVARCHAR(MAX),
@delimiter NVARCHAR(5)
SELECT @data = 'abc-abc-abc'
set @delimiter = '-'
DECLARE @textXML XML;
SELECT @textXML = CAST('<d>' + REPLACE(@data, @delimiter, '</d><d>') + '</d>' AS XML);

declare @temp table (num nvarchar(max))
insert into @temp
SELECT T.split.value('.', 'nvarchar(max)') AS data
FROM @textXML.nodes('/d') T (split)

select * from @temp

Wednesday, 9 April 2014

Hide/Show Result window

I have this question from long time in my mind. Whenever i run query in SQL result window acquire half the space.look at the figure.




 I generally decrease the size of the result window and continue to work on.  Now I get the solution. Just Press Ctrl + R and it hide. press it again and it shows up. I hope this shortcut will be useful to you too.

Tuesday, 8 April 2014

SQL StoreProcedure Change Report Generate

To Create SQL Procedure Change Report

 1. Select your Database Store procedure folder Your database -> Programmability -> Store Procedure 2.In ribbon , View-> Object Explorer Details or press F7 (as Shown in figure) 


That's it. You will See the Report. To check when modification has done Select the Date Last Modified column as shown in fig.

SharePoint Server 2016 and 2019 Retirement: What IT Professionals Need to Know

Microsoft SharePoint Server 2016 and 2019 are reaching end of support on July 14, 2026. With the April 2026 feature retirement deadline now ...