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

Query data to a combobox

$
0
0

I need to populate de list of roles for specified user in a combobox.
I have 3 tables, where I register de user Id and username, the roles Id and name, the relation with the users and the roles.
In my query I need to list the roles by name, for the selected user. But I am having trouble with the query.

How could I organize the query in order to get the list of roles for the specified user?


Valdirnm


SQL Server backup using backward compatibility

$
0
0

Hi,

Can anyone suggest me how to create backward compatibility backup in sql server? I do not want to generate script

Is there any tool to do this?

Please help me!!

Any help appreciated!

SQLALLOCCONNECT()

$
0
0

Hi,

We have migrated VB.net code from Framework 2.0 to 4.6. In windows 10 64 bit environment alone we are facing issues with SQLALLOCCONNECT function. It throws error as "Attempted to read or write protected memory. This is often an indication that other memory is being corrupt."

This is sequence of code getting executed.

Public hdbc As Integer
Private henv As Integer

Private Const SQL_SUCCESS As Short = 0

Private Declare Function SQLAllocEnv Lib "odbc32.dll" (ByRef env As Integer) As Short
Private Declare Function SQLAllocConnect Lib "odbc32.dll" (ByVal henv As Integer, ByRef phdbc As Integer) As Short

If SQLAllocEnv(henv) <> SQL_SUCCESS Then
               MsgBox("ODBC Allocation Error", 48, constCaption)
               System.Windows.Forms.Application.DoEvents()
Exit Function
End If

If
 SQLAllocConnect(henv, hdbc) <> SQL_SUCCESS Then
            System.Windows.Forms.Application.DoEvents()
           MsgBox("ODBC Connect Error", 48, constCaption)
 Exit Function 
End If

Any help would be much appreciated.

Access database connection failure

$
0
0
I needed help asap. I have this MS Access 2010 database that I use to run queries. It was linked to an ODBC database called Credisphere and recently they moved this ODBC databse to a new server. How do I connect Access to the new server. We tried going into data sources in the control panel and connecting to the new server but it didn't work. What am I missing here!

odbc call failed error

$
0
0
ODBC-call failed.
[Microsoft][ODBC driver for Oracle][Oracle]ORA-06413: Connection not open. (#6413) [Microsoft][ODBC Driver Manager] Driver's

Communication Link Failure

$
0
0
I have daily job that executes an SSIS package and is failing sometimes due to "Communication Link Failure" but sometimes completed without any error and without any changes. I already disabled TCP chimney offload as some blogs suggested but still the error is intermittent. Some blogs are pointing the NIC and hardware as the culprits but our network and server guys doesn't agree at all. I'm still clueless on the root cause, how can i possibly determine the root cause? And how to resolve this problem? Thanks

Best way to connect from access front end to SQL server back end

$
0
0

Our local government office has 2 .adp format access projects running in access 2010 on sql server databases in SQL2008. Each are a similar size, 30 forms in the front end, back end approx. 70 tables, 15 views, 80 stored procedures and 30 functions. The issue is this:

We are aware that the adp format is obsolete from access 2013. Also aware that the SQLOLEDB provider used by ADO is obsolete after SQL2012 is end of line (which will be in 2022). We are looking for a solution that stays with the access/SQL server client server technologiy, and can survive well past 2022.

We think that we have 3 options therefore:

1 - Convert adp front end to accdb, and convert all ADO code to ACE(DAO).

2 - Convert adp front end to accdb, and leave all ADO code as is, but connect to back end using the MSDASQL provider (Microsoft OLE DB Provider for ODBC).

3 - Convert adp front end to accdb, and use a mix of ADO connecting via MSDASQL provider, and ACE(DAO) where it is more efficient.

Has anyone got an unbiased opinion (ie not because this is your preferred vb library) on which of the above paths to take, to future proof our access/SQL server systems, and avoid any gotchas

Getting Error While connecting ODBC

$
0
0

I am getting error while trying to make a ODBC connection with SQL Server

Please check below the error

Connection failed:
SQLState: '01000'
SQL Server Error: 53
[Microsoft][ODBC SQL Server Driver][DBNETLIB]
   ConnectionOpen(Connect()).

Connection failed:
SQLState: '08001'
SQL Server Error: 17
[Microsoft][ODBC SQL Server Driver][DBNETLIB]
   SQL Server does not exist or access denied.

Please help


Is it possible to install IBM DB2 Database server on personal laptop with windows 10 operating system??

$
0
0
Is it possible to install IBM DB2 Database server on personal laptop with windows 10 operating system??

The OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)" reported an error. Access denied.

$
0
0
Hi,

I am importing Excel 2007 file into SqlServer 2005 (Sqlexpress). The office 2007 is not installed in the machine. I have downloaded and installed "AccessDatabaseEngine". When I execute following statement

SELECT * FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0', 'Excel 12.0;Database=D:\File1.xlsx', 'SELECT * FROM [Sheet1$]');

The following error is comming:

Msg 7399, Level 16, State 1, Line 1
The OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)" reported an error. Access denied.
Msg 7350, Level 16, State 2, Line 1
Cannot get the column information from OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)".

Can any one suggest what should I do to resolve?

Thanks,
Parmeshthee.


Learning .Net 3.5

I'm unable to to add "count(Result) as GamesPlayed" to anywhere in this query. Please help me ASAP

$
0
0
Select DENSE_RANK() OVER(order by Point DESC,GD DESC) as Rank, * from (select  TName,Sum(Score) as Score,Sum(GA) as GA,Sum(Diff) as GD,Sum(Point) as Point from  (Select f.teamID,Score as Score,GA as GA,Score-GA as DIff,case when Result = 'W' then 3when Result = 'D' then 1Else 0end as Point,T.TNamefrom Fixtures Finner join  Teams T on t.TeamID = f.TeamID  ) Sgroup by teamID,TName) SSorder by Point DESC,GD DESC

SQL Server on Open Source OS

$
0
0

My other question after .Net is hosting MS Sql Server on open source.  The myth is that any microsoft product are not cross platform compatible .

Is this achievable? Any help solitcited.

regards

Rajesh

Date coming wrong while importing data from excel to SQL table

$
0
0

Hi

I have Excel with ID ,Name,DOB . I am going to import this data to table of ID, Name DOB using import and export wizard in SQL.

Data is importing. Some date I am getting as wrong 1900-01-01 00:00:00.000 in stead of proper date in Excel file . what is the reason and how to resolve it. DOB in table is Datetime field and Excel aslo I formated DOB field as date fied. Could any please help to resolve it. (Reason and solution step).


AK

SQL 2014 and IBM OLEDB Provider

$
0
0

Hello,

I've came accross a problem which is kinda weird.

I have a brand new setup of SQL Server 2014. On the server I have installed IBM OLEDB provider version 10.5.1 which is used for a linked server to a DB2 database. Everything works OK, just when I run a query against a specific table I get an error:

Msg 7356, Level 16, State 1, Line 1

The OLE DB provider "IBMDADB2.DB2COPY1" for linked server "DB2_LINKED_SERVER" supplied inconsistent metadata for a column. The column "COLUMN_NAME" (compile-time ordinal 6) of object ""DB2DB."SCHEMA"."TABLE"" was reported to have a "DBTYPE" of 134 at compile time and 130 at run time.

With some table I get similar error just 134 is replaced with 135.

Need to mention I also have 2 more SQL Servers. One 2012 and one 2008R2. Both of them have IBM OLEDB provider 10.1.5 installed. On both servers same linked server is created. When same query is executed everything works perfectly.

All settings on all servers are same in regards to OLEDB provider.

At them moment I'm in process of obtaining IBM OLEDB provider 10.1.5 and installing it on SQL 2014 to test if it works, but still posted here to get some opinions what could be wrong.

Also OPENQUERY against same table works, but it is not a preffered solution.

One more observation I would like to share in concern of the above. I've tried to use Import/Export wizard to get data from DB2 table and there is some difference between 2014 and 2012. In SQL 2012 Import/Export Wizard I get data type for above column"134" where in SQL 2014 I get for same column data type "unknown".

Any help or ideas appreciated.

Danijel

The semaphore timeout period has expired

$
0
0
Hello,

For the past few days something weird is happening to our sql server box.  During running some procedures we get the following error message:

Msg 121, Level 20, State 0, Line 0
A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 - The semaphore timeout period has expired.)


It seems to happen when running large procedures or even small queries, the session where i run the query get disconnected but I can reconnect right away but it may happen again couple minutes later.

 I'm connecting to my Windows server 2003 using remote desktop and running procedures from the SQL Server installed on the Windows Server.

Anybody has an answer?  Thanks.

Integrated security is this even possible?

$
0
0

We have a SUSE linux server version 11 which we are trying to use integrated security over jdbc to connect to a Microsoft Windows 2012 R2 server running Microsoft SQL server 2012 SP2 and have an extremely hard time getting this working. We have a server.properties file, which when we have it contain the connection string with a username and password defined the server can connect to the DB server. However this is unacceptable per or security standards, and we want to implement integrated security within this server.properties file to remove the username and password.

Can someone please point me in the correct direction? I believe the connection string we have setup is correct.

## configured database configuration.
database.type      = mssqlsrv
database.url       = jdbc:sqlserver://SERVER01:5009;databaseName=DHCCDB;instanceName=HPCCENTER;authenticationScheme=JavaKerberos;integratedSecurity=true
database.username  =
database.password  =


Need I use GO in SQL statements sent via ADO?

$
0
0

Hi,

I am using ADO/Visual C++ to access SQL Server.

If I need to execute multiple statments, then should I use the ";" and "GO" before each statements, like in Management Studio?

For example,

CString strSQLQuery = _T("SELECT * FROM MyTable;\r\n") + _T("GO;\r\n") + _T("SELECT * FROM SecondTable;\r\n")

Thanks

Temporary table in ADO

$
0
0

Hi,

I am using ADO/Visual C++. If I use ADO to create a temporary table "#MyTable" in "MyDatabase", then based on MS document, the table should only be accessed by current session, in that case, even others try to connect SQL Server and access the "MyDatabase" via SQL Server management studio or ADO, they will not be able to access the temporary table, is that correct?

Thanks

Windows 10 client to SQL Server 2012: The timeout period elapsed while attempting to consume the pre-login handshake acknowledgement

$
0
0

I’m an experienced.NET / SQL developer. Recently I’ve upgraded from my old 32 bit PC with Win 7 Enterprise SP1 to a new 64 bit one Win 10 Pro 15/11. Now, the old Win 7 I’m running in Hyper-V on the new PC.

My old Win 7 always was & still is well connecting to a remote SQL Server 2012 over a fast LAN-to-LAN VPN. But my new Win 10 client makes troubles when I try to connect to SQL Server using SSMS or our .NET applications:

  • SQL Server Authentication works perfectly - within some tenths of a second
  • Windows Authentication waits long and then fails on error like this:

“Connection Timeout Expired.  The timeout period elapsed while attempting to consume the pre-login handshake acknowledgement. This could be because the pre-login handshake failed or the server was unable to respond back in time. The duration spent while attempting to connect to this server was - [Pre-Login] initialization=18448; handshake=14535;  (Microsoft SQL Server, Error: -2)”

The funny thing is, thatit does not crash everytime. When I start 2 instances of SSMS side-by-side and make a try to connect (Windows Authentication) to the same server simultaneously -- IT WILL SUCCEED ! The same happens when I try to connect SSMS and our app concurrently within the same 5 or 10 seconds. So, the Windows Authentication connection is about to succeed, but not if it is running single.

According to some articles on the web I’ve experimented with LAN configuration and protocols. Now IPv6 is disabled everywhere (I hope), but the problem is still alive.

A significant problem may ley on the server side, too. It is Win Server 2008 R2 Enterprise + SQL Server 2012 Express, but the Active Directory Controller is running in the same system. It doesn’t matter for Win 7 client, but who knows, how Win 10 manages my client identity on the server in such constellation ?

I’ve spent 2 days on this problem, but my “admin” skills are short to it. Now I’m about to rewrite all app configurations to SQL Server Authentication and I feel not much happy about it…

Any ideas that could help us ?

here is insufficient system memory in resource pool 'internal' to run this query

$
0
0
We are facing the  issue in Microsoft SQL Server 2008 R2 DataCenter Edition 32 bit  "There is insufficient system memory in resource pool 'internal' to run this query" and server not respond.when we restart the server it is working fine.

Os : windows 2008 enterprise edition
Sal Server : Microsoft SQL Server 2008 R2 DataCenter Edition 32 bit 
SErvice Pack 2


Viewing all 4164 articles
Browse latest View live


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