sql-server-2012

Stop SQL Server from running until needed [closed]

守給你的承諾、 提交于 2020-01-02 02:14:45
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I have SQL Server 2012 installed on my PC, and usually don't need it. It's only for debugging purposes. I've seen it takes up quite some RAM so I'd like to prevent it from starting until I need it, start it, and then stop it when not needed again. How do I do that? (I have SSMS installed as well so I can use

Azure data transfer Identity Column Seed Jumped by 10,000

允我心安 提交于 2020-01-02 01:35:41
问题 After inserting the data via sql script that had SET IDENTITY_INSERT [dbo].[table] ON ... SET IDENTITY_INSERT [dbo].[table] OFF the identity seed has increased by 10,000 I have tried running reseed dbcc CHECKIDENT ('vendors', 'reseed', 57439) but I get the error saying the DBCC command 'CHECKIDENT' is not supported in this version of SQL Server. How to stop in the future this problem? 回答1: I found this post on the web. The behavior (reseed) is by design, but has been acknowledged internally

Permissions error when attaching a database: “Cannot access the specified path”

不羁岁月 提交于 2020-01-02 01:01:06
问题 I am running SQL Server 2012 Enterprise Edition. I have downloaded the AdventureWorks 2012 OLTP data files (both .mdf and .ldf ). I saved them to the AW folder that I created in My Documents where I unzipped the file. I go to SQL Server Management Studio (SSMS) right-click on database, and click attach in the context menu. In the dialog I click find. The UI does not allow me to navigate to folder. I try typing the full path to the file, and then I get the following error: Cannot access the

how does one programmatically create a localdb .mdf?

眉间皱痕 提交于 2020-01-01 15:40:47
问题 how does one programmatically create a localdb .mdf? acceptable solutions exclude visual studio, ssms, aspnet_regsql. a naive stab at a solution might look like this: static void Main(string[] args) { using (var con = new SqlConnection(@"Integrated Security=SSPI;Data Source=(LocalDb)\v11.0;AttachDbFilename=test.mdf")) { con.Open(); using (var cmd = new SqlCommand("CREATE DATABASE test", con)) { cmd.CommandType = CommandType.Text; cmd.ExecuteNonQuery(); } } } but of course, this fails in

how does one programmatically create a localdb .mdf?

。_饼干妹妹 提交于 2020-01-01 15:39:53
问题 how does one programmatically create a localdb .mdf? acceptable solutions exclude visual studio, ssms, aspnet_regsql. a naive stab at a solution might look like this: static void Main(string[] args) { using (var con = new SqlConnection(@"Integrated Security=SSPI;Data Source=(LocalDb)\v11.0;AttachDbFilename=test.mdf")) { con.Open(); using (var cmd = new SqlCommand("CREATE DATABASE test", con)) { cmd.CommandType = CommandType.Text; cmd.ExecuteNonQuery(); } } } but of course, this fails in

How to connect to SQL Server LocalDB using Invoke-Sqlcmd?

浪尽此生 提交于 2020-01-01 09:00:12
问题 I have sqlcmd.exe from both SQLServer 2008 and SQLServer 2012: PS C:\> Get-Command sqlcmd.exe Definition ---------- C:\Program Files\Microsoft SQL Server\100\Tools\Binn\SQLCMD.EXE C:\Program Files\Microsoft SQL Server\110\Tools\Binn\SQLCMD.EXE By modifying $env:PATH i force the use of sqlcmd.exe from SQL Server 2012: PS C:\> $env:PATH = ($env:PATH -split ";" | Where-Object { $_ -notlike "*\Microsoft SQL Server\100\*" }) -join ";" PS C:\> Get-Command sqlcmd.exe Definition ---------- C:\Program

Connect Matlab to Sql server

。_饼干妹妹 提交于 2020-01-01 07:18:25
问题 I want to connect Matlab to Sql server . this is my code: db = database('ChifcoProd-2013-12-12-11-37', '', '', 'sqljdbc4.jar',... 'jdbc:microsoft:sqlserver://localhost:1433;database=ChifcoProd-2013-12-12-11-37') error: JDBC Driver Error: sqljdbc4.jar. Driver Not Found/Loaded the driver is already installed and I added the path to javaclasspath but it doesn't work. 回答1: Try using the Help within MatLab, its very helpful. You are using the correct database connection: conn = database(instance

DbGeography make circle with center and radius

廉价感情. 提交于 2020-01-01 07:03:16
问题 I create a DbGeography-point like this: String selectedLocation = String.Format("POINT ({0} {1})", lon, lat).Replace(",", "."); DbGeography selectedLocationGeo = DbGeography.FromText(selectedLocation, 4326); I also have a radius R. I want to create a curvepolygon with the shape of a circle with the specified radius from the point-coordinate. Be aware that I am using DbGeography, and not DbGeometry. How do I create the CIRCULARSTRING? Or is there a better way than using a CIRCULARSTRING?

Get UnCommitted Data in MySQL

感情迁移 提交于 2020-01-01 01:24:31
问题 In SQL Server we can write below SQL Queries to get Un-Committed data in database . This means the data that is still under transaction and Transaction is not complete. SQL Server Query Select * from TableName With(NoLock); Is there any equivalence in MySQL database to get data even if table is locked ? I am trying this in PHP CodeIgnitor 回答1: Found an article with title " MySQL NOLOCK syntax " http://itecsoftware.com/with-nolock-table-hint-equivalent-for-mysql SQL Server WITH (NOLOCK) looks

Issue with RESTful webservice +JSON+SQL stored procedure project

ぐ巨炮叔叔 提交于 2019-12-31 05:38:08
问题 I know for a fact that there is something I miss. My whole project is somewhat copy&paste of various "how to..."s, my knowledge of C# is basic at best and I need to have it working since our standard web service software is RESTful only when sending. My main problem is that all solutions I've stumbled upon are actually code snippets, which don't work for me - my C# knowledge is basic so I don't understand how it all works, much less troubleshoot it. I'm pretty sure I'm not even capturing the