I have a straightforward SQL statement that I posted into a DataFlow Task and got this dreaded error. There is no stored procedure or temp tables involved. What am I missing? The SQL works fine in SSMS and returns appropriate results. The query is pretty simple and I have never seen this error in SSIS before. Answer no column name
Tag: sql-server-2012
How to create all possible combinations with splitted items in SQL?
I have data as in below delimited format expected output – is the combination with each element and the element itself I am trying by splitting the data into different items as below any idea how we can create combination with splitted items? Thanks! Answer You have a couple of mistakes in your SQL. @data had no closing “‘”, and
how to use NULLIF with aggregate function
I’m using SQL Management Studio 2012. I’m getting a ‘Divide by zero error encountered’ error. I’m aware this requires the use of NULLIF but I’m unsure how to use it in my query. This is my query I’ve actually asked this question before which some kind person answered excellently but that was without the OVER() and SUM aggregate function, I’m
Seed Data using merge statement including data from external table
I’ve been provided an excel file with data that I am supposed to merge into a database. From this data I am concatinating a string in this format: ‘Maastricht’ here is the name of a city, which I need up in a foreign table during the insert. This is the script that I have come up with: To Replace the
Getting Count of Result Sets of SP (SP_MSForeachtable)
I was going to list all of the Tables in my DB which have no records. As same as most of the times I used SP_MSforeachtable like: And this gives me many result sets which I need to count them now. I know there are other ways to work with tables but I was thinking getting count of sys.sp_MSforeachtable (or
How to concatenate two columns in my case using SQL? [closed]
I have 2 tables called Standards and StandardDetails Standards ItemID ItemCode BranchID ———————————— 135576 555 1111 135576 555 …
Converting string to integer and then converting back to string
I have some update statements like this: UPDATE tmp SET MyVarCharColumn1 = ISNULL(SomeOtherVarCharColumn,0) FROM #myTempTable tmp; Note that MyVarCharColumn1 is of type VarChar() but in real …
How to use an IF statement within a view to drop/use a #Temp Table?
I need to create a view, which begins with the following SQL: IF OBJECT_ID(‘tempdb..#TempTable’) Is Not null Drop Table #TempTable I am also rebuilding this #TempTable further on in the view, and …
SQL Return last record where column value changed and amount of change
In MS SQL 2012, I have a table like such: Key | Entity | Value | DateTime ———————————————————– 10 A 800 …
How to join two tables in one view?
I am trying to create a view where I can see the items that have been planned to be shipped and have not been shipped, and the items have have been shipped but were not planned to. In order to do …