TSQL + VBA - Retrieve SQL SERVER 2000 Data Trough Excel 2003 - Time Out Error 80040e31

Sep 17, 2007

Hi guys,
When I thought everything is okay with this script, I got a new problem...
I have a VBA's script from Excel 2003 that builds sql script and retrieves data from SQL SERVER 2000.
in order to make the sql running, I need to use a multi - batch processing, to pass and execute every command line once a time.

Up to here, I am using a test case with Account number = '123456' and getting the desire results.
The code below is running okay with the test case, but when changing the account number (mark as yellow in the code) to include all the accounts (or just one other account), I am getting the following ERROR:
run - time error '-2147217871 (80040e31)' - [Microsoft] [ODBC SQL Server Driver] time out expired.

Now, if I take the same code, with the condition that generates the ERROR, and try it into SQL Server, I get the results without errors.
Thanks in advance,
Aldo.

Below the code:



Code Snippet
Function QuerySalesAging()
'--------------------------------------------------------------
'MUST !!! References: Microsoft ActiveX Data Object 2.1 Library
'--------------------------------------------------------------

Dim ConnString As New ADODB.Connection
Dim RecordSet As New ADODB.RecordSet

'Setting Connection String
Driver = "{SQL Server}"
ServerName = "SERVER"
DB_Name = CompanyName

ConnString = "Driver=" & Driver & ";" & "Server=" & ServerName & ";" _
& "Database=" & DB_Name & ";" & "Uid=" & SQLLoginName & ";" & "Pwd=" & SQLPassword & ";"

'Report Criterias
Criteria05 = " AND " & "Accounts.ACCOUNTKEY Between " & AccountKeyAsRange
' -- ==> With AccountKeyAsRange = '123456' AND '123456' it works okay.
' -- ==> With any other value, in example AccountKeyAsRange = '123456' AND '9999999999' it get's ERROR.

CmdLine01 = " USE " & CompanyName

' Check and drop temporary table
TemporaryTableName = "CTE" ' The table is a regular one
CmdLine02 = " if object_id('" & TemporaryTableName & "') is not null exec('DROP TABLE " & TemporaryTableName & "') "

CmdLine03 = " SELECT ..."
CmdLine03 = CmdLine03 & " INTO " & TemporaryTableName
CmdLine03 = CmdLine03 & " FROM ..."
CmdLine03 = CmdLine03 & " WHERE " & "(" & Replace(Criteria05, "AND", "") & ")"
CmdLine03 = CmdLine03 & " ORDER BY ..."

CmdLine04 = CmdLine04 & " ALTER TABLE " & TemporaryTableName ...

CmdLine05 = CmdLine05 & " UPDATE " & TemporaryTableName ...

CmdLine06 = CmdLine06 & " SELECT ..."
CmdLine06 = CmdLine06 & " FROM ..."

ConnString.Open
ConnString.Execute CmdLine01
ConnString.Execute CmdLine02

RecordSet.Open CmdLine01, ConnString
RecordSet.Open CmdLine02, ConnString
RecordSet.Open CmdLine03, ConnString
RecordSet.Open CmdLine04, ConnString
RecordSet.Open CmdLine05, ConnString
RecordSet.Open CmdLine06, ConnString

ConnString.Execute CmdLine01
ConnString.Execute CmdLine02 ' The debbuger stops here:" if object_id('CTE') is not null exec('DROP TABLE CTE') "
ConnString.Execute CmdLine03
ConnString.Execute CmdLine04
ConnString.Execute CmdLine05
ConnString.Execute CmdLine06
ConnString.Execute CmdLine02

'Retrieve Field titles
For ColNr = 1 To RecordSet.Fields.Count
ActiveSheet.Cells(1, ColNr).Value = RecordSet.Fields(ColNr - 1).Name
Next

ActiveSheet.Cells(2, 1).CopyFromRecordset RecordSet

'Cleanup & Close ADO objects
ConnString.Execute "USE master"
ConnString.Close
Set RecordSet = Nothing
Set ConnString = Nothing
End Function

View 1 Replies


ADVERTISEMENT

TSQL + VBA Excel 2003 - Importing Data From MS Excel 2003 To SQL SERVER 2000 Using Multi - Batch Processing

Sep 11, 2007

Hi,
I need to import an SQL string from MS Excel 2003 to SQL SERVER 2000.
The string I need to import is composed by 5 different several blocks and looks like:



Code Snippet

CommandLine01 = "USE mydb"
CommandLine02 = "SELECT Block ..."
CommandLine03 = "GO
ALTER TABLE Block...
GO"
CommandLine04 = "UPDATE Block..."
CommandLine05 = "SELECT Block..."

The detail of the SQL string is at:
http://forums.microsoft.com/msdn/showpost.aspx?postid=2093921&siteid=1&sb=0&d=1&at=7&ft=11&tf=0&pageid=1



I am trying to implement OJ's suggestion:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2117223&SiteID=1
to use multi - batch processing to import the string to SQL SERVER, something like:




Code Snippet
Dim SqlCnt, cmd1, cmd2, cmd3
'set the properties and open a connection

cmd1="use my_db"
cmd2="create table mytb"
cmd3="insert into mytb"

SqlCnt.execute cmd1
SqlCnt.Execute cmd2
SqlCnt.Execute cmd3

Below is the code (just partial) I have, and I need help to complete it.
Thanks in advance,
Aldo.




Code Snippet
Function TestConnection()
Dim ConnectionString As New ADODB.Connection
Dim RecordSet As New ADODB.RecordSet

ConnectionString = "Driver={SQL Server};Server=myServer;Database=myDBName;Uid=UserName;Pwd=Password"
ConnectionString.Open

CmdLine01 = " USE " & myDB
CmdLine02 = " SELECT ACCOUNTS.FULLNAME FROM ACCOUNTS" ...

CmdLine03 = "GO
ALTER TABLE Block...
GO"

CmdLine04 = "UPDATE Block..."
CmdLine05 = "SELECT Block..."

RecordSet.Open CmdLine01, ConnectionString
RecordSet.Open CmdLine02, ConnectionString

ConnectionString.Execute CmdLine01
ConnectionString.Execute CmdLine02

'Retrieve Field titles
For ColNr = 1 To RecordSet.Fields.Count
ActiveSheet.Cells(1, ColNr).Value = RecordSet.Fields(ColNr - 1).Name
Next

ActiveSheet.Cells(2, 1).CopyFromRecordset RecordSet

'Close ADO objects
RecordSet.Close
ConnectionString.Close
Set RecordSet = Nothing
Set ConnectionString = Nothing

End Function






View 7 Replies View Related

Automating Taking Data From Sql Server 2000 Onto Excel 2003 Spreasheet

Jun 18, 2007



I would like to know recommendations on automate the following:



1. I want to know how to take data from various sql server 2000 data queries and load the data onto excel spreadsheets in an automated method. Some of the data loaded into the excel spreadsheets load detail data and some load data into pivot tables.



Is there any way that the data can be taken from sql server to the excel spreadsheets using odbc connections?



2. Some of the data taken from sql server 2000 database is loaded into pdf files. Is there any way this process can be automated?



Thanks!

View 1 Replies View Related

Run-time Error 2147217871 (80040e31)&"

Sep 27, 2007

Hi guys,

I'm having a problem wiht this: Run-time error -2147217871 (80040e31)". There are times that this error does not occur. But there are times that this error occurs. I am using a third party software. And we don't have enough support at this moment. May I know what should I do. Moreover. We are using VB 6.0 for front end. Then SQL server 2000 for back end.

Thanks

View 4 Replies View Related

SQL Server Error '80040e31': Please Help Me!

Jun 1, 2007

I have the following problem in a Win 2000 Server + SQL Server 2000environment and I hope somewhat can help me to resolve it (after manydays of useless attempts I am desperate).In my database I have two table:- master(id, field1, field2, ...)- detail(id0, id, progr, data, sede, esecutori, brani_autori)in a master-detail relation with "id" as foreign key.The fields of the "detail" table are:- id0: uniqueidentifier, primary key (newid() IsRowGuide=Yes);- id: uniqueidentifier, foreign key;- progr: bigint, Identity=Yes;- data: smalldatetime;- sede: varchar (100);- esecutori, brani_autori: text.In certain situations, in my asp site, I have to make a copy of a recordof "master" with all the linked record of the "detail" table.The code I've written to realize this task has been tested in manysimilar situations and has always worked fine (it is reported on the endof mail).With the two table above I have this strange behavior: when I attempt todo the copy of linked records in the "detail" table (using an "Insert"query), some records are correctly inserted, whereas for few otherrecords the Conn.Execute of the "Insert" query don't go and I receivethe message:Microsoft OLE DB Provider for SQL Server error '80040e31'Timeout expiredAfter many attempts I've reached these conclusions:1.It isn't the situation described in this faq:http://www.aspfaq.com/show.asp?id=2287because also using the IP for the "Data Source" the situation is thesame; on the other hand I have the problem also when there is only onerecord to copy in the "detail" table, so the problem is not the durationof the query.2.It isn't due to the contents of the record (at least not directly): if Isubstitute the contents of one of this records with simple text theerror persists, if I create manually a new record in "detail" and put init the data of the indicted record it is copied normally. So the problemseems to be the record itself and not its contents.3.The insert query work normally if I execute it from the Query Analizer.4.The problem seems to be due to the fact that, when I have a recordsetobject open on the table and pointed to one of this records, SQL Serverblocks the table and don't permit new insertion; in fact if I executethe same Insert query out of the code where the recordset object is openit works.Finally if the problem is the one of the point 4, I don't know thereason of this behaviour and how to resolve it.So, please, help me because it is of great importance for my work!Many, many thanksTonio Tanzi*** Code of the copy procedure ***....old_id_master= 'the id of the master record to copynew_id_master= 'the id of new master record (copy of the above)strsql="Select * From detail where id='" & old_id_master & "'"set rs=Conn.Execute(strsql)do while not rs.Eofstrsql="Insert Into detail (id, data, sede, esecutori, brani_autori)"& " Values ('" & new_id_master & "','" & data & "','" & _sede "','" & esecutori & "','" & brani_autori & "')"Conn.Execute(strsql)rs.movenextlooprs.closeThis code works good for the "good" records, don't words for the "bad"records, but if I force an insert for a "bad" record before or after thedo while-loop (i.e. when the rs is not pointed on a "bad" record) it works.

View 4 Replies View Related

Connect To SQL Server 2000 Trough Internet (adsl Connection )

Mar 29, 2007

Hi guys,



Can somebody tell me where i can find ( or explain me ) the steps to

connect to sql server using the internet. I am using VB6 (SP6) and SQL SERVER 2000

I want to set up asql server on a central location ( PC ) so that 4 different sites can access the data stored





Thanks for all help







grtz Robert

View 1 Replies View Related

Importing Data From Excel 2003 To Sql Server 2005

Sep 3, 2007

Hi all. I want to export data from excel 2003 to sql server 2005. I am using the following script:
EXEC sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
EXEC sp_configure 'Ad Hoc Distributed Queries', 1;
GO
RECONFIGURE;
GO
Insert into Pamphlet
Select * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:Pamphlet.xls;HDR=YES', 'SELECT * FROM [Sheet3$]')
But it is giving the following error:
Msg 7399, Level 16, State 1, Line 2
The OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" reported an error. The provider did not give any information about the error.
Msg 7303, Level 16, State 1, Line 2
Cannot initialize the data source object of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)".
The above script is working fine with Excel 2002 but not with 2003. Can someone please provide me exact script of importing data from excel 2003 to sql server 2005. I have also tried the Linked server option but it is still giving the same error.
Please help me.  
 
 

View 1 Replies View Related

SQL Server Error '80040e31' Timeout Expired Strange.

Oct 30, 2007



Hi All,

we are working on a web application created in ASP & SQL 2000 environment.
In the code , we have a single connectionstring to connect database.
The application was running fine for the past 3 years, but all of a sudden we are getting "timeout expired" error only in someparts of the application but not on all database access.
The code which raises this error is a bit large which need to look into table of 8k recs with more conditions.
The same sql query took 1:01 minutes to execute in query qnqlyser.
I changes the script timeout to 900secs,
I herd we need to upgrade MDAC or we need to change connection timeout or we need to cahnge the code.

we cannot change the query, it is the most possible way we could get that.

Can somebody help me with the possible solution.


Thanks & Regards,
Sai. K.K

View 5 Replies View Related

Stored Pro Run Time Erorr -2147217871(80040e31)

Oct 2, 2007

Hey guys, I need your generous heart to share something with what I am experiencing. I found the error from Sql Profiler. Here is the result of my trace:

/*w/o runtime*/
declare @P1 int
set @P1=0
exec CP_glmJournalEntry_Save 1, '110802010200', 'To record PPC-Visa transaction, $4,967.39@Php46.22
select @P1

/*w runtime*/
declare @P1 int
set @P1=NULL
exec CP_glmJournalEntry_Save 1, '210204020202', 'Sample
select @P1

May I know if the runtime came from the stored proc or on the application itself.

Moreover I want to know a lot with stored procedure. I am confusing now because there are times that runtime didn't occur. While some other times runtime occured.

I hope you'll goin to help me,, thanks in advance!

View 2 Replies View Related

How To Retrieve Data From SQL SERVER 2000 ?

Nov 25, 2005

Hello,
Im using Visual Studio 2005 to code ASP.NET
How to query my MS SQL SERVER 2000 to retrieve data from my DataBase?
Ive tried some tutorials, but i kept giving me errorsCan you put a simple source code to retrieve something like "select userID, Name, Age from Users"
Thank you,
 

View 2 Replies View Related

Retrieve Data From Web Services Using DTS (SQL Server 2000)

May 2, 2006

The project I'm currently working on involves combining data from one SQL Server 2000 databases and XML returned from a web service into a 3rd SQL Server 2000 database.

This process must be scheduled to happen once a day. If it weren't for the Web Service, I'd say that this is a no-brainer and I'd use DTS. However, I'm not sure if I can even access a Web Service with DTS. Has anyone done this or have any tips?

View 1 Replies View Related

Equivalent Tsql For Sql Server 2000 Is Needed [from Sql Server 2005 Only Tsql]

Nov 19, 2007

Can anyone please give me the equivalent tsql for sql server 2000 for the following two queries which works fine in sql server 2005

1
-- Full Table Structure

select t.object_id, t.name as 'tablename', c.name as 'columnname', y.name as 'typename', case y.namewhen 'varchar' then convert(varchar, c.max_length)when 'decimal' then convert(varchar, c.precision) + ', ' + convert(varchar, c.scale)else ''end attrib,y.*from sys.tables t, sys.columns c, sys.types ywhere t.object_id = c.object_idand t.name not in ('sysdiagrams')and c.system_type_id = y.system_type_idand c.system_type_id = y.user_type_idorder by t.name, c.column_id


2
-- PK and Index
select t.name as 'tablename', i.name as 'indexname', c.name as 'columnname' , i.is_unique, i.is_primary_key, ic.is_descending_keyfrom sys.indexes i, sys.tables t, sys.index_columns ic, sys.columns cwhere t.object_id = i.object_idand t.object_id = ic.object_idand t.object_id = c.object_idand i.index_id = ic.index_idand c.column_id = ic.column_idand t.name not in ('sysdiagrams')order by t.name, i.index_id, ic.index_column_id

This sql is extracting some sort of the information about the structure of the sql server database[2005]
I need a sql whihc will return the same result for sql server 2000

View 1 Replies View Related

Creating A View To Retrieve Data From More Than One Database Sql Server 2000

Jul 26, 2007

Hi everyone,


we have some reference tables in in a specific database. that other applications need to have access to them. Is it possible to create a view in the application's database to retrive data from ref database while users just have access to the application Database not the view's underlying tables?

Thanks

View 1 Replies View Related

Error When Exporting To Excel Using SSRS 2003

Dec 22, 2006

Hi,

I have encountered an error when attempt to open a report which is exported to Excel using SSRS2003. It looks like this:

Microsoft Office Excel File Repair Log

Errors were detected in file 'C:Documents and SettingsTocsonEIMy DocumentsRigidReports
ptRigidTransactionSummaryReport3.xls'
The following is a list of repairs:

Damage to the file was so extensive that repairs were not possible. Excel attempted to recover your formulas and values, but some data may have been lost or corrupted.


At first I thought it was because of the sheer bulk of the report since when I break down a month's report to every 5 days, it would export without error. So I thought that if I can break a whole report into several worksheets using page break, it might work. Unfortunately, although I did succeed in exporting the whole report into several worksheets, I still encounter the same error. Now I have no idea on what the root of the error is. Note that the same report can be exported in other formats and can be opened without error. Except for a case when I tried opening the same report exported in XML using Excel, an error which might be related to the error above occurs which says that there's an invalid unicode character in the xml file.

Any help in determining the root of the problem and a solution to it?

View 1 Replies View Related

Best Way To Retrieve Oracle Data Into SS2000 Near Real-time?

Jul 19, 2007

I have no idea where to post this kind of question, so here it is!



I have a requirement to retrieve oracle 10 data into SS2000 in as near real-time as possible (stupid users!) and join with resident SS data for on-demand reporting. (We use SS replication to populate some reporting tables from other SS2000 instances and this has spoiled the users as well as the developers! )



I would like to know if there are any clever ways of doing this, or if a plain-old DTS package running in some kind of loop is the practical answer. 1 minute delay is probably too long . . . I don't know if data can be pushed from the oracle side. Or if we need to write a Service and use it to suck and push.



Any suggestions?



thanks!

View 1 Replies View Related

Taking Time For Retrieve Data From Temperary Table

Feb 11, 2008

View 1 Replies View Related

Microsoft OLE DB Provider For ODBC Drivers Error '80040e31'

Sep 24, 2007

View 5 Replies View Related

SSIS Package Error : Export Data From SQL Server 2005 To Access 2003.

Oct 9, 2007



I am exporting 350 tables data from SQL Server 2005 to Access 2003.and getting the below error.

SSIS package "Package2.dtsx" starting.

Information: 0x4004300A at Data Flow Task, DTS.Pipeline: Validation phase is beginning.

Information: 0x40043006 at Data Flow Task, DTS.Pipeline: Prepare for Execute phase is beginning.

Error: 0xC0202009 at Package2, Connection manager "DestinationConnectionOLEDB": SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005.

An OLE DB record is available. Source: "Microsoft JET Database Engine" Hresult: 0x80004005 Description: "Unspecified error".

Error: 0xC020801C at Data Flow Task, Destination 64 - CLIMBINGEXP [8065]: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "DestinationConnectionOLEDB" failed with error code 0xC0202009. There may be error messages posted before this with more information on why the AcquireConnection method call failed.

Error: 0xC004701A at Data Flow Task, DTS.Pipeline: component "Destination 64 - CLIMBINGEXP" (8065) failed the pre-execute phase and returned error code 0xC020801C.


Any clue?

View 2 Replies View Related

DTS Error: Importing From Excel File To SQL Server 2000

Nov 30, 2007

 Data for Source Column 15 'Notes' is too large for the specified buffer size. How do I get around this, I can see some of the notes entries are beyond 255 chars so I changed the destination datatype to textI have never seen this error when importing before. What do I do? 

View 1 Replies View Related

Daylight Savings Time Error SQL SERVER 2000

Mar 20, 2007

Hi all.


After DST change (US/Canada), when I run any of my reports, I get this error:


"An internal error occurred on the report server. See the error log for more
details. (rsInternalError) Get Online Help
Specified argument was out of the range of valid values. Parameter name:
date "


Does anyone have or heard of a solution?


Thank you!

View 9 Replies View Related

Server Reboot Time In Tsql?

Feb 28, 2007

is there a way to find out when the sql server was last rebooted (or how long its been up) in tsql or command prompt (which I will take into tsql)

ta

View 7 Replies View Related

How To Import Data In Sql Server 2000 From An Excel(.xls) File

Feb 23, 2005

i want ot import data from excel .xls file to sql server 2000

into an existing table.
should i use some stored procedures or else

View 5 Replies View Related

Copy Data To Excel File Using Dts Package In Sql Server 2000

Jul 26, 2007

Friends

Any one of you share your knowledge how to transfer data from a database to a excel using dts packages in sqlserver 2000.

I want clear steps how to create a dts package

Appreciate your help

Thanks
satish

View 1 Replies View Related

Retrieve Membership Using TSQL

Jun 8, 2001

Hi,

Pretty new at SQL server.
Is it possible to retrieve role membership for a user using SQL or TSQL and what privileges weill that require.

I did the same thing using SQLDMO but not an acceptable solution
for current requirement (additional granularity in a profiling service)

Any help will be appreciated,

Pierre

View 1 Replies View Related

Extracting Data From Sql Server 2000 To Draw Bar Charts In Powerpoint/excel

Mar 12, 2007

Dear all,

I am doing a project where I heed to extract data from a table in a sql server and then automatically create a bar chart with this data preferrably in PowerPoint (or excel). I was thinking myself that it may be done in vba/macro added to a button in powerpoint. If anyone knows how to do this i would be very grateful or if anyone know a useful website could they post it up.

Thanks for your help

Laura

View 3 Replies View Related

Data Flow Task Error To Extract Data From Sql Server To Excel

Mar 28, 2008

Hi All,

I want to export data from SQL Server2005 to an Excel spreadsheet thru "Data Flow Task". I am using OLE DB for SQL Server for the source connection and a Connection To Excel as my destination source. The Excel spreadsheet (2003) exists and has the first row with column names. I don't have any warnings before trying to execute.

The SQL datable fileds are
i) ID - Int

ii) RefID
iii) txtRemarks - nvarchar(MAX)
iv) ddlWaterLevel - nvarchar(50)

While executing the tasks, I got the error
Error: 0xC0202025 at Data Flow Task, Excel Destination [427]: Cannot create an OLE DB accessor. Verify that the column metadata is valid.
Error: 0xC004701A at Data Flow Task, DTS.Pipeline: component "Excel Destination" (427) failed the pre-execute phase and returned error code 0xC0202025.


After analysing I found in the DataFlow --> Excel destination --> Advanced Editor for Excel Destination, the default data type for txtRemarks shows as "Unicode string [DT_WSTR]". But this is supposed to be "Unicode text stream [DT_NTEXT]". Even if I change the data type in the design time, It doesn't accept.

Please do help me out.

thanks
Sanra

View 4 Replies View Related

Retrieve ALL Related Tables Through TSQL

Apr 30, 2008

Many HUGE Thanks to the person who knows how to do this.

Problem: My goal is to take a single data row (myDataRow) from some table (MyTable) and then retrieve every single associated record throughout the database that is related to that datarow. This requires me to first find out what tables are related to the starting table and then recursively pull all of the associated records until I get all of the records associated. Sounds simple right?

The following code only pulls back only those tables that have a child table
with an associated foreign key (i.e. a 1 -> many):


Select [Name] from sysobjects where xtype='U' and Id in(

select fkeyid from sysforeignkeys where rkeyid=

(Select Id from sysobjects where Name='<TableName>'))

order by name


But this query does not work backwards where I start with a child table
and want to know the parents (i.e. many->1 relationship)

Anybody have a clue how to retrieve these parent related tables when starting with a child table? I know it can be done because SQL Server Management lets you select a table (child OR parent) and retrieve the related table(s).

Thank you for any direction you can suggest!

Best Wishes to All
-Eric

View 6 Replies View Related

Reg: Export Excel 2003 To Sql Server 2005

Mar 31, 2008

I want to export Excell 2003 to Sql Server 2005. I am having the following error while execute the query.


declare @SQL varchar(8000)
create table #temp(i int identity(1,1),SiteName varchar(100),SiteDescription varchar(5000),SiteURL varchar(500),CategoryName varchar(200))
set @SQL='Insert into #temp Select * From OPENROWSET (''Microsoft.Jet.OLEDB.4.0'',''Excel 8.0;Database=' +
'a.xls' +';HDR = YES;IMEX=0'',''SELECT * FROM [Sheet1$]'')'

exec (@SQL)



The OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" reported an error. The provider did not give any information about the error.
Msg 7303, Level 16, State 1, Line 1
Cannot initialize the data source object of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)".

I need a solution urgently. help Pls

View 3 Replies View Related

TSQL - Retrieve All Columns In My MS Access Table Less Two Of Them

Apr 6, 2008

Hi guys,
Working on a MS Access database, I have a table named "myTable" which contains several fields.
I just want to retrieve all the fields (columns) in the myTable, without retrieving Col1 and Col2
What should my SQL string be?

SELECT * (not Col1, Col2) FROM myTable

Thanks in advance for any help.
Aldo.

View 5 Replies View Related

Execution Time Gap Between Simple Tsql And Stored Procedure In SQl Server 2005

Oct 16, 2007

Hi ,

I ma using sql server 2005.I have a bunch of statements of sql and i have created a stored procedure for those. When i execute i found that there is lot's of difference between execution time of stored procedure and direct sql in query windows.

can anyone help me to optimize the execution time for stored prcedure even stored prcedure is very simple.
I have used sql server 2000 and i am new in sql server 2005.

View 1 Replies View Related

Retrieve Local Time From Remote SQL Server Computer

Feb 6, 2004

Hi all

I am about updating some fields with local date and time using blw API
Quote
Private Declare Sub GetLocalTime Lib "kernel32" (lpSystemTime As SYSTEMTIME)

Public Function LocalDateTime()

Dim MyTime As SYSTEMTIME

GetLocalTime MyTime

Debug.Print "The Local Date is:" & MyTime.wMonth & "-" & MyTime.wDay & "-" & MyTime.wYear
Debug.Print "The Local Time is:" & MyTime.wHour & ":" & MyTime.wMinute & ":" & MyTime.wSecond

End Function
Unquote
This works fine however due to it's not really easy for an administrator to keep checking every times wheter local date and time are correctly updated for each front end users computer i would that to reconsider my function and making it to read local date and time from remote SQL Server. my concern is to help administrator to save time as he should only need to ensure that Server is running with correct time...

thkx for any advise

View 1 Replies View Related

SQL 2005 X64 Linked Server To Excel 2003/2007

Aug 27, 2007

Is there a way to create a SQL 2005 x64 Linked server to an Excel (or Access) 2003/2007 file? In SQL 2005 32bit this was possible. Does anyone know of a solution or a work around?

View 3 Replies View Related

How Can I Retrieve Sql 2000 Encrypted Column Data From SQL 2005 Stored Proc?????

Aug 4, 2006



Hi...

I want to retrieve SQL 2000 Encrypted Column Data From SQL 2005 strored proc. My Stored Procedure was on SQL 2000 and it works fine....Then I restore Database From SQL 2000 to SQL 2005. The Following Statement is on my store proce.

select user_id , Encrypt(user_pass) from OpenRowset('SQLOLEDB','myserver';'sa';'mypass',databasename.dbo.users) as a

The Following Error I get When I execute the above statement.



Msg 195, Level 15, State 10, Line 1

'Encrypt' is not a recognized built-in function name.



Thank you.



Bal.

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved