Intellisense not updating in Sql Server - sql-server-2008

Given:
A table named Table1 that has the following columns:
ID
ColumnA
ColumnB
Typing Table1. in Microsoft SQL Server Management Studio provides me with a list of columns for that table.
Scenario:
I open up Table1 in the design view and add ColumnC to it. I save Table1 and refresh it to see the new column, Column3 show up in the Object Explorer.
Going back to the Query Window, I type Table1. but Column3 is not available to be selected. Typing it out gives me a syntax error but running a query with the column in it works as expected.
Is there a menu item somewhere that I need to click to get Intellisense to pick up the DDL changes I have made?

Edit -> Intellisense - Refresh Local Cache
That should do it.
Ctrl-Shift-R is the shortcut.

In addition to refreshing the cache you also need to do the following if you haven't already:
Go to Tools >> Options >> Text Editor >> Transact-SQL >> General >> IntelliSense
Check the box Auto List Members and also the box Parameter Information save and restart.
I also highly recommend the Redgate SQL Toolbox if you regularly use SQL Server. SQL Compare and SQL Data Compare and the SQL Prompt5 have saved me lots of time in development.

I have to restart management studio when this happens. Refreshing object explorer doesn't update the intellisense.

Related

Insert Into using Microsoft SQL Server 2008 R2

I am tryng to insert a new user into a simple table that contains ID and Name.
This is the query that I execute:
INSERT INTO [dKArchive].[dbo].[Logins]
([IDL]
,[Name])
VALUES
(37
,'pippo.paperino')
GO
I am using Microsoft SQL Server Management Studio.
After executing query, the value is added in the table, after when I close the Microsoft SQL Server Management Studio and reopen it, this data disappears.
Why does it happen?
Thanks. Best regards.
Second attempt at answering:
SSMS has an option to set that every query is a transaction. You find this under
Tools...->Options->Query Execution->SQL Server->ANSI->SET IMPLICIT_TRANSACTION
If this option is on, you will get something close to the behaviour you describe. However, when closing SSMS, you will get a warning about uncommitted transactions. Ignoring this warning is not a good idea.
At that time, you can click Commit and all is well, or you can just turn off this option.

SSRS dataset not refreshed after changing MySQL stored procedure

SSRS dataset not refreshed after changing MySQL stored procedure.
I created an SSRS report in which the dataset gets data from MySQL stored procedure. In this scenario the output is generated correctly and so is the report.
Later I modify some content in the stored procedure. I run the stored proc in query designer. In query designer it gives the correct output.
But when going to report if I see the report in preview tab it gives old values. Changed are not coming in presenting report.
Please tell me what's wrong.
Try deleting the MySolution\MyProject\MyRDL.data file -- BIDS caches fairly aggressively.
This is a bug in Visual Studio i think it happens to me as well. Usually closing the report in Visual studio and reopening helps.
the report may be cached on BIDS for a few moments.
re-open it and it should be fine
I TESTED IN VS2012
Note :
1. Go to your Report designer
2. Remember(or copy somewhere) your (A) Data Source Name and (B) Data Sets Name
Now Step 1:
In the Project Solution Explore Delete the Data Set (same name as in Note(A) Data Source Name
) Don't Worry Nothing will bad on your report :)
Step 2:
open the Report data tool of your report
Step 3:
* Select dataSet --> Right Click ----> Select DataSet Properties
* In " data source" click on NEW button---->Next---->
* Select your table/sp/views/-----> Put the Data set Name as:(Note 2. Remember your (A) Data Source Name )
Now Finish... :) now you can get your Newly added field in SP
NOTE : ONLY REMEMBER your old data source and dataset name
Thanks, enjoy ...
Regards,
SRSahoo#gmail.com
Also be sure it's the report and not you.
I switched the sorting fields in the dataset and they weren't changing in the report preview because I didn't change the Grouping.

Drop table in Sql Server by Sql Server Management Studio

I deleted a table in SQL Server Management Studio. And then I created a new table with the same name. But the error said that the table has already exists. I want a new completely table with the same name.
Edit: Added more answers after comment.
Are you removing the table from the database diagram or from the object explorer? If you are removing the table from your database diagram using Visual Database tools, it will still exist in the database.
From MSDN:
The table is removed from your diagram but it continues to exist in
the database.
OR,
Try going to Tools->Options->Designers and unchecking the box that says "Prevent saving changes that require table re-creation". Then try deleting and creating the database.
OR,
Delete the table. Close MS SQL Management Studio. Open MS SQL Management Studio again. Create table.
Old Answer
Are both statements
in the same batch? From the Microsoft support page for DROP TABLE:
DROP TABLE and CREATE TABLE should not be executed on the same table in the same batch. Otherwise an unexpected error may occur.
If this isn't the case I'll try to help otherwise. If I can't help otherwise I'll just delete this answer.
Basically you have one of it open in tab where you get new table...
Steps
Close all the tabs
When no tabs are open
Create you table
And there you are.... It worked for me rather than creating the whole database again.
Clock on Tools -> Options -> Designers -> UNcheck Prevent table changes from table re-creation check box.

SQL Server 2008...scripting data

I have a SQL Server 2008 db. It contains some great test data...a proposal that has a lot of child records. I want to script this Proposal so as not to re-enter the data for each new environment. Is there a way to script the data in the proposal as well as all the dependent tables. I can run a query to get the data but what I really need is a set of SQL Insert Statements to insert the data into the new environments. At least that's what I think I need. Any ideas?
Several options for this exist.
If you're a DIY person and want a manual option with no support, check out Vyas' script:
http://vyaskn.tripod.com/code.htm#inserts
CodeProject article:
http://www.codeproject.com/Articles/5598/Generating-INSERT-statements-in-SQL-Server
Red Gate SQL Compare (to build the schema in the destination) and Data Compare (to pump data over there after the tables are created):
http://www.red-gate.com/products/sql-development/sql-compare/
SSMS Tools Pack:
http://ssmstoolspack.com/Features
If you dont want to use 3rd party stuff, you can pretty much achieve this with SSMS out of the box, simply right click the database, hit "Generate Scripts", follow the wizard, on the options step, set "Script Data" to true (or, if your using 2012, set "Types of data to script" to "Schema and Data").
http://msdn.microsoft.com/en-us/library/ms178078.aspx
http://msdn.microsoft.com/en-us/library/ee210523.aspx

SSIS package creation for integrating MSSQL and MySql dbs

I am trying to create an SSIS package for integrating between MSSQL and MYSQL. I have no prior experience of working with Bids or SSIS and following the instructions from here.
I added the OLE DB Source, Lookup, Conditional Split, OLE DB Destination and OLE DB Command components to the Data Flow and configured the connection managers and column mappings upto the Conditional Split component.
From here, I am facing two problems -
1) After configuring the OLE DB Destination, it shows error symbol on the component that says could not convert between unicode and non unicode string datatypes. To solve this, I tried to insert a Data Conversion Component between the Conditional Split and the Destination and configured it for the problematic column. But that doesnt seem to help
2) While configuring the OLE DB Command, the right hand side column in Column mappings tab shows zero columns. I have added the Sql command with question marks so i guess it should be showing columns named "Param_0", "Param_1" etc if i am not wrong. I even tried to add them manually from the input and output properties tab but then it shows the warning, external columns for OLE DB command are out of sync with data source
What am I missing here ?
Thanks
The way you describe your first problem, it sounds like it should work. Here are a couple of things to check.
The data conversion component creates a new column for the converted data. Make sure you are referring to it in your following transformations and destination.
Right-click on the Data Conversion component and select Advanced Editor. Select the Input and Output Properties tab in the Advanced Editor. Expand the Data Conversion Output branch of the tree-view and select your new column. Ensure that the Data Type Properties show the data type that you want to convert too. If these values are not right then something is not right with the setup in the component.
For your second problem, the issue can frequently be caused by an error with the SqlCommand value. First, make sure the Connection Manager is correct on the Connection Manager tab. Switch to the Column Mappings tab. Near the bottom of the form, there may be a warning message that indicates that the SQL statement cannot be prepared. In other words, SSIS can't figure out what the statement is supposed to do. Address any problems with the SQL statement and switch back to the Column Mappings tab. The columns will appear once the SQL statement can be parsed.
If you want to avoid the conversion issues then change your destination table column types from char/varchar to nchar/nvarchar. I'm pretty sure you will need to use an ADO connector for mysql source and destinations, you should be able to read data from the mysql source and write to the mssql database w/o using anything other than source and destination components.