Quantcast
Channel: SQL Server Data Access forum
Viewing all 4164 articles
Browse latest View live

Grant user access to a single Database

$
0
0
Hi, i have a SQL 2012 server with multiple DBs.
I want to grant a Domain user access to query 1 single DB.
I have granted the user public access to the DB.
When he logs on to SQL management studio he can see all the DBs but has no access to them.
Is there a way to prevent him from seeing all the other DBs?
Is public role the right role if i only want him to be able to query? not delete, modify anything?
thanks

About SQL Server Authentication Error.

$
0
0
Dear sir,

      I am trying to connect with SQL server 2005 with server authentication but I get an error --

Login failed for user '' ". The user is not associated with a trusted SQL Server connection.

I am already performed following steps ----

"Go to Start > Programs > Microsoft SQL Server 2005 > SQL Server Management Studio 
Right-click the Server name, select Properties > Security 
Under Server Authentication, select SQL Server and Windows Authentication Mode"
login --enabled.

 Please provide me appropriate solution . 
--
Thanks in advance.

Invalid OLE DB provider name specified

$
0
0

Running Windows XP on desktop pc.  Several users use this pc to sell tickets.  (Ticketing system called Tessitura)  Connecting to a domain.  One user cannot connect to the database.  He gets the following error:

Connect Error

Security Check Not Done.  Cannot connect to the Database !

Error:

Invalid OLE DB provider name specified.

I have tried to delete the user and recreate him on the pc. but it still doesn't work.

Any suggestions?

Cannot display Chinese characters inside SQL Management Studio

$
0
0

Hello,

My issue is as follows.

I am using SQL Server Management Studio 2008 to connect to a Dynamics NAV 2009 Database containing Chinese characters.

Chinese characters are displaying fine inside NAV but are not displayed correctly inside SQL Mgmt Studio.

ex: ¸ñµÇÑÇÊýÂëÓ°ÏñÖÆ×÷£¨ÉϺ££©ÓÐÏÞ¹«Ë¾

I get the same issue when retrieving data in 3rd party software (Qlikview) using OLE DB or ODBC.

I have tried the following solution:

http://www.microsoft.com/middleeast/msdn/CPDTS.aspx

following this blog post:

http://sqlug.be/blogs/steves_sql_blog/archive/2007/06/13/import-chinese-charachters-using-cpdts-dll.aspx

But the link to the dll on MS website is dead.

Has anybody any idea on how to solve my problem ?

I have all the asian language packs installed and my region and language settings are correct.

Thanks

The DBComms.receive operation resulted in an invalid packet header type:-86 PktNum:0 nReceived :8

$
0
0

I am getting this below errors occasionally .  Could any one suggest on this how to resolve this kind of issues and what might be the root causes for this error

Error as below

----------------------

TestTag:doEndTag(),0,The DBComms.receive operation resulted in an invalid packet header type:-86.  PktNum:0.  nReceived:8.
**16-mrt-2013 9:59:16,JSP Runtime Error,0,javax.servlet.jsp.JspException: The DBComms.receive operation resulted in an invalid packet header type:-86.  PktNum:0.  nReceived:8.
at com.test.tagSupport.TestTag.doEndTag(TestTag.java:39)..

awaiting for the responses. quick response will be appreciated.

-thank you.....

connect to existing database in VS 2012

$
0
0

I have a project in VS 2010 that connects to a SQL Database. I have moved my sql files and project to a laptop. In VS 2012 you can create a database by going to the SQL Server Object Explorer and right clicking "DataBases" and click "Add New DataBase", there is no option to connect to an existing database.

In my instance I need to connect to a database that already exists. How do I do that?

SQL Server Management Studio cause ADO error?

$
0
0

When I start SQL Server Management studio, then use Visual C++ & ADO to connect to SQL Server and insert a lot data(about 10, 000 records), then sometimes, not all records can be inserted, for example, maybe only 9, 000 records are inserted.

But if I close SQL Server manaagement studio, then try again, then I can insert all 10, 000 records without problems.

Is there any problems in calling ADO when management studio is opening and accessing the database?

Thnks

Timeout expired!!

$
0
0

Hi guysHope you guys have some advise for me. we've a windows app (C# 2008 connecting to sql 2008) we get following error randomly

Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.

i traced it to a call one particular stored proc but i dont see any problem. we spent enough time on this stored proc to speed it up and nothing further can be done. so issue got to be something else. Yes this stored proc can access quite few records (around 200,000) but between calls no of records it access is same. why error only sometime!?

BTW its a terminal server and applications is installed on one server and database is different server. our sample code below(last line causes error)

SqlConnection connection = new SqlConnection("some connection string");
SqlCommand command = new SqlCommand("someproc", connection);
command.CommandTimeout = 300;
connection.Open();return command.ExecuteReader(CommandBehavior.CloseConnection);
i already checked other threads similar to this one but did not help me. how would you troubleshoot this ? this error i cant replicate on my pc.




prk

Error: Cannot create new connection because in manual or distributed transaction mode.

$
0
0

Hello

I am getting this error:

-2147467259

Microsoft OLE DB Provider for SQL Server

Cannot create new connection because in manual or distributed transaction mode.

When executing this classic ASP code:

					On Error Resume Next
					objConn.BeginTrans
					objConn.Execute "EXEC sp_Name ...", , adCmdText + adExecuteNoRecords
					objConn.Execute "UPDATE table_name ... ", , adCmdText + adExecuteNoRecords
					If Err Then
						objConn.RollbackTrans 
						WriteError  Err.Number & " " & Err.Source & " - " & Err.Description
					Else
						objConn.CommitTrans
					End If
					On Error Goto 0

I have read the MS article specifically for this issue, SQLOLEDB Allows Only One Connection in Scope of Transaction, but it references statements that are returning recordsets using a forward only cursor.

My stored procedure is doing one INSERT to a table with no triggers or anything and the second command is a simple update, again to a table with no triggers or similar.

In both cases I have specified the execute enum of adExecuteNoRecords, so it should know there is no rowset coming back anyway. The stored procedure starts with "set nocount on", which I know has caused some issues with ADO in the past.

I understand SQL server maybe creating an implicit connection somewhere, but goodness knows why.  I don't need MARS for this, surely?

Can anyone help me understand why these insert and update commands are falling over each other and raising this error?

Connection String:

Provider=SQLOLEDB.1;Password=password;Persist Security Info=True;User ID=user_id;Initial Catalog=db_name;Data Source=server_ip;Network Library=DBMSSOCN;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=HVAW23;Use Encryption for Data=False;Tag with column collation when possible=False;User Id=user_id;PASSWORD=password;

Thanks and regards

David

BCP '-C' option not supported

$
0
0

Hi, 

I have bcp version#11.0.1790.0 installed in Linux machine. I want to "bcp in" data to SQL Server from a data file. My data file is in UTF-8 format and I want to load the data to sql server in ISO_1 format. For this I tried using -C option which is used to specify the code page. But bcp says : -C option is not supported in this release. >

Is there any alternative for the -C option. Is there any specific reason that -C option is not supporeted in bcp for linux but supported in bcp for Windows?

Thanks,

Manoj



How can i make my SQL Server 2012 express edition Online

$
0
0

Hello friends,

I need some help, I have developed an application that clients would be accessing all around the world and it needs to be connected online to a database that is created using MS SQL 2012, I have researched various area of the internet and have failed to get the exact information!

How can i make a SQL database show online so i can connect my application to the database via the internet?

I have created my application using .Net (VB.Net), and i am aware of Microsoft Azure but thinking about the costs so thought if i can have my own SQL hosting option.

I currently have Windows Server 2012 and SQL Server 2012 Express Edition installed, Please guide me if you have any idea's of thoughts that would help me solve this query?

Thank you

SQL Server error 53 How do I find my server name to connect to server

$
0
0

I am new to SQL Server 2008 Developer edition for class online. I do not know my computer name/ server name to connect to server to start a database project. Please help me to find the info to open the database. Assignment due 4/5/2010. My computer is a Dell wireless laptop with Windows XP Home edition. I am getting error 53 and 40. Cannot connect to server and named pipes provider.

The error message I got was: ...A sever was not found or accessable. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (Provider: Named Pipes provider error 40- could not open connection to SQL Server). (Microsoft SQL Server error 53).

I know what I named my computer but I don't know if that is the name I use to connect to the Server and I don't know what the server name would be. Where would I find that and what do I enter into the dialog box to establish a connection? I have not set up any database or server in the Database Engine or other areas of this program. This is a brand new copy I purchased and installed recently.

OpenDataSource statement issued with a error.

$
0
0

Hi All:

I transfer some data cross server. I use the following code open and close those components:

1st step:

        exec sp_configure 'show advanced options',1 
reconfigure
exec sp_configure 'Ad Hoc Distributed Queries',1 
reconfigure;

        2nd step:

        SELECT * into dbo.Users FROM OPENDATASOURCE('sqloledb','server=sererIP;uid=userID;pwd=userpwd').mydb.dbo.Users where UserName='SuperUser';

        3rd step:

       exec sp_configure 'Ad Hoc Distributed Queries',0 

reconfigure 
exec sp_configure 'show advanced options',0 
reconfigure    

        The problem  is:

        I seperately execute each step. it works fine. but execute those three steps together, It issued with:

Msg 15281, Level 16, State 1, Line 8
SQL Server blocked access to STATEMENT 'OpenRowset/OpenDatasource' of component 'Ad Hoc Distributed Queries' because this component is turned off as part of the security configuration for this server. A system administrator can enable the use of 'Ad Hoc Distributed Queries' by using sp_configure. For more information about enabling 'Ad Hoc Distributed Queries', see "Surface Area Configuration" in SQL Server Books Online.

        I will use these code in my C# program.

        Thanks advanced.

Jarry

          

Executing Command Error-Incorrect syntax near 'F1A04'

$
0
0

hi,

I am retrieving the Sql Data Base from c#,connection opens fine but while executing the command I facing a problem




Please don't forget to Vote and marked as answer If this post answers your question or was helpful, please click "Mark As Answer" on the post and "Mark as Helpful" Be wise

JDBC: PreparedStatement.getParameterMetaData() does not work when the SQL contains embedded newlines

$
0
0

Consider the following table

create table foo 
(
    id integer not null primary key, 
    some_data varchar(100)
);

Now the following Java Code:

PreparedStatement pstmt = connection.prepareStatement("select * \nfrom foo \nwhere id = ?");
ParameterMetaData meta = pstmt.getParameterMetaData();

will throw an Exception:

com.microsoft.sqlserver.jdbc.SQLServerException: com.microsoft.sqlserver.jdbc.SQLServerException: Unable to identify the table select *
from foo
where id = ? for the metadata.
 at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:190)
 at com.microsoft.sqlserver.jdbc.SQLServerParameterMetaData.<init>(SQLServerParameterMetaData.java:426)
 at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.getParameterMetaData(SQLServerPreparedStatement.java:1532)

When the embedded newlines are removed from the SQL, the call works.

The driver version is: 4.0.2206.100
SQL Server Version is: 11.00.2100
Java Version is: 1.6.0_31
Windows 7 64bit


Format number in ODBC

$
0
0

Hi

Within an ODBC query I'm tring to convert a date to a year and week number. 

e.g. 201201 which is year = 2012 and week = 01

The query below is close.  It would return 20121  where 2012 = year and 1 = week.

WHERE        (coy = 1) AND (to_char(rejdttime, 'YYYY') + { fn CONVERT(WEEK(rejdttime), SQL_VARCHAR) } >= ?) 

How do I convert the week from 1 to 01

I would really appreciate some help.

error using linked server query via web site

$
0
0

I have a linked server configured in SQL server 2008 to get data from an Access 2010 database.

I can query the data fine in sql server and in a visual studio sql datasource object using a query like this:

 

Select * from openquery (MyACCESSDB, 'SELECT * FROM Users')

But when I run the web site, when it tries to query, I get this error:

A critical error has occurred.Cannot initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "MyACCESSDB".

As soon as I change the query to not use the linked server in the query the web page  loads fine.

 

Any help appreciated

I assume it is some sort of permissions problem.

 

Linked Servers ?

$
0
0
Hello, i've been researching a "Linked Servers" approach for the last few weeks so i/we can create a "joint" SQL query between MS SQLServer and Oracle and from most of the posts i've been able to find it sounds like this "Linked Servers" approach is a viable option, but in talking with my manager yesterday he is saying that the idea of using a "Linked Server" approach in order to create a "joint" type query is "problematic".

Can you as a SQLServer expert who is familiar with "Linked Servers" somewhat give me your best assessment of where you think this "Linked Servers" technology is at this particular time and what you might use as an alternative to a "Linked Server" as a way to do a "joint" query between SQLServer and Oracle pleae?

Thanks for any insights of any sort!
BobK

Cannot fetch a row from OLE DB provider "OraOLEDB.Oracle" for linked server "Linkedservername".

$
0
0

Hi Folks,

            When i ran the following query (select * from openquery([Linkedservername],'select * from ps.courses')) on my linked server i am getting the this error:

The OLE DB provider "OraOLEDB.Oracle" for linked server "HP UE PS" reported an error. The provider did not give any information about the error.

Cannot fetch a row from OLE DB provider "OraOLEDB.Oracle" for linked server "Linkedservername".

Any One faced this type errors please share your exp with me and how you have resolved.

Thanks In Advance

Siva.

Can we pass table column and table name as a parameters to stored procedure?

$
0
0

Hi,

Can we pass table column and table name as a parameters to stored procedure?

i need to Create a procedure like this

Create procedure dbo.sp_getGetResults
(@tablecolumn nvarchar(max),@tableName nvarchar(max))
as
begin

          -- business logic

end

Viewing all 4164 articles
Browse latest View live