sql-server-2012

Is there a way to save all queries present in a ssis package/dtsx file?

五迷三道 提交于 2019-12-11 06:41:43
问题 I need to run some analysis on my queries (specifically finding all the tables which a ssis calls). Right now I'm opening up every single ssis package, every single step in it and copy and pasting manually the tables from it. As you can imagine it's very time consuming and mind-numbing. Is there a way to do export all the queries automatically ? btw i'm using sql server 2012 回答1: Retrieve Queries is not a simple process, you can work in two ways to achieve it: Analyzing the .dtsx package XML

Combining duplicate records in SQL Server

ⅰ亾dé卋堺 提交于 2019-12-11 06:17:05
问题 I have a table in SQL Server 2012 that holds a list of parts, location of the parts and the quantity on hand. The problem I have is someone put a space in front of the location when they added it to the database. This allowed there to be two records. I need to create a job that will find the parts with spaces before the location and add those parts to the identical parts without spaces in front of the location. I'm not quite sure where to even start with this. This is the before: Partno |

How to convert Row by row execution in to SET based approach in SQL

天大地大妈咪最大 提交于 2019-12-11 06:15:32
问题 I'm working on a huge SQL code and unfortunately it has a CURSOR which handles another two nested CURSORS within it (totally three cursors inside a stored procedure), which handles millions of data to be DELETE,UPDATE and INSERT. This takes a whole lot of time because of row by row execution and I wish to modify this in to SET based approach From many articles it shows use of CURSORs is not recommend and the alternate is to use WHILE loops instead, So I tried and replaced the three CUROSRs

Deploying SSDT project through Powershell Script: Version store out of memory error

我的梦境 提交于 2019-12-11 06:07:13
问题 Hoping someone may be able to advise what might be happening here. I am attempting to run an SSDT deployment via a Powershell script directly on the SQL Server its-self. SQL Version: 2012 (upgrade not possible at the moment) Exact error: System.Management.Automation.MethodInvocationException: Exception calling "GenerateDeployScript" with "3" argument(s): "Version store out of memory (cleanup already attempted)" Microsoft.Isam.Esent.Interop.EsentVersionStoreOutOfMemoryException: Version store

Query to get common words between two strings [closed]

淺唱寂寞╮ 提交于 2019-12-11 05:52:25
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . I need a SQL query to get the common words only between two sentences. For example: Sentence 1: This site is very helpful Sentence 2: I need a helpful site The result should be: site helpful Also, if I need to

Will SQL Server 2012 FTS have native support for hit highlighting? [closed]

天涯浪子 提交于 2019-12-11 05:41:55
问题 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 7 years ago . Sql Server 2008 does not natively support hit highlighting in its FTS functionality, and currently you must implement yourself using a variety of techniques. Microsoft has made some vague noises about including it in future SQL Server releases. Does anyone know if SQL Server 2012 FTS will have native support for

Dynamically decide the table name in execute SQL task for CREATE TABLE statement

末鹿安然 提交于 2019-12-11 04:59:00
问题 I want to know if this is possible to do in SSIS Execute SQL task. I want to check for existence of a table, and if it doesn't exist, create the table. I want to keep the table name in a variable so I can execute the task against different databases and be able to change the table name. As an example I have this code: if not exists (select * from sysobjects where name='Table1' and xtype='U') Create Table Table1( Col11 varchar(10) primary key, Col12 varchar(10) ); For flexibility I want to

How to pass an array of integer values from a table to a stored procedure?

℡╲_俬逩灬. 提交于 2019-12-11 04:53:24
问题 I have a stored proc using dynamic sql that updates a few columns based on the value passed to it. I am trying to test it out for multiple values without having to enter those manually. These values are to be taken from a table. Is there a way to pass all these values in the table and have it go through the proc? Just like in your regular programming language where you would run through an array. I am doing this in sql server 2012. Code is something like this CREATE PROCEDURE sp1

How use Bulk insert csv to sql server with datetime format correct?

ぐ巨炮叔叔 提交于 2019-12-11 04:46:26
问题 i want use bulk insert file csv insert to SQL Server 2012 . same column have datetime but use bulk insert datetime format not work and i not use SSIS . Example Create Table CREATE TABLE [dbo].[scanindex_test]( [request_no] [varchar](13) NOT NULL, [request_date] [datetime] NULL, [id_card] [varchar](20) NULL, [firstname] [varchar](100) NULL, [surname] [varchar](100) NULL ) Query Sql Server 2012: declare @path varchar(255), @sql varchar(5000) SET @path = 'C:\Test\TESTFILE.csv' set @sql = 'BULK

How to pivot, link and group a table with

末鹿安然 提交于 2019-12-11 04:39:54
问题 I have a table beta with cols Id, Parent, Name, Level CREATE TABLE [beta]( [Id] [int] IDENTITY(1,1) NOT NULL, [Parent] [int] NULL, [Name] [varchar](150) NOT NULL, [Level] [int] NULL, CONSTRAINT [PK_Beta] PRIMARY KEY CLUSTERED ( [Id] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO Sample contents are Id Parent Name Level 1 NULL Clinical 1 2 NULL Custom 1 3 NULL Medicare 1 4 NULL