단일값 반환
- 23 : yyyy-mm-dd
- 102 : yyyy.mm.dd
- 111 : yyyy/mm/dd
- 112 : yyyymmdd
- 120 : yyyy-mm-dd hh:mi:ss
- 121 : yyyy-mm-dd hh:mi:ss.mmm
- 예) 오늘(2008년 1월 9일) 기준으로
- SELECT CONVERT(char(10), getdate(), 23)
출처
- 23 : yyyy-mm-dd
- 102 : yyyy.mm.dd
- 111 : yyyy/mm/dd
- 112 : yyyymmdd
- 120 : yyyy-mm-dd hh:mi:ss
- 121 : yyyy-mm-dd hh:mi:ss.mmm
- 예) 오늘(2008년 1월 9일) 기준으로
- SELECT CONVERT(char(10), getdate(), 23)
Index | Name of Time Zone | Time |
000 | Dateline Standard Time | (GMT-12:00) International Date Line West |
001 | Samoa Standard Time | (GMT-11:00) Midway Island, Samoa |
002 | Hawaiian Standard Time | (GMT-10:00) Hawaii |
003 | Alaskan Standard Time | (GMT-09:00) Alaska |
004 | Pacific Standard Time | (GMT-08:00) Pacific Time (US and Canada); Tijuana |
010 | Mountain Standard Time | (GMT-07:00) Mountain Time (US and Canada) |
013 | Mexico Standard Time 2 | (GMT-07:00) Chihuahua, La Paz, Mazatlan |
015 | U.S. Mountain Standard Time | (GMT-07:00) Arizona |
020 | Central Standard Time | (GMT-06:00) Central Time (US and Canada |
025 | Canada Central Standard Time | (GMT-06:00) Saskatchewan |
030 | Mexico Standard Time | (GMT-06:00) Guadalajara, Mexico City, Monterrey |
033 | Central America Standard Time | (GMT-06:00) Central America |
035 | Eastern Standard Time | (GMT-05:00) Eastern Time (US and Canada) |
040 | U.S. Eastern Standard Time | (GMT-05:00) Indiana (East) |
045 | S.A. Pacific Standard Time | (GMT-05:00) Bogota, Lima, Quito |
050 | Atlantic Standard Time | (GMT-04:00) Atlantic Time (Canada) |
055 | S.A. Western Standard Time | (GMT-04:00) Caracas, La Paz |
056 | Pacific S.A. Standard Time | (GMT-04:00) Santiago |
060 | Newfoundland and Labrador Standard Time | (GMT-03:30) Newfoundland and Labrador |
065 | E. South America Standard Time | (GMT-03:00) Brasilia |
070 | S.A. Eastern Standard Time | (GMT-03:00) Buenos Aires, Georgetown |
073 | Greenland Standard Time | (GMT-03:00) Greenland |
075 | Mid-Atlantic Standard Time | (GMT-02:00) Mid-Atlantic |
080 | Azores Standard Time | (GMT-01:00) Azores |
083 | Cape Verde Standard Time | (GMT-01:00) Cape Verde Islands |
085 | GMT Standard Time | (GMT) Greenwich Mean Time: Dublin, Edinburgh, Lisbon, London |
090 | Greenwich Standard Time | (GMT) Casablanca, Monrovia |
095 | Central Europe Standard Time | (GMT+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague |
100 | Central European Standard Time | (GMT+01:00) Sarajevo, Skopje, Warsaw, Zagreb |
105 | Romance Standard Time | (GMT+01:00) Brussels, Copenhagen, Madrid, Paris |
110 | W. Europe Standard Time | (GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna |
113 | W. Central Africa Standard Time | (GMT+01:00) West Central Africa |
115 | E. Europe Standard Time | (GMT+02:00) Bucharest |
120 | Egypt Standard Time | (GMT+02:00) Cairo |
125 | FLE Standard Time | (GMT+02:00) Helsinki, Kiev, Riga, Sofia, Tallinn, Vilnius |
130 | GTB Standard Time | (GMT+02:00) Athens, Istanbul, Minsk |
135 | Israel Standard Time | (GMT+02:00) Jerusalem |
140 | South Africa Standard Time | (GMT+02:00) Harare, Pretoria |
145 | Russian Standard Time | (GMT+03:00) Moscow, St. Petersburg, Volgograd |
150 | Arab Standard Time | (GMT+03:00) Kuwait, Riyadh |
155 | E. Africa Standard Time | (GMT+03:00) Nairobi |
158 | Arabic Standard Time | (GMT+03:00) Baghdad |
160 | Iran Standard Time | (GMT+03:30) Tehran |
165 | Arabian Standard Time | (GMT+04:00) Abu Dhabi, Muscat |
170 | Caucasus Standard Time | (GMT+04:00) Baku, Tbilisi, Yerevan |
175 | Transitional Islamic State of Afghanistan Standard Time | (GMT+04:30) Kabul |
180 | Ekaterinburg Standard Time | (GMT+05:00) Ekaterinburg |
185 | West Asia Standard Time | (GMT+05:00) Islamabad, Karachi, Tashkent |
190 | India Standard Time | (GMT+05:30) Chennai, Kolkata, Mumbai, New Delhi |
193 | Nepal Standard Time | (GMT+05:45) Kathmandu |
195 | Central Asia Standard Time | (GMT+06:00) Astana, Dhaka |
200 | Sri Lanka Standard Time | (GMT+06:00) Sri Jayawardenepura |
201 | N. Central Asia Standard Time | (GMT+06:00) Almaty, Novosibirsk |
203 | Myanmar Standard Time | (GMT+06:30) Yangon Rangoon |
205 | S.E. Asia Standard Time | (GMT+07:00) Bangkok, Hanoi, Jakarta |
207 | North Asia Standard Time | (GMT+07:00) Krasnoyarsk |
210 | China Standard Time | (GMT+08:00) Beijing, Chongqing, Hong Kong SAR, Urumqi |
215 | Singapore Standard Time | (GMT+08:00) Kuala Lumpur, Singapore |
220 | Taipei Standard Time | (GMT+08:00) Taipei |
225 | W. Australia Standard Time | (GMT+08:00) Perth |
227 | North Asia East Standard Time | (GMT+08:00) Irkutsk, Ulaanbaatar |
230 | Korea Standard Time | (GMT+09:00) Seoul |
235 | Tokyo Standard Time | (GMT+09:00) Osaka, Sapporo, Tokyo |
240 | Yakutsk Standard Time | (GMT+09:00) Yakutsk |
245 | A.U.S. Central Standard Time | (GMT+09:30) Darwin |
250 | Cen. Australia Standard Time | (GMT+09:30) Adelaide |
255 | A.U.S. Eastern Standard Time | (GMT+10:00) Canberra, Melbourne, Sydney |
260 | E. Australia Standard Time | (GMT+10:00) Brisbane |
265 | Tasmania Standard Time | (GMT+10:00) Hobart |
270 | Vladivostok Standard Time | (GMT+10:00) Vladivostok |
275 | West Pacific Standard Time | (GMT+10:00) Guam, Port Moresby |
280 | Central Pacific Standard Time | (GMT+11:00) Magadan, Solomon Islands, New Caledonia |
285 | Fiji Islands Standard Time | (GMT+12:00) Fiji Islands, Kamchatka, Marshall Islands |
290 | New Zealand Standard Time | (GMT+12:00) Auckland, Wellington |
300 | Tonga Standard Time | (GMT+13:00) Nuku'alofa |
- var param = new SqlParameter { ParameterName = "idx", Value = 1 };
- var result = context.Database.SqlQuery
("ProcedureName @idx", param); return result.FirstOrDefaultAsync().Result;
- context.Database.SqlQuery
("GetPerson").AsQueryable();
- var param = new SqlParameter { ParameterName = "idx", Value = 1 };
- var output_param = new SqlParameter { ParameterName = "ResultCode", Value = 0, Direction = ParameterDirection.Output };
- var result = context.Database.SqlQuery
("GetPersons @idx, @ResultCode out", param, output_param).AsQueryable(); var resultCode = (int)output_param.Value;
- public double GetDistance(double lat1, double lon1, double lat2, double lon2)
- {
- double theta, dist;
- theta = lon1 - lon2;
- dist = Math.Sin(deg2rad(lat1)) * Math.Sin(deg2rad(lat2)) + Math.Cos(deg2rad(lat1))
- * Math.Cos(deg2rad(lat2)) * Math.Cos(deg2rad(theta));
- dist = Math.Acos(dist);
- dist = rad2deg(dist);
- dist = dist * 60 * 1.1515;
- dist = dist * 1.609344; // 단위 mile 에서 km 변환.
- dist = dist * 1000.0; // 단위 km 에서 m 로 변환
- return dist;
- }
- ///
/// 주어진 Degree 값을 Radian 값으로 변환 /// - /// Degree
- ///
Radian - private double deg2rad(double deg)
- {
- return (double)(deg * Math.PI / (double)180d);
- }
- ///
/// 주어진 Radian 값을 Degree 값으로 변환 /// - /// Radian value
- ///
Degree - private double rad2deg(double rad)
- {
- return (double)(rad * (double)180d / Math.PI);
- }
Setp 2.
- ALTER DATABASE dbName
- SET SINGLE_USER WITH ROLLBACK IMMEDIATE
Setp 3.
- ALTER DATABASE OldDbName MODIFY NAME = NewDbName
- ALTER DATABASE dbName
- SET MULTI_USER WITH ROLLBACK IMMEDIATE
- BULK INSERT dbo.tableName FROM 'C\fileName.CSV' WITH (FIELDTERMINATOR = ',', ROWTERMINATOR = '\n')
- GUID guid = GUID.NewGuid()
- Stopwatch stopwatch = Stopwatch.StartNew();
- ..............................
- stopwatch.Stop();
- Console.WriteLine("실행시간 : ", stopwatch.ElapsedMilliseconds);
- public static void Register(HttpConfiguration config)
- {
- config.MapHttpAttributeRoutes();
- config.Formatters.JsonFormatter.SupportedMediaTypes.Add(new System.Net.Http.Headers.MediaTypeHeaderValue("text/html"));
- config.Routes.MapHttpRoute(
- name: "DefaultApi",
- routeTemplate: "api/{controller}/{action}/{id}",
- defaults: new { id = RouteParameter.Optional }
- );
- }
방법-2 : 같은 단어가 여러개 있을 경우 결과도 여러번 나옴
- SELECT ROUTINE_NAME
- FROM INFORMATION_SCHEMA.ROUTINES
- WHERE ROUTINE_TYPE = 'PROCEDURE' AND ROUTINE_DEFINITION LIKE '%문자열%'
- ORDER BY ROUTINE_NAME
- SELECT A.NAME
- FROM dbo.SYSOBJECTS AS A
- INNER JOIN dbo.SYSCOMMENTS AS B
- ON A.ID = B.ID
- WHERE A.TYPE = 'P' AND B.TEXT LIKE '%문자열%'
- ORDER BY A.NAME
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Management;
- using System.Net.NetworkInformation;
- namespace test
- {
- public static class MacAddress
- {
- public static string GetMacAddress()
- {
- const int MIN_MAC_ADDR_LENGTH = 12;
- string macAddress = string.Empty;
- long maxSpeed = -1;
- foreach (NetworkInterface nic in NetworkInterface.GetAllNetworkInterfaces())
- {
- string tempMac = nic.GetPhysicalAddress().ToString();
- if (nic.Speed > maxSpeed && !string.IsNullOrEmpty(tempMac) && tempMac.Length >= MIN_MAC_ADDR_LENGTH)
- {
- maxSpeed = nic.Speed;
- macAddress = tempMac;
- }
- }
- return macAddress;
- }
- }
- }