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

adUseClient vs adUseServer

$
0
0

There's a system with multiple frontend PCs and a SQL Server backend.

I have 2 choices to configure the frontend's recordsets I create: to set its cursor location at client side (adUseClient) or in server side (adUseServer). I already know some of the pros/cons of each case, but I have a specific question regarding what is sent/processed by the client/server.

Suppose I have a query that joins 3 tables.

1 - "If CursorLocation = adUseServer, the query is processed at server, then only the data set is sent to the client"

2 - "If CursorLocation = adUseClient, the whole 3 tables are sent to the client, the client process the query and then build the data set."

3 - "Closing a RecordSet in adUseClient is much faster than in adUseServer".

If 1 and 2 are correct, the best way to work with large recordsets is to use adUseClient, but use a Stored Procedure to build the data sets in the server. Right?

If 2 is correct, using adUseClient uses SQL Server as file server like Access?

If 3 is correct, I'd like to know why.


Felipe Costa Gualberto - http://www.ambienteoffice.com.br



SQL Server Native Client download link for prq file of Installsheild

$
0
0
In the installer I use .prq files to install SQL server Native client . I was using http://download.microsoft.com/download/4/4/D/44DBDE61-B385-4FC2-A67D-48053B8F9FAD/sqlncli_x64.msi in the URL link but now I am required to upgrade the verion of SQL client to 2009.100.4000.0. I am unable to fine the link. Pl. let me know what will be the link to be used here.

Mr

$
0
0

Good morning, we are running SQL server on a stand alone PC, which we access on the front end with Access 2013 Enterprise 3.  we then connect to that stand alone PC from other computers to interrogate the database.  We get OBDC conflicts (not allowing such remote pc's to connect to the database pc) the minute we switch the firewall on.

Does anybody have a way around this apart from turning the firewall off?

Thanks

Fetching Wrong data When Insertion of the data process is going on

$
0
0

Hi,

i am troubling with the issue that i have made one stored procedure which will returns  data based on the datetime and it works fine but at the time of data insertion process is going ( insertion of new row with latest updated datetime ) on  that time stored proc will fetch wrong data or half of the data and once insertion process is complete after a some period of time data will come as what i expect to be..

to resolved this issue i found Table Hint i.e (NOLOCK) and i tried that also but that was also fetching same.. 

so please suggest me if there is having any more things to fetch the data correctly without troubling if at the same time 

data insertion process is going.

If You Need here is my stored procedure.

SELECT SUM(FINAL.TOTALTERMINALCOUNT) TOTALTERMINALCOUNT,SUM(FINAL.LIVEWITHOUTFAULT) LIVEWITHOUTFAULT,
SUM(FINAL.LIVEWITHFAULT) LIVEWITHFAULT,SUM(FINAL.DOWN) DOWN  FROM

(SELECT COUNT( STEP1.SSTID) AS TOTALTERMINALCOUNT,0 AS LIVEWITHOUTFAULT,0 AS LIVEWITHFAULT,0 AS DOWN FROM
(select distinct(sstmaster_cdms.sstid) as sstid,dbo.GetDateXMLLandingOnSSTID(sstmaster_cdms.sstid) as xmlDate
from sstmaster_cdms left outer join xml_landing_summary

on sstmaster_cdms.sstid=xml_landing_summary.sstid) as STEP1

left outer join 

(select distinct(sstmaster_cdms.sstid) as sstid,dbo.GetPrblmDateTroubleTicketDetailOnSSTID(sstmaster_cdms.sstid) as ProblemStatus
from  sstmaster_cdms
left outer join TroubleTicketDetail_SHMS

on sstmaster_cdms.sstid=TroubleTicketDetail_SHMS.sstid) AS STEP2

ON STEP1.SSTID=STEP2.SSTID

UNION 

 SELECT 0 AS TOTALTERMINALCOUNT,COUNT(STEP1.SSTID) AS LIVEWITHOUTFAULT,0 AS LIVEWITHFAULT,0 AS DOWN FROM
(select distinct(sstmaster_cdms.sstid) as sstid,dbo.GetDateXMLLandingOnSSTID(sstmaster_cdms.sstid) as xmlDate
from sstmaster_cdms left outer join xml_landing_summary

on sstmaster_cdms.sstid=xml_landing_summary.sstid) as STEP1

left outer join 

(select distinct(sstmaster_cdms.sstid) as sstid,dbo.GetPrblmDateTroubleTicketDetailOnSSTID(sstmaster_cdms.sstid) as ProblemStatus
from  sstmaster_cdms
left outer join TroubleTicketDetail_SHMS

on sstmaster_cdms.sstid=TroubleTicketDetail_SHMS.sstid) AS STEP2

ON STEP1.SSTID=STEP2.SSTID
WHERE (DATEDIFF(mi,CONVERT(datetime,STEP1.xmldate , 108),CONVERT(datetime, GETDATE(), 108))<120
AND DATEDIFF(mi,CONVERT(datetime,STEP1.xmldate , 108),CONVERT(datetime, GETDATE(), 108))>0) 
AND (STEP2.ProblemStatus ='CLOSE' OR STEP2.ProblemStatus IS NULL)

UNION

 SELECT 0 AS TOTALTERMINALCOUNT,0 AS LIVEWITHOUTFAULT,COUNT(STEP1.SSTID) AS LIVEWITHFAULT,0 AS DOWN FROM
(select distinct(sstmaster_cdms.sstid) as sstid,dbo.GetDateXMLLandingOnSSTID(sstmaster_cdms.sstid) as xmlDate
from sstmaster_cdms left outer join xml_landing_summary

on sstmaster_cdms.sstid=xml_landing_summary.sstid) as STEP1

left outer join 

(select distinct(sstmaster_cdms.sstid) as sstid,dbo.GetPrblmDateTroubleTicketDetailOnSSTID(sstmaster_cdms.sstid) as ProblemStatus
from  sstmaster_cdms
left outer join TroubleTicketDetail_SHMS

on sstmaster_cdms.sstid=TroubleTicketDetail_SHMS.sstid) AS STEP2

ON STEP1.SSTID=STEP2.SSTID
WHERE (DATEDIFF(mi,CONVERT(datetime,STEP1.xmldate , 108),CONVERT(datetime, GETDATE(), 108))<120
AND DATEDIFF(mi,CONVERT(datetime,STEP1.xmldate , 108),CONVERT(datetime, GETDATE(), 108))>0) 
AND (STEP2.ProblemStatus <>'CLOSE')

UNION 

SELECT 0 AS TOTALTERMINALCOUNT,0 AS LIVEWITHOUTFAULT,0 AS LIVEWITHFAULT,COUNT(STEP1.SSTID) AS DOWN FROM
(select distinct(sstmaster_cdms.sstid) as sstid,dbo.GetDateXMLLandingOnSSTID(sstmaster_cdms.sstid) as xmlDate
from sstmaster_cdms left outer join xml_landing_summary

on sstmaster_cdms.sstid=xml_landing_summary.sstid) as STEP1

left outer join 

(select distinct(sstmaster_cdms.sstid) as sstid,dbo.GetPrblmDateTroubleTicketDetailOnSSTID(sstmaster_cdms.sstid) as ProblemStatus
from  sstmaster_cdms
left outer join TroubleTicketDetail_SHMS

on sstmaster_cdms.sstid=TroubleTicketDetail_SHMS.sstid) AS STEP2

ON STEP1.SSTID=STEP2.SSTID
WHERE (DATEDIFF(mi,CONVERT(datetime,STEP1.xmldate , 108),CONVERT(datetime, GETDATE(), 108))>120
AND DATEDIFF(mi,CONVERT(datetime,STEP1.xmldate , 108),CONVERT(datetime, GETDATE(), 108))>0) 
OR STEP1.xmldate IS NULL

) AS FINAL


How to configure SQL Server to allow remote connections

$
0
0

Hi,

This is RtPrasad.I am working in some software company.I am supporting an application in one of the projects.I am using windows 7 OS and SQLServer 2008 r2.When ever I am trying to connecting to the test server through SSMS from my lenovo thinkpad,I am getting an error as shown in the screen shot.I searched a lot in the google and I went through the many sites.In those sites,below is the URL of one site.

http://blogs.msdn.com/b/walzenbach/archive/2010/04/14/how-to-enable-remote-connections-in-sql-server-2008.aspx.But Still I am getting the same error.Can anybody please solve this problem as soon as possible.Thanks in advance.

Thanks&Regards,

RtPrasad.


SQLSRV32.DLL 6.01 Error 22003

$
0
0
I'm having an issue with a SQL 2000 Server running a 6.5 Database (Production) and SQL 2008 R2 Server running 6.5 Database (Dev/Test) both getting an error from an old application we have never been able to replace. It's giving "Error 22003 ODBC SQL Server driver Numeric value out of range"  I'm attempting to locate a replacement sqlsrv32.dll newer than 6.01 but I'm unable to find an appropriately newer version that I believe isn't a jump straight to 8.0 and even then I can't find a download for the 8.0 version.  If anybody can help with either the error or the download any help would be greatly appreciated.

SQL 2012 becomes unresponsive to VIEWS

$
0
0

We have a dire situation on a SQL 2012 sp2 database. Intermittently, the database becomes unresponsive to any VIEW.

Here's what we know:

- there are NO sql or system log events generated whatsoever

- queries and ODBC table access work fine

- there are no performance issues ( out of resources etc.)

- VIEWS to other databases work fine

- the problem is immediately resolved when the SQL instance service is restarted

- it is not a front application issue as we wrote a TEST app that performs a simple table access, record post, query, and view

Any help would be greatly appreciated

SQL Server Slowly ?

$
0
0

Hello

I have a project. It is a Winfrom project. 30 users use my project. When i use my project, It works good. Fast. But some users tell me that sometimes they wait for 5 minute. They tell me that so slowly. There are a lot of forms at my project. If users use my project at same time, my project can be work slowly ? Why ? Now, some tables no have index. I should index all tables ?

Server Computer is that have below skills.

Intel Xeon CPU E31220 3.10 GHz

4 G Ram


counting number of records using where clause in a large table

$
0
0

SQL SERVER 2008

I've to find the count of the rows matching some conditions. The table size is very large with around 50 columns. And every day around 3000 rows are adding. 

My business logic is to count the number of payments made by a particular user, also if the count exceeds 10 then the user is GoldUser else NormalUser.

here:
select count(payment_id) from payments_master_table where payment_user = @payment_user;

here payment_id is primary key. This query is very slow, since it has to scan the whole table. Is there any other optimized way to find the number of counts. 

Also, one way I can do is, if the count of payment_id exceeds 10, stop the count,but I do not how to do this.  

Please can anyone help me. 

Thanks!

SQL SERVER BULK FETCH AND INSERT/UPDATE?

$
0
0

Hi All,

       I am currently working with C and SQL Server 2012. My requirement is to Bulk fetch the records and Insert/Update the same in the other table with some  business logic?

       How do i do this?

       Thanks in Advance.

Regards

Yogesh.B


ODBC SPI development

$
0
0

Not sure if this is the appropriate place to post my question but I couldn't find any - I'm in the process to implement ODBC 3.8 functionality in our  existing ODBC Driver (C++) for AS400; I was trying to find a sample and a more specific documentation or an SDK, with particular reference to SPI but there's nothing I can find. Even ODBC Test doesn't seem to be updated. Where could I find some docs/samples/material? 

Thanks

Linked Server Error Login Timeout Expired & A Network Related or insstance specific error

$
0
0



Dear All,

Thanks in advance to review my question.

When i creat linked server connection it work fine and showing catalog, I configured SQL Connectiion & Firewall also but after some time is given following error my connection setting is as follows



Regards

Tahir


TeeJay

SQL Server & ODBC with C Language

$
0
0

Hi,

I find that when doing bulk operations (like bulk update, delete, insert etc.) ODBC routines mimick the operation by iterating thru the array of data given in the program, since SQL Server does not have bulk operation facilities. I am worried about the performance, if it goes for a single record processing.

Right now I am using C & ODBC for SQL Server. Is there any other better approach to speed up the process and accomplish what I want. There are about 200+ programs that do tremendous bulk data operations.

If C & ODBC is Not the right thing, then can you advise me on what would be the best tool to do that. Somebody I knew suggested that using SSIS instead of C-ODBC would improve performance. Someone Advise on the right approach please.

Thanks in advance people.

Regards

Yogesh B.

SQL server does not exist or access denied.

$
0
0

Dear Sir/Madam,

When i am trying to start our hospital software based on SQL server 2000, it shows Following Error.

Search Condition is not valid, (DBNETLIB) ConnectionOpen (connect()).  SQL server does not exist or excess denied. Due to Fetch data.

I run our software in Windows 8.1, while it smothly runs in previous version of Windows XP and 7

Please do the good.


SQL Server runs update on one record, returns -1 records updated to java

$
0
0

I am trying to troubleshoot an issue in SQL Server. For all the databases in a specific server, the return value for java initiated update statements have completed the update (ie. I can go into SQL Server and verify the values have changed), but returned a value of -1 records updated. I am not sure what went wrong to cause this to fail. It works on one server, but not on any databases on the other server and it suddenly changed on Friday, April 10. Here is the results of the java I am running.

Driver vendor: Microsoft JDBC Driver 4.0 for SQL Server

DriverVersion: 4.0.4621.201

dbproduct: Microsoft SQL Server

JavaPlus Connection Made: no warnings

Executing :update maxsequence set maxreserved = 401 where sequencename ='SERVERSESSIONSEQ' and maxreserved=400

Using TYPE_SCROLL_INSENSITIVE

Execute Returned -- (boolean) --- false

Execute getUpdateCount -- (num) -1

Execute took :0(15) secs.

Update/Deleted :-1 records.

Fetching/Updating took :0(0) secs.

I am runnning SQL Server 2012 and Windows 2012R2

Microsoft SQL Server Management Studio11.0.2100.60

Microsoft Analysis Services Client Tools 11.0.2100.60

Microsoft Data Access Components (MDAC)6.3.9600.16384

Microsoft MSXML3.0 4.0 6.0 

Microsoft Internet Explorer9.11.9600.16518

Microsoft .NET Framework4.0.30319.34011

Operating System6.3.9600


Unable to connect to SQL Server : bad return code or status

$
0
0

When attempting to connect to a server running Windows Server 2008 R2 and SQL Server 2008 R2 the following error message is returned.

Error Connecting to Database

A SQLServer request resulted in a bad return code or status but no error message was returned.

The client is pointed to another similar server running Windows Server 2008 R2  and SQL Server 2008 R2, a connection can be made successfully.  Looking at the registry both servers have the same version of MDAC 6.1.7601.17514.

UPDATE 

The SQL Server Error Log records the following information.

Message
Length specified in network packet payload did not match number of bytes read; the connection has been closed. Please contact the vendor of the client library. [CLIENT: 10.1.30.106]

Message
Error: 17836, Severity: 20, State: 17.

It seems like the client is actually reaching the SQL Server but failing to login.







How to insert binary to SQL Express by VBA?

$
0
0

Hi all,

 

In the end of the post, there is my vba functions and query to create datatable. I got a run-time error message on the red line in the function. It says: [sql native client] string data right truncation. Did I do sometime wrong? Thanks for your time!

 

-L

 

Sub test()

    Dim BinaryStream
    Set BinaryStream = CreateObject("ADODB.Stream")

    Dim mConn As ADODB.Connection

    'read the file data to bytes
    'Specify stream type - we want To get binary data.
    BinaryStream.Type = adTypeBinary
    'Open the stream
    BinaryStream.Open
    'Load the file data from disk To stream object
    BinaryStream.LoadFromFile file

    Dim mCmd As ADODB.Command
    Set mCmd = New ADODB.Command
    With mCmd

        ' define query
        .CommandText = "INSERT INTO TEST (FDATA) " & _
            "VALUES (?)"
        .CommandType = adCmdText

        ' add parameter
        .Parameters.Append .CreateParameter("@P1", adVarBinary, _
            adParamInput, BinaryStream.Size, BinaryStream.Read)
    End With

    ' open db connection

    mConn.ConnectionString = _
        "Driver={SQL Native Client};Server=.\SQLEXPRESS;Database=XXXX;Trusted_Connection=yes;"
    mCmd.ActiveConnection = mConn

    'run-time error: [sql native client] string data right truncation
    mCmd.Execute

    mConn.Close
End Sub

 


GO
/****** Object:  Table [dbo].[TEST]    Script Date: 10/04/2007 11:06:50 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[TEST](
 [ID] [int] IDENTITY(1,1) NOT NULL,
 [FDATA] [varbinary](max) NOT NULL
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF

Queries result takes time on CDC SQL database

$
0
0

I have a DB. CDC is applied almost all tables(50+) of DB.

Is CDC data slow down the DML queries result like select query?

I want to ask this question because my DML queries takes time now.

Or is there any other reason of slowing down DB?

MS OLE DB Provider for DB2 V5

$
0
0

Hello,

Just purchased SQL Server 2014.  I am trying to get a linked server setup to our AS400 using the MS OLE DB Provider for DB2 v5 x64.

I've got the linked server setup, connected and working but it is not translating the CCSID 65535 fields.  I have set the option "Process binary as character=true" and "Binary Codepage=37".  From what I have read, these to options should solve my problem but they are not doing the trick.  The issue is anything that is set with a CCSID 65535 on the 400 is being returned something like this "0x40404040404040404040".  Fields with a CCSID of 37 are being returned normal and readable.  

I should mention, this same setup is working on our SQL 2005 server as we speak.  It is an older version of the OLE DB Provider for DB2 and does not contain the "Binary Codepage=37" but I have tried it with that, without that and with Binary Codepage=0 on the new server to no avail.  I have also tried version 4 of the Provider, Translate binary as character=true, BinasChar=true, and none of it works.

Anyone have any suggestions?  I worked on this for a full day and couldn't get it to go.

Partitioned views in Standard Edition

$
0
0

We have are SQL 2014 Standard edition, I have a situation where-in I plan to partition a table now since table partition is not supported in standard version I thought about Partitioned views however now I am stuck where I cant make the view writable because of the identity column in the base table.

Do I have any other option in this case ?

Let me know your thoughts

Regards

Vishal


VG

Viewing all 4164 articles
Browse latest View live