Showing posts with label sqlserver. Show all posts
Showing posts with label sqlserver. Show all posts

Thursday, March 29, 2012

Cursor type changed?

Hi,
I just posted this on sqlserver.connect since I'm not sure where it belongs.
So here goes.
We've recently began migrating to SQL 2005 from SQL 7 and have had a few
issues.
Right now we have an issue when trying to logon to the server through our
application.
'sa' login works from our application but when we try to logon as a user we
get:
"[ODBC SQL Server Driver]Cursor type changed"
I have tried logging on through Query Analyzer and that works fine for all
users so it should not be a permission issue.
I've tried to search the web high and low without really finding a solution
or cause for this error. I've seen a few a reports of people having the
same- or similar problems but no solutions.
I'd be greatful for any tips you guys and girls might have.
Thanks in advance and have a great wend.
Regards,
Tony HolopainenThis message is informational, not an error. Perhaps the application code
is treating the message as an error simply because it's unexpected.
Are you using ADO or calling ODBC directly? Do the get this message during
login or when you run a query? I wouldn't expect this to be security
related unless different results are returned depending on the user logging
in.
Hope this helps.
Dan Guzman
SQL Server MVP
"TonyH" <tony@.nospam.com> wrote in message
news:e8OWomAnGHA.4604@.TK2MSFTNGP02.phx.gbl...
> Hi,
> I just posted this on sqlserver.connect since I'm not sure where it
> belongs. So here goes.
> We've recently began migrating to SQL 2005 from SQL 7 and have had a few
> issues.
> Right now we have an issue when trying to logon to the server through our
> application.
> 'sa' login works from our application but when we try to logon as a user
> we get:
> "[ODBC SQL Server Driver]Cursor type changed"
> I have tried logging on through Query Analyzer and that works fine for all
> users so it should not be a permission issue.
> I've tried to search the web high and low without really finding a
> solution or cause for this error. I've seen a few a reports of people
> having the same- or similar problems but no solutions.
> I'd be greatful for any tips you guys and girls might have.
> Thanks in advance and have a great wend.
> Regards,
> Tony Holopainen
>

Thursday, March 22, 2012

Current User

How can get the current user name/id of the connected user in Sql
Server 2005? I am using windows authentication. If I use USER or
CURRENT_USER function it always returns DBO and I am looking for the
network sign on which in my case would be URSC. Thanks.Try the ORIGINAL_LOGIN() function.
Hope this helps.
Dan Guzman
SQL Server MVP
"S Chapman" <s_chapman47@.hotmail.co.uk> wrote in message
news:1150200242.086128.219900@.p79g2000cwp.googlegroups.com...
> How can get the current user name/id of the connected user in Sql
> Server 2005? I am using windows authentication. If I use USER or
> CURRENT_USER function it always returns DBO and I am looking for the
> network sign on which in my case would be URSC. Thanks.
>|||Try using SUSER_SNAME. See BOL for more info.
AMB
"S Chapman" wrote:

> How can get the current user name/id of the connected user in Sql
> Server 2005? I am using windows authentication. If I use USER or
> CURRENT_USER function it always returns DBO and I am looking for the
> network sign on which in my case would be URSC. Thanks.
>|||"S Chapman" <s_chapman47@.hotmail.co.uk> escribi en el mensaje
news:1150200242.086128.219900@.p79g2000cwp.googlegroups.com...
> How can get the current user name/id of the connected user in Sql
> Server 2005? I am using windows authentication. If I use USER or
> CURRENT_USER function it always returns DBO
If the user is admin, you will get dbo
Peter

Wednesday, March 21, 2012

Current Time of SQL-Server

Hi

is there a "SQL string" to obtain date and time of a SQLServer machine ?

thank uOn Mon, 15 Sep 2003 17:45:48 GMT in comp.databases.ms-sqlserver,
"Solli" <fabioslm@.tiscali.it> wrote:

>Hi
>is there a "SQL string" to obtain date and time of a SQLServer machine ?

GetDate()

--
A)bort, R)etry, I)nfluence with large hammer.

(replace sithlord with trevor for email)

Sunday, March 11, 2012

Currency Column in Report Problem

I have a column in a report which displays an amount of currency. The currency is stored in sqlserver databse as 'Money' data type.

My problem is when I run the report it rounds off the value and does not disply to any decimal places. I want it to display the currency as 2 decimal places as this is how it is input and stored in the database.

anyone know how to do this?

macca

You could format the textbox like this:

http://msdn2.microsoft.com/en-us/library/ms251684(VS.80).aspx

Find more info here:

http://msdn2.microsoft.com/en-us/library/ms252073(VS.80).aspx

Sunday, February 19, 2012

CTP3 Failure - Creating a Remote Distributor (error during decrypt

TITLE: Microsoft.SqlServer.ConnectionInfo
SQL Server could not configure 'RemoteHost\REPL_DIST' as a Distributor.
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch.
(Microsoft.SqlServer.ConnectionInfo)
An error occurred during decryption.
There is no remote user 'distributor_admin' mapped to local user '(null)'
from the remote server 'repl_distributor'.
Changed database context to 'master'. (Microsoft SQL Server, Error: 15466)
For help, click:
http://go.microsoft.com/fwlink?ProdN...LinkId=20 476
in CTP2 the following worked fine.
--OnRemoteHost
use master
exec sp_adddistributor
@.distributor = N'RemoteHost\REPL_DIST',
@.password = N'PassWord1'
GO
I get the same error when using the Wizard to create a remote distributor.
I'm and Admin on both LocalHost & RemoteHost
The RemoteHost XP-SP2 has firewall disabled.
Just looking for some clues (The help link isn't)
Cheers
Gryphyn
One of the most well-known reasons behind the error that you saw has to do
with changes in the SQL Server service account after replication has been set
up (account name and\or password). But given that multiple people have
reported similar issues with the latest CTP (April), I tend to suspect that
there is something more behind this. Unfortunately, we have so far been
unable to duplicate the error in our lab and so it would be great if you can
tell us whether any of the following apply to your scenario:
1) Was the remote distributor sevrvice account changed in any way?
2) Are the remote distributor and the publisher machines in the same domain?
3) Did you attach the old master\distribution database files to the latest
CTP server when you upgraded?
4) Are the remote distributor and the publisher running the same version of
the CTP?
5) Are the distributor and publisher SQL Server Service running under domain
accounts or local system accounts?
6) Have you ever been told to turn on certain server trace flags?
7) Are you using any virtualization products such as VirtualPC by any chance?
If you have done 3) at the distributor during upgrade, it would be
interesting to see if dropping and re-establishing the remote publisher at
the distributor resolves the issue (reseting the password etc.). BTW, we do
have newsgroups set up for everything related to SQL2005 @.
http://communities.microsoft.com/new...r2005&slcid=us
(it is fully accessible to me but may require Passport\beta account sign-up
etc. from you) which are preferred for reporting problems in SQL2005.
HTH
-Raymond
"Gryphyn" wrote:

> TITLE: Microsoft.SqlServer.ConnectionInfo
> SQL Server could not configure 'RemoteHost\REPL_DIST' as a Distributor.
> ADDITIONAL INFORMATION:
> An exception occurred while executing a Transact-SQL statement or batch.
> (Microsoft.SqlServer.ConnectionInfo)
> An error occurred during decryption.
> There is no remote user 'distributor_admin' mapped to local user '(null)'
> from the remote server 'repl_distributor'.
> Changed database context to 'master'. (Microsoft SQL Server, Error: 15466)
> For help, click:
> http://go.microsoft.com/fwlink?ProdN...LinkId=20 476
> in CTP2 the following worked fine.
> --OnRemoteHost
> use master
> exec sp_adddistributor
> @.distributor = N'RemoteHost\REPL_DIST',
> @.password = N'PassWord1'
> GO
> I get the same error when using the Wizard to create a remote distributor.
> I'm and Admin on both LocalHost & RemoteHost
> The RemoteHost XP-SP2 has firewall disabled.
> Just looking for some clues (The help link isn't)
> Cheers
> Gryphyn
>

Friday, February 17, 2012

CSV Import Problem

I originally posted this on microsoft.public.sqlserver.integrationsvcs but have received no response and now after seeing only 133 posts the entire year.... I think nobody actually uses that forum....

I created several very simple flat file (csv) import packages. For the most
part they seem to work fine. Except for one of them (actually two since a
second one is now broken).

The daily files I am trying to import are comma delimited with the first row
containing the headers. The header delimiter is set to {CR}{LF} with the
text delimiter set to double quotes.

For two days (I just wrote the package's yesterday) on one package and for
today's run on the second package, I received the same error of "Error:
0xC0202055 at Import Data, File Source[16]: The column delimiter for column
"xxxxxxx" was not found". The column specified in both errors references
the LAST column which means that it cannot find the header delimiter.

Since the second package worked yesterday but not today, and the only
changed factor is the new source file from today, it makes me think that the
problem is with the source file. Problem is that the file looks fine. I even
loaded both files (yesterday and today) into a hex editor and confirmed
that the header is EXACTLY the same... all the way to the "0D 0A" indicating
{CR} {LF}. (On a side note, the source csv files for the package that failed
both days match and also contain the "0D 0A" values.)

Any ideas?

Thanks,
Jason

One idea is to use the Error Output on the Flat File source and set it to redirect rows. Hopefully, redirected rows will give you a clue of where to look for the missing delimiter.

HTH.

CSV Exporting SSMSE (Text Identifier)

I just updated to SQL Express SP2 per this Feedback item:

https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=132806

But I don't see an option to use quoted identifiers. Is it not included in the Express version?

I thinnk that is set on a database level. (And the 'default' condition is [ ON ].)

To change:

ALTER DATABASE MyDatabase

SET QUOTED_IDENTIFIER ON