SSIS: The Run Process Task Can not Run the FTP Protocol

i'm trying to transfer my data from TXT that i generate in a Data flow task to FTP library and can't do it If i use Execute Process Task i must execute a File1.bat: @echo off ftp -s:fileName.txt -n and fileName do it: open user username

DateRange on two columns and with a column for the main report

Need little help with date range conditions for two columns along with one extra condition on third column, I want to to apply range query on two columns. It works fine if I don't put third column for one more condition along with date, but if I put

Using table settings with SQL Server JDBC

Could anyone provide some guidance on how to use Table Value Parameters (TVP) with SQL Server JDBC? I am using the 6.0 version of the SQL Server driver provided by Microsoft, and I have reviewed the official documentation as well as the more helpful

Applying the window function in a query without CTE

I have been searched in the net and trying to create a query that contains a window function without a CTE but I couldn't get the result and I need some help this my query that I create with a CTE what I need is doing that in one query ;with cte(Gid,

Use if according

I use this query, but it does not work: create FUNCTION getUserCreditPayment ( @resellerCode int, @userCode int, @startDate datetime, @endDate datetime ) RETURNS TABLE AS RETURN( WITH Directories AS ( CASE WHEN (@userCode != 0) THEN (SELECT * FROM Us

Need the last value of the previous year

I am trying to create a query of patients' last blood pressure values of 2015. When I use max(date) it includes values from 2016, but when I apply where date < '2016-01-01' it does not give me the values for those patients in 2015, but rather just de

Need help on a DATE query in a SQL server?

I have two tables in SQL Server: EMP On_Vacation with colums EmpId, LeaveType, StartingFrom, EndingTo,RejoiningDate The On_Vacation table stores the information of employees who are on leave. I'm trying to query the table in such a way that my query

Attach the result of a Temp column to a SQL Server table

I am using SQL Server to create my database. I want to add a column to my Table which would calculate the number of NULL values in each row, like this: Column1 | Column2 | Column3 | Score a | B | C | 0 x | NULL | NULL | 2 Currently, I have this: Colu

How is the scale defined when decimal and bigint are divided?

I have value A of type DECIMAL(19,8) - the scale is 8, so the number of decimal digits that will be stored to the right of the decimal point is 8. Now, I am dividing A on B, where B is BIGINT. For, example: SELECT CAST(3 AS DECIMAL(19, 8)) / CAST(27

how to handle friend requests in sqlserver

I have a requirement in my app where one user can send the friend request to another user. We use SQL Server database as the backend. The structure of the table is like this. CREATE TABLE FriendStatus (FriendStatusId BIGINT PRIMARY KEY IDENTITY(1,1),

How to get empty cell lines in mssql

I have been trying to get the rows where cell is empty but how can i get an empty cell Its not NULL over there, its like an empty string. 05J9LJ-E E004030 BGH/F.TB E004032 000080.KS 002X87-E E004033 018880.KS So second row, first column is like 8 spa

SQL to search a table and make a record by field

I have three tables in my database. Table one effectively contains two fields: |Datetime| |Set| Table two is a lookup table which matches a number of parts of a set to a set number: |Set| |Part1| |Part2| |Part3| |Part4| I want table 3 to have a recor

TSql: Problem with join

I am trying to write a join query but can't seem to filter it out. I'm selecting an invoice table and and applied payments table. I want to get the balance of all invoice totals amount - applied amounts. I can get the applied amounts fine using sum b

sql server insert copy rows multiple tables a field change

I'm not sure of the best way to ask this, so it will be through example. I have a good size database that contains about 800 tables each containing a key piece of information for all data - For the example we'll call it Department. This is part of th

How to retrieve specific rows from the SQL Server table?

I was wondering is there a way to retrieve, for example, 2nd and 5th row from SQL table that contains 100 rows? I saw some solutions with WHERE clause but they all assume that the column on which WHERE clause is applied is linear, starting at 1. Is t

PHP MSSQL mssql_fetch_array - can not get echo results

I've successfully created a connection to an MSSQL database, executed a query and returned the results using mssql_num_rows. I'm able to get $numRows to echo and show "Rows Returned" on the page. The columns in the table have these names: employ

SQL Server - Synonym Tips & amp; Things?

I've been doing a lot of DB refactoring lately and synonyms have come in incredibly useful. When I originally put in the synonyms I was thinking they would be very temporary while I refactor. Now I am thinking there might be some good reasons to keep

Dimension Security in SSAS & amp; SSRS

I am stuck with a problem of implementing security at dimension level in SSAS. Here is what I did - 1. Defined a role in SSAS and applied security at dimension level (Unchecking cube dimensions that I don't want this role to access and setting Allowe

Long query prevents inserts

I have a query that runs each night on a table with a bunch of records (200,000+). This application simply iterates over the results (using a DbDataReader in a C# app if that's relevant) and processes each one. The processing is done outside of the d

Problem inserting string or NULL into SQL Server database

I'm having trouble coming up with the proper syntax for allowing either a string or a NULL to be passed to the database. Here's my code: string insertString = String.Format( @"INSERT INTO upload_history (field1, field2, field3) VALUES ('{0}', '{1}',