ssms

LINQ to SQL execution time is 50x longer than SSMS SQL

情到浓时终转凉″ 提交于 2019-11-30 17:32:26
问题 I have an asp.net app that uses Linq to SQL. One query from the app was timing out (over 30 seconds to execute). I increased the CommandTimeout of the DataContext, and it did complete in 45 seconds. I copied the Linq to SQL generated SQL from SQL Profiler to SSMS and executed it using the same user credentials as I am using in my app, and I got a sub-second execution time. I am using a new DataContext to execute the query, so the query is running in its own transaction. My connection string

SQL Server 2012 error: object reference not set to an instance of an object

天大地大妈咪最大 提交于 2019-11-30 16:50:06
问题 I use SQL Server 2012 and I have some databases on it. The problem is I suddenly get an error saying, object reference not set to an instance of an object I get this error when: Going to write a new query Select previously entered data by right click the table name -> Select top 1000 rows What I can do without getting error message: Log into my instance successfully using both Windows Authentication mode and SQL Authentication mode. Edit the table data by right click the table name -> Edit

How can I resolve the “Table 'dbo.Foo' already exists.” error when the table does not exist?

◇◆丶佛笑我妖孽 提交于 2019-11-30 16:48:03
I've created a table and then realised I made a mistake. SSMS wouldn't let me update the table without recreating it, so I've deleted the table and then tried to create it again. It won't let me do this, and I get an error dialog Table 'dbo.Foo' already exists. So I try to delete it again: drop table dbo.Foo Cannot drop the table 'dbo.Foo', because it does not exist or you do not have permission. Refreshing the IntelliSense cache does not help. Closing and restarting SSMS seems to be the only way to get rid of the error. After doing so, I can again successfully create the table. Create the

SQL server management studio local database connection error in windows 7

可紊 提交于 2019-11-30 11:53:55
I'm running SQL Server 2012 Management Studio Express in windows 7, i am having issues connecting to the local db. i tried all the above mentioned solutions, didnt work. please help. thanks in advance. Installation url is here . error- A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) (Microsoft SQL Server,

Can't get SQL Server to start or connect to my local database engine through SSMS

喜你入骨 提交于 2019-11-30 11:43:52
SQL Server has been working fine but since Friday I have not been able to connect to the database engine in SSMS. This coincided with my having to power the laptop off during a Windows update because it appeared to be hanging (I don't know if these two are related). Since then I have: Gone back to a restore point before the failed update Removed SQL Server 2008 from my machine Installed SQL Server 2012 onto my machine. This failed during the load Removed everything that was labelled SQL Server from my machine Redone the failed Windows updates Installed SQL Server 2012 which again failed on

Management Studio default file save location

心已入冬 提交于 2019-11-30 10:38:04
问题 Open a new query window. Write some SQL. Save the script, the Save File As dialog box opens - but always to the same default location in the Profiles directory. Is there any way to set my default file location? ...Like I used to do with apps from the 1980s? Under Tools|Options a default location can be specified for query results. I need the same thing for new queries (the text editor). Tried changing locations in the Registry but SSMS just overwrote my changes. Any suggestions? (I saw this

Find stored procedure by name

ⅰ亾dé卋堺 提交于 2019-11-30 10:16:59
问题 Is there any way I can find in SQL Server Management Studio stored procedure by name or by part of the name? (on active database context) Thanks for help 回答1: You can use: select * from sys.procedures where name like '%name_of_proc%' if you need the code you can look in the syscomments table select text from syscomments c inner join sys.procedures p on p.object_id = c.object_id where p.name like '%name_of_proc%' Edit Update: you can can also use the ansi standard version SELECT * FROM

Populating Drop down with the values from database in play frame work

爱⌒轻易说出口 提交于 2019-11-30 10:02:59
问题 I am new to play frame work and i am finding it bit difficult. i am retrieving list of client names from data base and populating it to a dropdown ,here is my client.java code package models; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.*; import play.db.ebean.Model; public class Client extends Model { /** * */ private static final long serialVersionUID = -1932214701504374792L;

Convert unknown number of comma separated varchars within 1 column into multiple columns

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-30 09:48:01
问题 Let me say upfront that I'm a brand-spanking-new SQL Developer. I've researched this and haven't been able to find the answer. I'm working in SSMS 2012 and I have a one-column table (axis1) with values like this: axis1 296.90, 309.4 296.32, 309.81 296.90 300.11, 309.81, 311, 313.89, 314.00, 314.01, V61.8, V62.3 I need to convert this column into multiple columns like so: axis1 axis2 axis3 axis4 296.90 309.4 null null 296.32 309.81 null null 296.90 null null null 300.11 309.81 311 313.89... So

Automatically refresh a query in ms sql server management studio?

筅森魡賤 提交于 2019-11-30 08:01:58
Is there a way to automatically refresh the result of a query in the Microsoft SQL Server Management studio (SQL Server 2008 R2)? Currently i'm debugging an application which automatically inserts and updates data in a database and I'd like to track the progress without having to deposit a heavy object on the F5 key. try this: SELECT GETDATE() --your query to run raiserror('',0,1) with nowait --to flush the buffer waitfor delay '00:00:10' --pause for 10 seconds GO 5 --loop 5 times it will run the query 5 times, pausing for 10 seconds between each run output: Beginning execution loop ----------