sql-server-2012

OPENDATASOURCE instead of Linked Server

情到浓时终转凉″ 提交于 2019-12-10 11:17:13
问题 I have a situation where a linked server to an access DB is crashing my SQL server. Crashed here means adding the linked server causes all other linked servers using that provider to stop working. Any queries to those linked servers hang and don't complete. This situation persists until the server is restarted. However, when I use OPENDATASOURCE to connect to the same data source I don't have this problem. Why would one work and the other crash? The provider I'm using is Microsoft.ACE.OLEDB

Why do we need SSIS and star schema of Data Warehouse?

拥有回忆 提交于 2019-12-10 11:15:42
问题 If SSAS in MOLAP mode stores data, what is the application of SSIS and why do we need a Data Warehouse and the ETL process of SSIS? I have a SQL Server OLTP database. I am using SSIS to transfer my SQL Server data from OLTP database to a Data Warehouse database that contains fact and dimension tables. After that I want to create cubes using SSAS form Data Warehouse data. I know that MOLAP stores data. Do I need any Data warehouse with Fact and Dimension tables? Is not it better to avoid

Create Geometry/Geography Field from Latitude & Longitude fields (SQL Server)

醉酒当歌 提交于 2019-12-10 11:09:07
问题 I have a view that contains two fields for latitude and longitude, and I would like to create a new view that converts these lat/lon fields into a geometry/geography field (unsure which is most appropriate for ArcGIS). The fields in the original view are of double type, and I would like them cast as a spatial type in my new view. Currently I am unsure how to cast these fields as spatial types. All the other similar questions on Stack Overflow never got me a working solution, so I apologize if

Log4net writing custom object to sql database using custom appender?

馋奶兔 提交于 2019-12-10 10:57:15
问题 Using SQL Server 2012 here is my table: CREATE TABLE [dbo].[Test] ( [One] [VARCHAR](50) NOT NULL, [Two] [VARCHAR](50) NOT NULL ) ON [PRIMARY] Here is my appender: <appender name="TestAppender" type="log4net.Appender.AdoNetAppender"> <bufferSize value="1" /> <connectionType value="System.Data.SqlClient.SqlConnection, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <connectionString value="data source=localhost;initial catalog=ApplicationLog;integrated

No UI dialogs in MS Azure / SQL Server Management Studio

心已入冬 提交于 2019-12-10 10:34:09
问题 Recently, I purchased a licence for a Microsoft Azure SQL Server 2012 (packet "S0" - Standard, 250 GB) When I connect with SQL Server Management Studio 2012 to this database, then all the user interface dialogs for creating tables, setting up users, etc. are gone. You can only script and execute pure SQL statements. Even the table editor is gone, so you even cannot edit the data in a table! If I connect to a local database, then everything works. So the problem must be related to the Azure

Grantor does not have GRANT permission - issue

旧巷老猫 提交于 2019-12-10 10:29:23
问题 I am having a problem with granting proper privileges to a server level role that I created. Whenever a user from the role tries to grant permition to other user I am getting an error like in the title. I did some research and add with grant option when I grant role priveleges but that not helped. I want to keep my role priveleges as low as it must be to perform the given script. Here is how I create my role CREATE SERVER ROLE [My_Server_Role] go GRANT ALTER ANY LOGIN ,ALTER ANY SERVER ROLE

SET a variable inside a CTE

泪湿孤枕 提交于 2019-12-10 10:10:08
问题 This is my first time I work with SQLServer 2012, and I have this code that it doesn't work: CREATE PROCEDURE ReadCodeBuffer @gint bigint, @pres tinyint, @level bigint, @quantity smallint, @xmlGenerated xml OUTPUT AS DECLARE @current_incremental bigint DECLARE @counter bigint DECLARE @xml XML -- Get current incremental. set @current_incremental = (SELECT INCREMENTAL FROM INCREMENTAL_TABLE WHERE GTIN = @gint AND PRESENTATION = @pres AND LEVEL = @level) -- with Numbers as ( select row_number()

Select MAX dates plus ID value

瘦欲@ 提交于 2019-12-10 10:04:47
问题 Please consider the following table... DECLARE @tmp TABLE ( ID int, userID int, testID int, someDate datetime ) ...containing the following values: INSERT INTO @tmp (ID, userID, testID, someDate) VALUES (1, 1, 50, '2010-10-01') INSERT INTO @tmp (ID, userID, testID, someDate) VALUES (2, 1, 50, '2010-11-01') INSERT INTO @tmp (ID, userID, testID, someDate) VALUES (3, 1, 50, '2010-12-01') INSERT INTO @tmp (ID, userID, testID, someDate) VALUES (4, 2, 20, '2010-10-01') INSERT INTO @tmp (ID, userID,

when to opt for caching in the Lookup component in SSIS

China☆狼群 提交于 2019-12-10 09:37:48
问题 In SSIS Look up there are 3 types of Caches.. Full Partial and No cache. In our solution it has always been used the default one(Full).Is there any particular scenarios,where it can go for Partial cache/No Cache? In our solutions lockup tables are always small(example:-we have been looking at small tables to get the types or to get description).That might be the reason it has been configure in default(Full cache) mode? Please let me know the valuable suggestions and opinion. 回答1: Let's cover

sql select min or max based on condition

邮差的信 提交于 2019-12-10 09:32:54
问题 Hi all I'm trying to find a way to select min or max from a range of data based on these conditions: If setuptime and processtime cols are all 0 select MIN(oprNum) (operation hasn't started yet so get first oprnum) If setuptime and process time are not 0, get max oprnum (active operation). Based on either of these I want ONE row... Please see attached example of data. Thanks! This is part of a much larger query so i need 1 output row per prodid... +------------+--------+---------+------------