Showing posts with label t-sql. Show all posts
Showing posts with label t-sql. Show all posts

Tuesday, March 20, 2012

Odd characters added to T-SQL Automatically

I am using Reporting Services 2000 and therefore VS 2003 and am having a problem editing the T-SQL query in the data view of Visual Studio.

Basically if I manually edit the T-SQL query or touch anything in the designer view of the query I get odd characters added in the T-SQL and the query no longer works. I have tried re-installing VS2003 and RS 2000 but it's still happening.

FYI I also have SQLServer 2005 and VS 2005 on my machine as all applications we develop are in .Net 2.0 and 3.0. We only use VS2003 for RS.

Does anyone have a clue how to fix this? Thanks

the characters being added are highlighted below:

... tablename left outer join (select ...) aliasname

WITH ?刓 ? 凶掱凸?凴?凳?刓 ? 凶?凴 凴 凴?刓  凲 ? 凶莊凴?凲?刓?刓 ? 凶?凶?凸?凴?凲 ? 凶?凳?刓?Ф??  膋?

on tablename.column = aliasname.column ....

If I manually delete the highlighted section it puts it straight back in. I now can't edit any of our reports at all as its doing this to all of them. Help!

Wednesday, March 7, 2012

ODBC SQLBindColumn to a T-SQL variable not working

Hello,

I am trying to get the count of records in a file in a single round trip to the server. I tried T-SQL code similar to below and used SQLBindColumn to bind to argument #1. The code executes without error, but the result is never returned.

Any ideas what I am doing wrong?

Thanks!
CB

DECLARE @.i AS INTEGER
SELECT @.i COUNT (*) FROM A_4000.dbo.ADRE_ADU WITH (NOLOCK)

This code generates an error for me, but that is because you are not actually assigning the value of the count to the variable. Try this:

Code Snippet

DECLARE @.i AS INTEGER

SELECT @.i = COUNT (*) FROM A_4000.dbo.ADRE_ADU WITH (NOLOCK)

|||Sorry that was a typo. I do have the equals sign. When it does run, the C variable that I bind to the SQL variable i with SQLBindColumn() doesn't contain the value after SQLExecute().

ODBC SQLBindColumn to a T-SQL variable not working

Hello,

I am trying to get the count of records in a file in a single round trip to the server. I tried T-SQL code similar to below and used SQLBindColumn to bind to argument #1. The code executes without error, but the result is never returned.

Any ideas what I am doing wrong?

Thanks!
CB

DECLARE @.i AS INTEGER
SELECT @.i COUNT (*) FROM A_4000.dbo.ADRE_ADU WITH (NOLOCK)

This code generates an error for me, but that is because you are not actually assigning the value of the count to the variable. Try this:

Code Snippet

DECLARE @.i AS INTEGER

SELECT @.i = COUNT (*) FROM A_4000.dbo.ADRE_ADU WITH (NOLOCK)

|||Sorry that was a typo. I do have the equals sign. When it does run, the C variable that I bind to the SQL variable i with SQLBindColumn() doesn't contain the value after SQLExecute().