how to remove invalid object names on linkserver query - sql

I created a linked server between 2 SQL Servers, and successfully made the linked server and I can query on the other server in linked server
But when I have a query, there appears a red line under the query which says "invalid object name", but I can query on it
Like this : linked server name: REMOTERT
SELECT done_buy, done_sell
FROM [REMOTERT].front.dbo.custbal
--> shows a red line and when I point mouse on it show invalid object name [REMOTERT].front.dbo.custbal. but if I press F5(Execute) can show the result

once you create a new SQL Server object, your newly created object does not get updated in the IntelliSence Local Cache and due to this, it shows red line underneath that object. So you just need to refresh SSMS IntelliSence Local Cache and once you refresh it, IntelliSence will automatically add newly created object in the cache and the red line will disappear. try this
Edit -> IntelliSense -> Refresh Local Cache
or simply do
Ctrl + Shift + R

It is because of your cached memory is not refresh,
simply close sqlserver and open again. It will not come again.

Related

invalid column name '...' SQL

Why do I get this red error when I add 1 column soluong?
And with such an error, when transmitting data, it will not transmit the soluong column
enter image description here
enter image description here
enter image description here
How to not get error when adding column?
Refresh your IntelliSense cache. In SSMS, go drill down through the menus for Edit --> ItelliSense --> Refresh Local Cache, or, press Ctrl + Shift + R. After initiating, wait a few seconds for those red errors to go away. Always initiate a refresh after altering objects if you don't want to view those red errors.

Ms Access and SQL: how to identify where error occurs

I have a form in MS Access where a lot of queries are running to calculate all kinds of numbers using user input and using other queries ouput. All of a sudden I get the error below:
Error text is:
The record source ' ' specified on this form or report does not exist.
The name of the recordsource may misspelled, the recordsource was deleted or renamed, or the recordsource exists in a different database.
In the Form or Report's design view or layout view, display the property sheet by clicking the properties button, and then set the recordsource property to an existing table or query.
I don't remember exactly what I added/removed to have caused this and I can't find where the error occurs. How can I, I guess, debug my Access Form while it's running queries?
I don't see your image as it is blocked at work.
The only one way to debug the application when errors occurs is to break the execution using the keyboard combination :
CTRL + Pause/Break
Do it when the error message appears
This obviously doesnt work if the application is compiled in a mde/accde
When the CTRL-Break doesnt work, you have to add a break point in your code.
Bring the VBA window using
ALT + F11
Open the code of your form, go in the procedure that triggers the queries, select a line of code at the beginning and add a breakpoint using F9
Then run the form, it will stop the execution on the breakpoint and show you the VBA window, continue to execute the code step-by-step using F8 until the error occurs
When ever you change the name of a table in ms access for that has drop down list, go to the design view --> property Sheet--> Row Source and change the names to the corresponding names for the drop down selection for combo selection

Inserting .DBF Files from different folder structure with their respective FilePath using SSIS?

Am working on creating SSIS Package the does the following, so far my SSIS Package works well to insert records from '.DBF' file from one folder location ONLY (Am using Data Flow Task onto the Control Flow and OLE DB Source/Destination to read a .DBF file and get it inserted). However, am not able to figure out how to make it works with 20 sites, for example: I have 20 '.DBF' files stored in the following structure:
1. E:\DBF Files\Site1\Data\records.DBF
2. E:\DBF Files\Site2\Data\records.DBF
3. E:\DBF Files\Site3\Data\records.DBF
4. E:\DBF Files\Site4\Data\records.DBF
and so on till Site20 (here file name remain the same but the content will differ from site to another).
I have table for 'records.dbf' file in my SQL Server in the following structure:
Records Table:
Product_Name Price FilePath FileName
---------------------------------------------------------------
now here, how can process these files from different sites to be stored in my records sql table with it respective FilePath using SSIS??
P.S File Names will always remain the same and the path will change "Like Site 1"
Grab a For Each Loop container for the SSIS Toolbox and drag it on to the Control Flow designer.
Double click the For Each container to bring up the editor, click the Collection tab from the left-hand menu
Leave the Enumerator set at Foreach Item Enumerator and click the Columns button in the lower right.
Click the Add button and just go with the defaults which should be Column 0 and String. Click OK to return to the previous dialog. In the new Column 0 column add your folder paths one per row.
Next click the Variable Mappings tab from the left-hand menu, for the drop-down menu in the Variable column select New Variable. Again go with the defaults except for the name which in my example I have called dbf_path.
Next click OK to complete the For Each. Now the difficult bit for me because I don't what tasks you currently have that are working for one file. Whatever it is you have working, select it with the mouse and then drag and drop it into the For Each container.
For each task or tasks that need to use the file path do the following:
double click it to edit, in the left-hand menu select Expressions, then click Expressions and then click the ellipsis.
From the Property drop-down in the Property Expression Editor you need to find the property that would hold the file path for this task. The names are not always obvious and can be called different things in different tasks. In my example I am using a File System Task which I think is the Source Property.
Click the ellipsis in the Expression column and add an expression that consists of your path variable concatenated a string that contains the name of your file. One thing to note is backslashes have special meanings so if your string contains any they must be escaped with a second backslash.
Now when you run the package the For Each will loop through each path you have defined and store it in your variable which tasks will reference.

Need help to perform an ETL task with SSIS

I want to connect to a server using its IP address. Then, I want to execute a .sql file kept on that servers drive. I also want to store the results of this sql in a text file on the server itself. Should i execute it as an sql task or run it as an extraction from database or something else ? I am not sure how to go about it. I need tips on how to proceed.
The database used is SQL server 2008.
On SSIS, you can execute SQL and export it to text file(csv).
Please refer this article.
http://dwbi1.wordpress.com/2011/06/05/ssis-export-query-result-to-a-file/
Creating an SSIS Solution on SQL Server to flat file.
Open Microsoft Visual Studio
Click Create Project
Select Integration Services Project
Name the Project (x2)
Set the location, example C:\SSISPackages\
Click OK
Click the Data Flow tab
Click to create a new Data Flow Task
Click the Toolbox tab (bottom left)
Drag OLE DB Source to Data Flow section
Drag Flat File Destination (for example) to Data Flow section
Drag the green arrow to connect the OLE DB Source to the Flat File Destination
Double-click OLE DB Source
Click New next to OLE DB Connection Manager
Select YOURSERVER\YOURDB and click OK
Change Data Access Mode to SQL Command
Enter procedure and parameter(s) (for example) under SQL Command Text
Click Parse Query to confirm the SQL Command is valid, and click OK
Double-click the Flat File Destination
Click New next to Flat File Connection Manager
Choose Ragged Right (if standard fixed-width with CR/LF at end of each row) and click OK
Click Browse and select the destination and file name for the output and click OK twice
Click on Mappings and confirm the input and destination columns are correct, and click OK
To append the current date to the file name:
Click on Package Explorer tab (top right of center pane)
Click on Variables tab (bottom left)
Add a variable called path, Scope = Package, Data Type = String, Value = path to file (not including YYYYMMDD.txt portion of file name)
In the Properties for Flat File Connection Manager (bottom center, right-click), open Expressions, and set Property to ConnectionString and Expression to:
#[User::path]+
(DT_STR,4,1252) DatePart("yyyy",getdate()) +
Right("0" + (DT_STR,4,1252) DatePart("m",getdate()),2) +
Right("0" + (DT_STR,4,1252) DatePart("d",getdate()),2) + ".txt"
(Or however you need the date and file name formatted)
Click Evaluate Expression to make sure it looks OK.

The data set name is missing in the data region 'DataSetName'

I added an additional, new DataSet to my report and have been getting this cryptic error ever since.
The issue was that when the report had elements setup using the first data set I'd defined when the report was created. Adding an additional data set reset the DataSetName value to be blank. In this case for my Table but it could be for a List, etc.
To correct:
Open the report in SQL Server Business Intelligence Development Studio (AKA Visual Studio)
View the object details in the Properties Window (View > Properties Window or press F4)
Check the DataSetName value (under the Data section)
Update the value to point to the correct Data Set
Examine your RDLC file, open it in a XML editor. Most specifically, take a look at the Dataset section. See if there are some old ones that are still there. You can edit this file directly, but be careful what you do.
You can also attempt to run the RDLC file through a XML validator, and see if it comes up with any errors. Make sure to validate against the RDLC file's schema. (http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition/ReportDefinition.xsd)
I had a bit of trouble finding the correct properties window that contained this value, so I will add the following:
On the Layout Tab, press F4 to bring the properties box up.
In the dropdown at the top of the properties box, find your table and select it.
You should now see that data section about halfway down, along with the DataSetName property the error is complaining about.
I know this is a decade late, but this is to possibly help the next guy that is searching the internet for answers (like me).
In SSRS, right-click any unused/white area of the report then choose Select-> and the Group level (not group level content) that you are getting the error about.
In the properties window (Menu->View->Check Properties) for the Group Level, scroll down to General the DataSetName. Select the drop down arrow and choose the original dataset.