sql-server-2012

Unable to use SSIS's SSDT in VS2010 / SQL Server2012

橙三吉。 提交于 2019-12-10 06:58:25
问题 I have a full version of SqlServer 2012 installed on my local machine and have installed SSDT from the installation package (and updates) I've then opened the SSDT visual studio application and installed the SSDT package from Microsoft which appears to have worked correctly. However, when I attempt to start an Integration Services project I get the following error message: Microsoft Visual Studio is unable to load this document: To design Integration Services packages in SQL Server Data Tools

Constant SQL Server 80% CPU Utilization

流过昼夜 提交于 2019-12-10 05:24:22
问题 We have a small (for now) Asp.Net MVC 5 website on a dedicated VPS. When I go to the server and fire-up task manager, I see that "SQL Server Windows NT - 64 bit" is using around 80% of CPU and 170MB of RAM and IIS is using 6% CPU and 400MB of RAM. Server Specs are: CPU 1.90Ghz dual core Memory 2GB Windows Server 2012 SQL Server Express 2012 Disk Space: 25GB, 2.35 Free. The database is not very big. Its backup is less than 10MB. I have tried to optimize the website as much as I could. I added

Why can't I connect to my mssql database using PHP?

拜拜、爱过 提交于 2019-12-10 04:21:36
问题 I've done so much research trying to get my PHP code hosted on IIS to connect to my MSSQL database. I just can't seem to figure out the issue. Has anyone come across this before? <?php $serverName = 'AEGIS-PC\SQLEXPRESS'; $connectionInfo=array('Database'=>'tttb_db'); $con = sqlsrv_connect($serverName, $connectionInfo); if($con){ echo 'Connection established<br />'; } else { echo 'Connection failed<br />'; die(print_r(sqlsrv_errors(), TRUE)); } ?> Update, we have a new error: Connection failed

How to create composite foreign key in sql server management studio 2012

两盒软妹~` 提交于 2019-12-10 04:19:29
问题 I can successfully create composite primary key in sql server management studio 2012 by selecting two columns (OrderId, CompanyId) and right click and set as primary key. But i don't know how to create foreign key on two columns(OrderId, CompanyId) in other table by using sql server management studio 2012. 回答1: In Object Explorer, go to your table and select Keys > New Foreign Key from the context menu: From the dialog box that pops up, click on the Add button to create a new foreign key:

More than 2 columns in a CONCAT function

一个人想着一个人 提交于 2019-12-10 03:22:44
问题 In SQL Server 2012 I want to concat 5 columns into 1 but in the query it works but when I put in in a view it gives me an error like Msg 174, Level 15, State 1, Line 3 The CONCAT function requires 2 argument(s). What's the problem so I can fix it because concat is a good function for concatenate more than 1 column because if its null they make it empty.. CODE: SELECT 'Aan ' + A.Name AS 'Naam', { fn CONCAT('T.a.v. ', C.Salutation + ' ', C.FirstName + ' ', C.MiddleName + ' ', C.LastName) } AS

SqlConnection and avoiding promotion to MSDTC

谁说我不能喝 提交于 2019-12-10 01:56:52
问题 When we need to do database access in our application, we use the following patterns: For querying, we have a static factory class with a method CreateOpenConnection which does nothing more than new SqlConnection(myConnectionString) and calls Open() on it. This method gets called before we do a query and the connection is disposed after the query returns. For inserts/updates/deletes we use a Unit of Work pattern where the changes are batched up and submitted to the database with a call to

How to retrieve the input parameter values of a stored procedure

独自空忆成欢 提交于 2019-12-10 00:20:08
问题 I want to create a auditing procedure which will be called in the catch block of all the procedure in my Database. I wanted to store the list of all the input parameters and its values in this auditing DB. Please suggest me, how to achieve this in SQL Server 回答1: I am not aware of programatically retrieving the list of parameters and their values for a stored proc(Possibly would involve n number of system tables and things like that). Without going into that level of complexity AND if

How to render a portion of spatial data depending on user location on map

夙愿已清 提交于 2019-12-09 23:09:53
问题 we have every street for texas in a database.The issue is, there are 2million streets. When the user looks at a simple county on the map, it takes FOREVER to render the streets for the county because the query has to go through EVERY SINGLE STREET in the texas table. Does anyone have any advice on how we can split the data across tables and have geoserver query the table needed depending on the current users location they are viewing? For Example Instead of one giant texas table how about

Geography data type vs. Geometry data type in SQL Server

荒凉一梦 提交于 2019-12-09 20:29:50
问题 Environment: SQL Server 2012 I'm using an online tool, the only one I could find so far, to plot polygons and points on the earth. http://www.birdtheme.org/useful/googletool.html I have two tables. One stores "areas" as polygons and the other table stores points amongst other things irrelevant to my question. For simplicity, I'll just reduce my scenario to sql variables. In the query below, I'm using the geography data type for well known points of interest. I drew a polygon around Robben

Differences between equal sign(=) and IN with subquery

最后都变了- 提交于 2019-12-09 17:56:13
问题 I have a query it takes 20 seconds to execute, follow my query: SELECT MATLIGA.COD_MAT_FAMILIA FROM ORCAMENTOS.dbo.OR_1INSUMOS INSUMOS INNER JOIN ORCAMENTOS.dbo.OR_MAT_GRUPOS GRUPOS ON (GRUPOS.EMPRESA='01' AND GRUPOS.FILIAL='01' AND GRUPOS.CODIGO_INTERNO = 'HOT' ) INNER JOIN ORCAMENTOS.dbo.OR_MATERIAIS MATER ON (MATER.EMPRESA='01' AND MATER.FILIAL='01' AND MATER.CODIGO_GRUPO=GRUPOS.ID AND MATER.ID = INSUMOS.COD_INSUMO_MATER ) INNER JOIN ORCAMENTOS.dbo.OR_MAT_LIGACAO MATLIGA ON (MATLIGA