SSRS Not Displaynig Columns and Values - sql

I'm practising SSRS and I'm having an weirds issue.
I'm creating a simple query where it returns 3 columns from the Product table from the Adventure Works Database.
However, the column and rows are blank. I then created another rdl, this time with the Wizard and it's working fine.
When I run my query in the query editor, the information is displayed.
Any ideas?

I believe I found the answer.
Resizing the table seems to refresh something and the values are not been displayed.
Really weird bug. I had tried before, deleting and adding the table, closing Visual Studio, creating a new RDL.

Related

invalid data is getting inserted in table in sql server database

I faced a situation and also searched for it in the internet but could not be able to get any solution.
Problem
My sql server table has 15000 records. It has several columns.
Among all the records, the 'Email ID' column of one record is storing value along with an unidentified character at the beginning. (Please refer to picture attached)
What I want
I want to get rid of that character using sql query. I am using sql server 2012 version.
I tried with 'replace()' and 'patindex()'. I even tried 'stuff' function.
But, its not working. Instead, when I am fetching the data using query, it is showing that typical character.
Please help me with some ideas. If I need to do some settings in database or table, I am ready for that.
Thanks.

Access Form Textbox as Input query to ODBC source returns empty dataset

I have an Access 2010 utility that is designed to query an Oracle DB via ODBC connection as Linked Tables. I created a simple form with two textbox's and a command button. The command button launches VBA code "DoCmd.OpenReport".
The report query Where clause looks like this:
WHERE (((PRODLAW_ITEMLOC.LOCATION)=[Forms]![frm_Qry_ByItem&Loc]![txtLocation]) AND ((PRODLAW_ITEMMAST.ITEM)=[Forms]![frm_Qry_ByItem&Loc]![txtItem]));
the values of txtItem and txtLocation are the user supplied values from the form.
This returns an empty dataset as it is now. If I query a local table, (using a single ODBC query to extract all possible values into a single local table) this method works without any issue other than the 8-10 minutes it takes to refresh the local table. If I replace the query criteria "[Forms]![frm_Qry_ByItem&Loc]![txtItem]" with a simple direct value like "1234" (assuming 1234 is a valid item number), it works without issue.
I've tried to explicitly convert the value of the textbox like "Cstr([Forms]![frm_Qry_ByItem&Loc]![txtItem])" but it made no difference. As this is a query, I can't simply create a breakpoint and examine the properties of the variables so I'm left scratching my head. I've spent hours searching SO and other sites for clues but found nothing related.
Please advise. Thanks!
mfc

How to edit SQL records using Select statement

I got like 2000 rows of data, when I do select statement I can narrow my query but I cant change any value, as I have to change 50 columns, I dont want to use Update Command as then because values I have to update for each row is unique.
Anyone knows any easier way of selecting data using select command and then edit it.
EDIT
I just went to SQL Management studio, clicked on DB I am working on then find the table, I right clicked on it and then it says "Select top 1000 rows" so Now I can see the query and the data, I added "Where" into query and got what I wanted, but I cant modify the table rows below :S
*Edit 2 *
Or I can develop a Utility that will take Table Name , Column Name and its New value and simply updates it :)
You modify data using an UPDATE statement (with a WHERE clause) in a query window. While Management Studio has a feature called "Edit Top n Rows" that doesn't mean it's a good idea to use it - there are several behavioral bugs that are still unresolved even in the SQL Server 2012 version, and it can also place unnecessary and prohibitive locks on the underlying table.
I know it's not the answer you want to hear, but please become comfortable with proper DML commands. The documentation for UPDATE is found here:
http://msdn.microsoft.com/en-us/library/ms177523(v=sql.100).aspx
The long and short of it, IMHO: If you can identify the rows you want to update by using a SELECT with a WHERE clause, you can also write an UPDATE query using the same WHERE clause.
In SSMS - in the same place you saw "Select top 1000 rows", there should be another option "Open table" or "Edit top 200 Rows" (by default).
If you did that on a table, then pressed the following button:
You should then by able to paste in your select statement you've already written instead of what is there, press the execute button (Red exclamation mark button). The grid that appears is editable.
In general I'd be inclined to agree with #AaronBertrand though, it's better to learn the syntax to Update statements yourself.
If you have Microsoft Access, you can create a linked table to your sql server database and edit it by opening the table and modifying the relevant rows. You can create a query in Microsoft Access as well limiting the rows you want to return, and then you can inline edit the columns you'd like to change in the result set.
See for example here how to create a linked table to SQL Server.

"string or binary data would be truncated" when deleting row

Im using Microsoft SQL Server Management Studio Express to connect to our SQL Server 2005 (think its 2005, its version 9.000 something something). I have a table with one column that saves a lot of text. I have set the column type to text. When i have a row with lots of text in this column i cannot delete it. I get the message "string or binary data would be truncated" when i try to delete it. If i try to edit the row i get the same message. What do i do?
Considerable : i fix it by drop table and create it again, but i wanna a Solution!
Though I'm late to the party, when I review the original poster's description of the problem, it sounds like they are trying to delete the row from within the table editor interface. I just encountered this same issue with a table containing a "text" column with long text, and it appears that the issue may in fact be tied to a limitation in the editor itself. From my own investigation, it appears that you will not be able to edit a row in which a text column exceeds 4000 characters. I tested with SSMS 2008 R2.
Hopefully this will help anyone else encountering this error.
I had same problem and solved ...
after selecting top 200 row of your table, click the "Show Criteria Pane"(left side of toolbar)
now uncheck your ntext column (the column holding a big text you was talking about)
now you can delete or update any row :)
Normally this kind of error happens when you're inserting a long value into the column that can't store it. Check whether you don't have any triggers or any related logic that could do that on your behalf when you're deleting the row (e.g. for logging purposes / audit trail)
I changed my data type to nvarchar(MAX) and was able to edit and delete as I saw fit.
I discovered there was a trigger that audited changes to the record (thanks Tomas Vana), but the target audit record had a limited varchar field for the action report (varchar(1000)). It was trying to audit the deletion of records that had varchar(max) fields...duh!
I changed the action report field in the log to varchar(max) and that fixed it...
bloody obvious really...:)

Ms-Access Query is getting deleted automatically. What can be the reason?

Some of the queries I have written inside MS-Access are getting deleted automatically. And while I run the queries through code, I get this error:
Query should have one destination field
What can be the possible reason?
Explanation: I created a query in MS-access. Ran it from the code. Closed the database. Started it again, and now for that particular query, it is showing 'SELECT ;'only.
Strange. I am in panic mode now
Check if your query actually has any fields in the query design grid. When you open the query in design view, you will most likely notice it doesn't.
Does the query stick around when you don't run the code (but still close and reopen the database)?
If so, I would suspect that something in your code is overwriting the query.