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

Login failed for user. Microsoft SQL Server, Error: 18456

$
0
0

Hi,

I have a windows 2008 with SQL Server 2008 R2 VM on Azure. I am trying to connect to the SQL server for the first time using SSMS, but have not been able it. I have a VPN tunnel, so I am connecting using Windows authentication. The error I get back from SSMS is:

Login failed for user 'domain\username'. (Microsoft SQL Server, Error: 18456)

In the event viewer I see this error message:

Login failed for user 'domain\username'. Reason: Token-based server access validation failed with an infrastructure error. Check for previous errors. [CLIENT: <local machine>]

I have done the following:

- created an endpoint for port 1433

- opened port 1433 in the firewall

- Ran the MSSQLSERVER service as the build-in users Network Services, Local System, and Local Service, and as a local and domain administrator, with the same exact result each time.

- I get the same result trying to connect locally or remotely.

- I get the same result trying to connect using sqlcmd.

- None of the suggestions in the related worked.

Any thoughts on how I can resolve this issue?

Thanks,

MH


OLEDB provider VFPOLEDB for linked server returned message "Invalid path or file name"

$
0
0

Hello,

I'm hoping someone can shed some light on this.  I'd researched this error for days, reading all the post in this forum, however none of them address my issue.

We use VFP 9 .dbf tables (free tables).  I setup a linked server to query the tables.  As first we were not able to view the tables in SQL Server Mgmt Studio (MSMS) until I sorted out the permissions.  I can query the tables if I copy over to the server so they are local tables.  However, across the network I am continually getting the error above and the following error:

"Cannot initialize the data source object of OLE DB provider VFPOLEDB for linked server XXX."

Here are the steps I've performed...

  1. Installed a 32 bit instance of SQL Server Express 2008 R2 using Windows Authentication on server 2 (the 64 bit instance could not see the VFP OLE DB provider, as we all know, because the provider is only 32 bit)
  2. Installed the latest VFP OLE DB from http://www.microsoft.com/en-us/download/details.aspx?id=14839.
  3. In the VFPOLEDB provider, I enabled Nested queries, Level zero only, Allow inprocess, and Supports 'Like' operator.
  4. Setup a linked server using the following query:
    EXEC master.dbo.sp_addlinkedserver
    @server = N'LinkedAC',
    @srvproduct = N'Visual FoxPro 9',
    @provider = N'VFPOLEDB',
    @datasrc = N'"\\server1\share\TIW\KOKAC"',
    @provstr = N'VFPOLEDB.1'
  5. At first I could not view the tables when expanding default>Tables, it failed due to a "catastrophic failure".  That can't be good ;-).  After digging around, I surmised it was because I'd set the SQL Instance to run as NT Authority\NetworkService.

  6. I created a new user, LinkedVFP, and added to the SQL Instance (using Windows Authentication), mapped the user to the master database with the db_datareader role.  I also added the LinkedVFP user to the network share.  I was then able to browse the tables in MSMS and query the data when local, but still not across the network.

  7. I'm using Crystal Reports to try and query the data from my local workstation using SELECT * FROM OPENQUERY(mylinkedserver, 'select * from table1').  This produces the two errors I mentioned above.

To clarify, the VFP tables are on server 1 and the linked server is on server 2.  I've read about service account delegation, but unclear if this is the issue.  I went into our domain controller (neither server 1 or 2), AD User and Computers, and for server 2 I enabled 'Trust this computer for delegation to any service (Kerberos only)'. 

Can anyone shed some light on this for me?

Thanks!





Aaron McVanner


Remove 0's after decimal.

$
0
0

Hi,

I have column value which returns values something like  123456.78 . This is sales information. I want the value to be returned something like this.

"123,456". No 0's after decimal. The datatype for field stored in DB is Money.

Can you any one help me here?

Thanks

Vikram

Sql DataAccess With Visual Studio !!

$
0
0

Hello Guys !!

Plz Help Me Im New Here ...

I Want To Make Desktop Data Application In Visual Studio With Sql Server Database ...
Any One Help Me And Tell Me Some Good Sites For Learning..

Thank You...

Group by slow - how to improve performance when we use group by

$
0
0

Hi,

We are using this query to select the records, but it take more time, we have 26415140 records in Table.

Select DisplayName, Count(*) AS Results from Table group by DisplayName

Please suggest better way.

Thanks,

Identity Insert with SQLOLEDB from Perl

$
0
0

I have a simple code sample here which throws an error on the SQL INSERT statement. It creates a table with a single integer identity column and then tries to force a value into it. My real world problem is more complex, but this distills the error I'm getting. I can run the SQL statements from SQL Server Management Studio into the same database using the same credentials without issue.

use DBI;
use strict;
use warnings;

my $SQL_dbh;
my $SQL_sth;

my $tb = "testtb";
my $cnstr = "DBI:ADO:Provider=SQLOLEDB.1;
             Persist Security Info=False;
             User ID=<user id>;
             PWD=<password>;
             Initial Catalog=<database>;
             Data Source=<instance>;";

$SQL_dbh = DBI->connect($cnstr) || die "$DBI::errstr";

$SQL_sth = $SQL_dbh->prepare("create table $tb (col1 int identity(1,1))") || die "$DBI::errstr";
$SQL_sth->execute() || die "$DBI::errstr";

$SQL_sth = $SQL_dbh->prepare("set identity_insert $tb ON") || die "$DBI::errstr";
$SQL_sth->execute() || die "$DBI::errstr";

$SQL_sth = $SQL_dbh->prepare("insert into $tb (col1) values (4)") || die "$DBI::errstr";
$SQL_sth->execute() || die "$DBI::errstr";

$SQL_sth->finish || die "$DBI::errstr";

The error I get is:

DBD::ADO::st execute failed: Can't Execute Command 'insert into testtb (col1) values (4)'

  Package    : DBD::ADO::st
  Filename   : C:/Perl64/site/lib/DBD/ADO.pm
  Line       : 1244
  Last error : -2147217900

OLE exception from "Microsoft OLE DB Provider for SQL Server":

Cannot insert explicit value for identity column in table 'testtb' when
IDENTITY_INSERT is set to OFF.

Win32::OLE(0.1709) error 0x80040e14
    in METHOD/PROPERTYGET "Execute"

        Description : Cannot insert explicit value for identity column in table 'testtb' when IDENTITY_INSERT is set to
OFF.
        HelpContext :
           HelpFile :
        NativeError : 544
             Number : -2147217900
             Source : Microsoft OLE DB Provider for SQL Server
           SQLState : 42000
     at ./t3.pl line 30.

This is being run on a trial version of Windows Server 2012, Standard Edition with a trial version of SQL Server 2012. Both are fully patched. Perl is ActivePerl, version 5.16.3.1603.

Anyone any suggestions?

Thanks,

KTP

How to perform an ODBC connection?

$
0
0

I'm using Visual Studio 2010 Express to code a program for reading data from Navision (Microsoft Dynamics 2009) classic database through an ODBC connector.

I've downloaded ODBC driver using Visual FoxPro ODBC driver setup, but when I try to add ODBC in Database Explorer or adding a reference to the proyect the option ODBC doesn't exist in data source.

Am I doing it wrong? I'm new in visual studio so I've could misunderstood the documentation.

Also, is there any way of doing the connection manually without any assistant?

SQLBrowser Service unable to locate installed instances...

$
0
0

Good morning.

I have a client who's having an odd issue with the SQLBrowser service shutting down each time it's started, indicating that it can't find any installed instances (although there are two... One SQL Server 2008 R2 Express and one SQL Server 2012 Express).

The SQL instances are installed and running on a Windows 2008 R2 Server, and both of the engine installations seem to be functioning normally.  The one application that attaches to the 2012 engine works just fine, but it's hard-coded to connect via a specific port and therefore doesn't need the browser service.  The second application which connects to the 2008 R2 instance however does requite the browser service be running, and is unable to connect from a workstation without it.  Both installations have been removed and reinstalled, but the issue remains.

When I run the sqlbrowser.exe -c I get the following :

SQLBrowser: starting up in console mode
SQLBrowser: starting up SSRP redirection service
SQLBrowser is successfully listening on ::[1434]
SQLBrowser is successfully listening on 0.0.0.0[1434]
SQLBrowser: Found no installed SQL engine instances -- not listening on SSRP.
SQLBrowser: Both SSRP and OLAP redirection services are disabled. Shutting down browser service

From the way this reads, it seems that the browser service isn't "seeing" the installed instances on the machine and shuts down.  I suspect permission problems/corruption in the registry as this server was poorly implemented and "poked at" by the previous IT company, but I'm not sure what mechanism/tests the browser service uses to detect installed instances so I'm hesitant to start making too many low level changes...

Has anyone run into this before, or does anyone have insight as to how the browser services finds installed SQL instances?

Thanks in advance for any light shed on this...

Phil Malmstrom

Diamond Computer Incorporated


Accessing SQL Server via VPN

$
0
0

I have developed a program for a client via VB.NET, which the client can use from his office.  However, when he tries to use it remotely via a VPN, the program can't find the SQL Server that the program interacts with.   He says he can access the SQL Server via VPN with another accounting program.   The connection string I currently use in his program is:

connectionString = "Data Source = server2\ANAME;Integrated Security=True;InitialCatalog=hisDatabase"

As I said, this works in his office but not through the VPN.  How might I adjust this to work via VPN?  If I add an IP address to the string, should it be the computer's IP or the SQL Server's IP?  If "Integrated Security" works in the office, should it also work via VPN or do people sometimes add passwords for VPN?


Gina


Linked Server fails from SQL Server 2008 R2 and PostgreSQL

$
0
0

I created a SYSTEM DSN (ODBC) onto PostgreSQL Server from Windows Server 2008 (64-bit)
on which the SQL Server 2008 R2.

Then I created a Linked Server by using the SQL Server management studio GUI,
and the test connection was succeeded.

I can see all table names of PostgreSQL on the SQL Server management studio GUI,
however, if I try to generate a SQL script, the following error occurs.

  --------------------------------------------------------------------------------
  Enumerate columns failed for LinkedServer 'POSTGRESQL35W'.  (Microsoft.SqlServer.Smo)
  An exception occurred while executing a Transact-SQL statement or batch.
  (Microsoft.SqlServer.ConnectionInfo)
  Cannot get the data of the row from the OLE DB provider "SQL Server" for linked server "(null)".
  Conversion failed because the data value overflowed the data type used by the provider.
  (Microsoft SQL Server, Error: 7346)
  --------------------------------------------------------------------------------

Also, if I try to use OpenQuery;
 select * from openquery([POSTGRESQL35W],'select * from public.t_event');
the following error occurs.

  --------------------------------------------------------------------------------
  The OLE DB provider "MSDASQL" for linked server "POSTGRESQL35W" reported an error.
  The provider reported an unexpected catastrophic failure.
  Cannot get the column information from OLE DB provider "MSDASQL" for linked server "POSTGRESQL35W".
  --------------------------------------------------------------------------------

I thought that the problem might be the data type of columns of tables of PostgreSQL,
so I created new table with only one column which data type is "integer",
but the same error occurs.

Please let me know this solution!!

jdbc - setup a connection pool to SQL SERVER

$
0
0

Hi

Using:

Java 7, JDBC 4, MS SQL SERVER 2008 R2, jdbc native, web app container to host a WAR talking to SQL SERVER.

All information points to com.microsoft.sqlserver.jdbc.ConnectionPoolDataSource for use in connection pooling on a java app server, but I cannot find any information on how to configure a pool of connections and use them.

  1. It appears that the datasource should always be chosen over the SQLServerDriver, do you agree?
  2. Should I be using a connection pool library rather such as bonecp, c3p0, dbcp to configure it to usecom.microsoft.sqlserver.jdbc.ConnectionPoolDataSource?
  3. If Yes to (2), a lot of these pooling libs seem to driverClassName and I want to use the DATASOURCE, so what should I configure typically?
  4. I want to use the connection properties to configure the data source and not a url, so I want to specify these for example:

  <Set name="DatabaseName">dboname</Set>
                <Set name="IntegratedSecurity">true</Set>
                <Set name="ServerName">server</Set>                
                <Set name="InstanceName">instance</Set>
                <Set name="LoginTimeout">60</Set>    

Then once I have the connection pooling in place, do I then call this on the instance of ConnectionPoolDataSource:

getPooledConnection().getConnection()

Please advise on the correct usage of the sql server connection pooling data source?

Edit:

This runs, but is it using pooling?

ic = new InitialContext();

ds = (SQLServerXADataSource) ic.lookup("java:comp/env/jdbc/myds");

m_con = ds.getPooledConnection().getConnection();

Edit 2:

Turns out "An application programmer does not use the PooledConnection interface directly; rather, it is used by a middle tier infrastructure that manages the pooling of connections. " (http://docs.oracle.com/javase/7/docs/api/javax/sql/PooledConnection.html)


Task 11: Step 2 Data Conversion

$
0
0

Dear all, while performing the task 11 of "Upgrading Company Specific Data" during Upgrade process, I got this error message which debar the execution of the Data Transfer process.

"This Message is for CAL Programmers: A Call to System.Data.SqlClient.sqlConnection.open failed with this message: Cannot open database "Migration" requested by the login. The login failed.  Login failed for user'NT AUTHORITY\NETWORK SERVICES'.

Please help out.

Kind regards.

Sanusi

how to create user dsn for microsoft access driver(*.mdb,.*accdb) in 64 bit

$
0
0
hi,

how to create user dsn for microsodt access driver(*.mdb,*.accdb) using command line in 64 bit.

i have installed 64 bit drivers and when use following command

C:\Windows\System32>odbccad.exe CONFIGDSN "Microsoft Access Driver (*.mdb,*.accdb)" "DSN=GLDatabase|Description=GL Data Source|DBQ=C:\DataBase\1.mdb"


CONFIGDSN:'unable to create a datasource for the "Microsoft Access Driver (*.mdb,*.accdb)" component not found in the registry with the error code -2147467259

but it works with C:\Windows\SysWow64

Error 8152: "String or binary data would be truncated"

$
0
0
I've been working with a sample database that the company is using for testing purposes. I (we) did not create the database - it was sent over to us by another company. I'm still a rank newbie at working with MS SQL Server, though I've worked with Access and MySQL in the past.

There is one table that contains bank information. At the moment, it is filled with information on imaginary (fake) banks. I need to change one record so that it contains the information of a real bank the company is using.

The problem is, I am unable to touch anything within this table. Any attempt to make changes gives me an error prompt that reads "String or binary data would be truncated". I ran the profiler, and it shows an Exception - Error: 8152 Severity 16 State 2.

Furthermore, I also get an error prompt stating: "The value you entered is not consistent with the data type or length of this column".

I've checked and checked again, and as far as I can tell, the value I entered _is_ consistent with the data type/length of the column.

I can make changes perfectly fine on the other tables in the database. Only this one table gives me trouble.

Could anyone shed some light on why exactly this is occurring, and why only on this one table?

Thank you :)

JDBC driver and named pipes

$
0
0
The version 2.0 MS JDBC driver does not support named pipes (or shared memory) to connect to SQL Server. Is this planned for a future version ?

There are other JDBC drivers, which support named pipes. For that reason I ask this question. Some customers find TCP/IP less secure than e.g. shared memory.

Linked Server to Oracle Slow displaying Views, Select duplicates columns

$
0
0

When I click on the linked server in Mgmt Studio and then Catalogs Default,  it takes a couple minutes to list the 50 views.

When I R Click on the view and pick Script View as Select to new Query window,  I get 4 copies of all the columns in the select.  It takes about 3-4 minutes to create the select.

SELECT [PersonID]
      ,[PID]
      ,[PID]
      ,[PID]
      ,[PID]
      ,[EmployeeNumber]
      ,[EmployeeNumber]
      ,[EmployeeNumber]
      ,[EmployeeNumber]

SQL 2012, Oracle r12

Linked server provider  provider=N'OraOLEDB.Oracle'

Seems way slow.  My linked servers to db2 work fine.

sysjobs: originating_server_id is getting zero instead of server id

$
0
0

Hi 

I am getting zero value in column originating_server_id of SysJobs table instead of getting server id whenever i am firing command like below

use msdb

select job_id,originating_server_id,name,enabled,description,start_step_id,category_id,owner_sid,notify_level_eventlog,notify_level_email,notify_level_netsend,notify_level_page,notify_email_operator_id,notify_netsend_operator_id,notify_page_operator_id,delete_level,date_created,date_modified,version_number from sysjobs

How to bind @@servername instead of that originating_server_id  

SQL Server ODBC drivers for Solaris

$
0
0

I am looking for an ODBC driver to let a Solaris box talk to a SQL Server 2012 db, I am hoping that someone will be able to put me in the right direction.

Thanks,

CB

OLE DB provider "SQLNCLI10" for linked server "XXX" returned message "Unspecified error"

$
0
0

Hi,

I am trying to access data from Linked Server. I have added the other server as linked server and also I am able to access tables from queries. But when I try to access tables from Stored Proc. I get the above error. Can any one help me on this.

Both the servers are  SQL Server 2008 R2

Thanks

Vikram

HOW TO INSERT DATA INTO SQL SERVER FROM MS ACCESS TABLE??

$
0
0
NEED TO INSERT DATA INTO SQL SERVER FROM MS ACCESS TABLE.
Viewing all 4164 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>