Showing posts with label box. Show all posts
Showing posts with label box. Show all posts

Friday, March 30, 2012

Linking Exchange Server to SQL server

I have SBS 2003 - Exchange and SQL Servers are on the same box.
I have managed to create linked database and can see Exchange Public Folders
in Linked database in Enterprise Manager.
Now the problem is how do a access / read the tables ?
There are a couple of examples in MSDN:
http://msdn2.microsoft.com/en-us/library/ms191461.aspx
For a more comprehensive list of objects, please see this :
http://msdn.microsoft.com/library/de...nces_oledb.asp
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .
|||Hello Paul,
When I try to run the sample query in Query Analyzer following error comes
up -
Server: Msg 7321, Level 16, State 2, Procedure Contacts, Line 3
An error occurred while preparing a query for execution against OLE DB
provider 'exoledb.DataSource.1'.
OLE DB error trace [OLE/DB Provider 'exoledb.DataSource.1'
ICommandPrepare::Prepare returned 0x80040e14].
Please advice if possible
Regards
Sudarshan Deshmukh
"Paul Ibison" wrote:

> There are a couple of examples in MSDN:
> http://msdn2.microsoft.com/en-us/library/ms191461.aspx
> For a more comprehensive list of objects, please see this :
> http://msdn.microsoft.com/library/de...nces_oledb.asp
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com .
>
>
|||Hello Paul,
If i run the following -
SELECT Convert(nvarchar(30), "urn:schemas:contacts:sn") LastName
FROM OpenQuery(Exchange, 'SELECT "urn:schemas:contacts:sn"
FROM SCOPE(''shallow traversal of ".\Contacts"'')')
It comes up with last names...
I am trying to put emails in public folder and get them into SQL server
database.
Is their any simpler way of doing this or totally other way... ?
Please advice ?
Thanks for the showing the correct path in advance :-)
Sudarshan
"Paul Ibison" wrote:

> There are a couple of examples in MSDN:
> http://msdn2.microsoft.com/en-us/library/ms191461.aspx
> For a more comprehensive list of objects, please see this :
> http://msdn.microsoft.com/library/de...nces_oledb.asp
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com .
>
>
|||If you want to avoid using the (fairly obscure ) syntax, take a look at
Microsoft Access - there's a 'Link Exchange / Outlok' wizard which looks
like it might be the easiest way. I can certainly connect to my own mailbox
but unfortunately not the public folders - no doubt this is an Exchange
permission issue. Alternatively it must be possible on the Exchange console
to output the data in csv format. I don't know Exchange well enough for
this. Probably best at this point to try posting in the Exchange newsgroup
who'll know this type of level of detail. Probably also checking on the
legality of obtaining other people's email
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .

Linking Exchange Server to SQL server

I have SBS 2003 - Exchange and SQL Servers are on the same box.
I have managed to create linked database and can see Exchange Public Folders
in Linked database in Enterprise Manager.
Now the problem is how do a access / read the tables ?There are a couple of examples in MSDN:
http://msdn2.microsoft.com/en-us/library/ms191461.aspx
For a more comprehensive list of objects, please see this :
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wss/wss/wss_references_oledb.asp
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .|||Hello Paul,
When I try to run the sample query in Query Analyzer following error comes
up -
Server: Msg 7321, Level 16, State 2, Procedure Contacts, Line 3
An error occurred while preparing a query for execution against OLE DB
provider 'exoledb.DataSource.1'.
OLE DB error trace [OLE/DB Provider 'exoledb.DataSource.1'
ICommandPrepare::Prepare returned 0x80040e14].
--
Please advice if possible
Regards
Sudarshan Deshmukh
"Paul Ibison" wrote:
> There are a couple of examples in MSDN:
> http://msdn2.microsoft.com/en-us/library/ms191461.aspx
> For a more comprehensive list of objects, please see this :
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wss/wss/wss_references_oledb.asp
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com .
>
>|||Hello Paul,
If i run the following -
SELECT Convert(nvarchar(30), "urn:schemas:contacts:sn") LastName
FROM OpenQuery(Exchange, 'SELECT "urn:schemas:contacts:sn"
FROM SCOPE(''shallow traversal of ".\Contacts"'')')
It comes up with last names...
I am trying to put emails in public folder and get them into SQL server
database.
Is their any simpler way of doing this or totally other way... ?
Please advice ?
Thanks for the showing the correct path in advance :-)
Sudarshan
"Paul Ibison" wrote:
> There are a couple of examples in MSDN:
> http://msdn2.microsoft.com/en-us/library/ms191461.aspx
> For a more comprehensive list of objects, please see this :
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wss/wss/wss_references_oledb.asp
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com .
>
>|||If you want to avoid using the (fairly obscure :)) syntax, take a look at
Microsoft Access - there's a 'Link Exchange / Outlok' wizard which looks
like it might be the easiest way. I can certainly connect to my own mailbox
but unfortunately not the public folders - no doubt this is an Exchange
permission issue. Alternatively it must be possible on the Exchange console
to output the data in csv format. I don't know Exchange well enough for
this. Probably best at this point to try posting in the Exchange newsgroup
who'll know this type of level of detail. Probably also checking on the
legality of obtaining other people's email :)
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .sql

Linking Exchange Server to SQL server

I have SBS 2003 - Exchange and SQL Servers are on the same box.
I have managed to create linked database and can see Exchange Public Folders
in Linked database in Enterprise Manager.
Now the problem is how do a access / read the tables ?There are a couple of examples in MSDN:
http://msdn2.microsoft.com/en-us/library/ms191461.aspx
For a more comprehensive list of objects, please see this :
http://msdn.microsoft.com/library/d...ences_oledb.asp
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .|||Hello Paul,
When I try to run the sample query in Query Analyzer following error comes
up -
Server: Msg 7321, Level 16, State 2, Procedure Contacts, Line 3
An error occurred while preparing a query for execution against OLE DB
provider 'exoledb.DataSource.1'.
OLE DB error trace [OLE/DB Provider 'exoledb.DataSource.1'
ICommandPrepare::Prepare returned 0x80040e14].
--
Please advice if possible
Regards
Sudarshan Deshmukh
"Paul Ibison" wrote:

> There are a couple of examples in MSDN:
> http://msdn2.microsoft.com/en-us/library/ms191461.aspx
> For a more comprehensive list of objects, please see this :
> http://msdn.microsoft.com/library/d...ences_oledb.asp
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com .
>
>|||Hello Paul,
If i run the following -
SELECT Convert(nvarchar(30), "urn:schemas:contacts:sn") LastName
FROM OpenQuery(Exchange, 'SELECT "urn:schemas:contacts:sn"
FROM SCOPE(''shallow traversal of ".\Contacts"'')')
It comes up with last names...
I am trying to put emails in public folder and get them into SQL server
database.
Is their any simpler way of doing this or totally other way... ?
Please advice ?
Thanks for the showing the correct path in advance :-)
Sudarshan
"Paul Ibison" wrote:

> There are a couple of examples in MSDN:
> http://msdn2.microsoft.com/en-us/library/ms191461.aspx
> For a more comprehensive list of objects, please see this :
> http://msdn.microsoft.com/library/d...ences_oledb.asp
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com .
>
>|||If you want to avoid using the (fairly obscure ) syntax, take a look at
Microsoft Access - there's a 'Link Exchange / Outlok' wizard which looks
like it might be the easiest way. I can certainly connect to my own mailbox
but unfortunately not the public folders - no doubt this is an Exchange
permission issue. Alternatively it must be possible on the Exchange console
to output the data in csv format. I don't know Exchange well enough for
this. Probably best at this point to try posting in the Exchange newsgroup
who'll know this type of level of detail. Probably also checking on the
legality of obtaining other people's email
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .

Wednesday, March 28, 2012

Linking Drill through Report based on dynamic textbox source.

I'm trying to link a drill through report based on a text box that is derived from a "Switch" function. I only want the drill through capability if the source for the textbox is a certain field from my dataset.
ex: =Switch( Parameters!SummaryBy.Value = "Division", Fields!BranchDivision.Value , Parameters!SummaryBy.Value = "Region", Fields!BranchRegion.Value, Parameters!SummaryBy.Value = "Branch", Fields!BranchNbr.Value, Parameters!SummaryBy.Value = "Satellite", Fields!BranchSatId.Value, Parameters!SummaryBy.Value = "Loan Officer", Fields!LONbr.Value)
so if I only wanted the above textbox to navigate to a subreport if it returned LONbr as the source, what expression would I put in the "Jump to Report" advanced property?Try =IIF(Parameters!SummaryBy.Value = "Loan Officer", <your subreport>,
Nothing).
Fang Wang (MSFT)
Microsoft SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"JKS" <JKS@.discussions.microsoft.com> wrote in message
news:809BE35A-3B2C-4F50-8248-2DAF1709DCF4@.microsoft.com...
> I'm trying to link a drill through report based on a text box that is
derived from a "Switch" function. I only want the drill through capability
if the source for the textbox is a certain field from my dataset.
> ex: =Switch( Parameters!SummaryBy.Value = "Division",
Fields!BranchDivision.Value , Parameters!SummaryBy.Value = "Region",
Fields!BranchRegion.Value, Parameters!SummaryBy.Value = "Branch",
Fields!BranchNbr.Value, Parameters!SummaryBy.Value = "Satellite",
Fields!BranchSatId.Value, Parameters!SummaryBy.Value = "Loan Officer",
Fields!LONbr.Value)
> so if I only wanted the above textbox to navigate to a subreport if it
returned LONbr as the source, what expression would I put in the "Jump to
Report" advanced property?

Linking a SQL Server 2000 DB to 2005

I am trying to link an existing SQL 2000 server to a new 2005 box, but for some reason it will not link. I tried another 2000 server and that one worked perfectly well.

When I link it and perform a simple query...
select a, b from [server1].[db1].[dbo].tablec

I receive a 7314 message with text "OLE DB provider "SQLNCLI" for linked server "server1" does not contain the table "].[db1].[dbo].tablec". The table either does not exist or the current user does not have permissions on that table.

What's odd is that I was able to link the problematic server to other SQL 2000 servers with no previous issues.

Any ideas?

Thanks,
SteveHiya Steve...

Let me start by asking the obvious...have you verified that the table [server1].[db1].[dbo].tablec actually exists on the 2005 server? Check for typing errors here, is what I am getting at.

Also, in Enterprise manager, can you see the target table when you expand the linked server icon and click on the "Tables" icon?

Have you verified that the login information you set up when you created the linked server DOES have permissions on the target database/table?|||Paul,
The table that I'm trying to query is on the SQL 2000 server. I'm running the query from the 2005 box. I probably wrote my initial post incorrectly. But, to answer your question, the table does exist.

The login information that I provided on the 2005 server does have permissions on the target database/table.

Not to sound dumb, but can you view the tables on the linked server from 2005 like you could in 2000?

Thanks for the response,
Steve|||Now I'm outta my league, Steve. Done lots of linking to remote servers/databases by various means, but only on SQL Server 2000.

2005 is still sitting in my desk drawer being ignored until the boss decides other have bled enough against the leading edge.

Friday, March 23, 2012

servers to UDB via IBMDADB2, access denied

A linked server definition in MSSQL 2000, can succcessfully authenticates
with a UDB database v8.1.0.61 on a SUN box, but then gets access denied,
eventhough the account being used has DBADM authority. However, I can
successfully authenticate and query the same UDB databases from a DOS DB2
command prompt on the same windows 2003 server.
See example below and results:
On the windoes 2003 server...
set nocount on
EXEC sp_addlinkedserver
@.server = 'srvr1833',
@.srvproduct = 'aeplm148',
@.provider = 'IBMDADB2',
@.datasrc = 'aeplm148',
@.location = 'srvr1833.dbms.gdomain.com:18330',
@.catalog = 'aeplm148'
go
EXEC sp_addlinkedsrvlogin
@.rmtsrvname = 'srvr1833',
@.useself = false,
@.rmtuser = 'User1',
@.rmtpassword = 'Password1'
go
EXEC sp_serveroption
@.server = 'srvr1833',
@.optname = 'data access',
@.optvalue = 'true'
go
SELECT *
FROM srvr1833.aepcclm148.epl.mline
Results:
Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'IBMDADB2' reported an error. Access denied.
OLE DB error trace [OLE/DB Provider 'IBMDADB2' IUnknown::QueryInterface
returned 0x80070005: Access denied.].
Yet on a DOS command line using db2...
db2 => connect to aeplm148 user User1 using Password1
Database Connection Information
Database server = DB2/SUN 8.1.6
SQL authorization ID = DGIEPL
Local database alias = AEPLM148
db2 => list database directory
System Database Directory
Number of entries in the directory = 1
Database 1 entry:
Database alias = AEPLM148
Database name = AEPLM148
Node name = XX
Database release level = a.00
Comment =
Directory entry type = Remote
Catalog database partition number = -1
Alternate server hostname =
Alternate server port number =
db2 => list node directory show detail
Node Directory
Number of entries in the directory = 1
Node 1 entry:
Node name = XX
Comment =
Directory entry type = LOCAL
Protocol = TCPIP
Hostname = srvr1833.dbms.gdomain.com
Service name = 18330
Remote instance name =
System =
Operating system type = None
db2 => select * from aeplm148.epl.mline fetch first 2 rows only
I_PLANT_PL I_STDY I_PRES_LINE I_PRES_TYP N_LINE_NAME
L_PLAN I_LOAD_TYP I_AUTOM_TYP I_PRES_LINE_SIZE I_PRES_MECHNM_TYP
L_
TCH_PL_LINE_TO_PLT_LINE Q_SHUT_HGT Q_NMBR_OF_STATNS I_UPD_TID D_UPD_LAST
X_COMN
More results followed but not pasted...
Can anybody offer some suggestions?
I've run out of ideas.
I know the linked server is authenticating properly because when I put in a
bad password, the error message returned says, bad password or userid.
One would assume that the problem is on the UDB server only. Yet I can
access the data from the Windows 2003 server using the UDB client in a DOS
prompt.
Both techniques authenticate properly. Only the linked server gets access
denied.
The driver version on the Windows 2003 Server is DB2 v8.1.12.99A clue was found.
This will work when you remote desktop to the server and log in as either
the administrators account to the account in which the database engine is
running under. But it will not work with any other account, even if that
account is part of the administrators group.
What is different about the "Administrator" account from an a account that
is simply a member of the Administor"s" group?
The account used by the sqlserver engine is also part of the administrators
group.
"DBA449" wrote:

> A linked server definition in MSSQL 2000, can succcessfully authenticates
> with a UDB database v8.1.0.61 on a SUN box, but then gets access denied,
> eventhough the account being used has DBADM authority. However, I can
> successfully authenticate and query the same UDB databases from a DOS DB2
> command prompt on the same windows 2003 server.
> See example below and results:
> On the windoes 2003 server...
> set nocount on
> EXEC sp_addlinkedserver
> @.server = 'srvr1833',
> @.srvproduct = 'aeplm148',
> @.provider = 'IBMDADB2',
> @.datasrc = 'aeplm148',
> @.location = 'srvr1833.dbms.gdomain.com:18330',
> @.catalog = 'aeplm148'
> go
> EXEC sp_addlinkedsrvlogin
> @.rmtsrvname = 'srvr1833',
> @.useself = false,
> @.rmtuser = 'User1',
> @.rmtpassword = 'Password1'
> go
> EXEC sp_serveroption
> @.server = 'srvr1833',
> @.optname = 'data access',
> @.optvalue = 'true'
> go
> SELECT *
> FROM srvr1833.aepcclm148.epl.mline
> Results:
> Server: Msg 7399, Level 16, State 1, Line 1
> OLE DB provider 'IBMDADB2' reported an error. Access denied.
> OLE DB error trace [OLE/DB Provider 'IBMDADB2' IUnknown::QueryInterfac
e
> returned 0x80070005: Access denied.].
>
> Yet on a DOS command line using db2...
>
> DB2 => connect to aeplm148 user User1 using Password1
> Database Connection Information
> Database server = DB2/SUN 8.1.6
> SQL authorization ID = DGIEPL
> Local database alias = AEPLM148
> DB2 => list database directory
> System Database Directory
> Number of entries in the directory = 1
> Database 1 entry:
> Database alias = AEPLM148
> Database name = AEPLM148
> Node name = XX
> Database release level = a.00
> Comment =
> Directory entry type = Remote
> Catalog database partition number = -1
> Alternate server hostname =
> Alternate server port number =
> DB2 => list node directory show detail
> Node Directory
> Number of entries in the directory = 1
> Node 1 entry:
> Node name = XX
> Comment =
> Directory entry type = LOCAL
> Protocol = TCPIP
> Hostname = srvr1833.dbms.gdomain.com
> Service name = 18330
> Remote instance name =
> System =
> Operating system type = None
> DB2 => select * from aeplm148.epl.mline fetch first 2 rows only
> I_PLANT_PL I_STDY I_PRES_LINE I_PRES_TYP N_LINE_NAME
> L_PLAN I_LOAD_TYP I_AUTOM_TYP I_PRES_LINE_SIZE I_PRES_MECHNM_T
YP
> L_
> TCH_PL_LINE_TO_PLT_LINE Q_SHUT_HGT Q_NMBR_OF_STATNS I_UPD_TID D_UPD_LAST
> X_COMN
> More results followed but not pasted...
> Can anybody offer some suggestions?
> I've run out of ideas.
> I know the linked server is authenticating properly because when I put in
a
> bad password, the error message returned says, bad password or userid.
> One would assume that the problem is on the UDB server only. Yet I can
> access the data from the Windows 2003 server using the UDB client in a DOS
> prompt.
> Both techniques authenticate properly. Only the linked server gets access
> denied.
> The driver version on the Windows 2003 Server is DB2 v8.1.12.99
>sql

servers SQL2000 to SQL2005

Hi. I am struggling to link a SQL2005 box to a SQL2000 box via linked server.
I have done this before and am replicating what I did then but I can`t get it
to connect. However when I connect via query analyser using the same
credentials it connects with no issues. Has anyone seen this before ?
Si
Si,
Is there any difference in the Security tab of the linked server properties
from your model linked server?
Is Kerberos properly activated on both the SQL2005 and SQL200 boxes? (What
OS?)
Do you get any useful error messages when you try to use the linked server?
RLF
"Simon" <Simon@.discussions.microsoft.com> wrote in message
news:E71D6BEE-B7AC-4D6A-B48F-611AFAE89FE3@.microsoft.com...
> Hi. I am struggling to link a SQL2005 box to a SQL2000 box via linked
> server.
> I have done this before and am replicating what I did then but I can`t get
> it
> to connect. However when I connect via query analyser using the same
> credentials it connects with no issues. Has anyone seen this before ?
> Si

servers SQL2000 to SQL2005

Hi. I am struggling to link a SQL2005 box to a SQL2000 box via linked server
.
I have done this before and am replicating what I did then but I can`t get i
t
to connect. However when I connect via query analyser using the same
credentials it connects with no issues. Has anyone seen this before ?
SiSi,
Is there any difference in the Security tab of the linked server properties
from your model linked server?
Is Kerberos properly activated on both the SQL2005 and SQL200 boxes? (What
OS?)
Do you get any useful error messages when you try to use the linked server?
RLF
"Simon" <Simon@.discussions.microsoft.com> wrote in message
news:E71D6BEE-B7AC-4D6A-B48F-611AFAE89FE3@.microsoft.com...
> Hi. I am struggling to link a SQL2005 box to a SQL2000 box via linked
> server.
> I have done this before and am replicating what I did then but I can`t get
> it
> to connect. However when I connect via query analyser using the same
> credentials it connects with no issues. Has anyone seen this before ?
> Si

servers SQL2000 to SQL2005

Hi. I am struggling to link a SQL2005 box to a SQL2000 box via linked server.
I have done this before and am replicating what I did then but I can`t get it
to connect. However when I connect via query analyser using the same
credentials it connects with no issues. Has anyone seen this before ?
SiSi,
Is there any difference in the Security tab of the linked server properties
from your model linked server?
Is Kerberos properly activated on both the SQL2005 and SQL200 boxes? (What
OS?)
Do you get any useful error messages when you try to use the linked server?
RLF
"Simon" <Simon@.discussions.microsoft.com> wrote in message
news:E71D6BEE-B7AC-4D6A-B48F-611AFAE89FE3@.microsoft.com...
> Hi. I am struggling to link a SQL2005 box to a SQL2000 box via linked
> server.
> I have done this before and am replicating what I did then but I can`t get
> it
> to connect. However when I connect via query analyser using the same
> credentials it connects with no issues. Has anyone seen this before ?
> Sisql

Monday, March 12, 2012

server-Oracle

Posted - 09/29/2004 : 11:46:27
Hi folks,
I have a linked server pointing to oracle server 8i on my sql server 2000 box.
Initially i was able to run queries on sql server using the four part naming
convention. As of today i started to get this error:
Server: Msg 7356, Level 16, State 1Line 239
OLE DB provider 'MSDAORA' supplied inconsistent metadata for a column.
Metadata information was changed at execution time.
OLE DB error trace [Non-interface error: Column 'CALL_COUNT' (compile-time
ordinal 4) of object '"SUMMARY_OWNER"."IVRU_CALL_TRANSACTION_SUMMARY "' was
reported to have a DBTYPE of 130 at compile time and 5 at run time].
What would be causing this error?
Any suggesstions, thank you
Ramdas
Hi Ramdas,
It seems that you are facing the issue described in the following Microsoft
Knowledge Base Article No 251238.
Please visit the following link and see if it helps.
http://support.microsoft.com/?id=251238
Thanks
Soma Sekhara Reddy

Friday, March 9, 2012

server, heterogenous query

Hi all!

I have to pull new data from an Ingres Server over to my MSSQL server. I set the Ingres box up as a linked server and I can do the following:

declare @.start as datetime

set @.startdate = (select start from synctimes)

select * from openquery(INGRES, 'select * from ingrestable') where date > @.start

This does exactly what I want in my testsetup. In real life, the two boxen are connected via a slow connection and I wonder if that way *all* records are transferred and filtered on the MSSQL side, thus I transfer 99.5% rubbish. Is that true and ifso, is there any way to get around this?

in addition, I want to acheive this

CREATE PROCEDURE import_all AS
declare @.myVariable as Cursor
declare @.start as datetime
declare @.tblname as nvarchar(50)

declare myCursor Cursor for
SELECT tblname from synctables

open myCursor

set @.myVariable = myCursor

fetch next from @.myvariable into @.tblname
while @.@.fetch_status = 0
begin
select * from openquery(INGRES, 'select * from @.table where date > @.start')
fetch next from @.myVariable into @.tblname
end
close myCursor
deallocate myCursor

Is this possible?

TIA,

chrisI wonder if that way *all* records are transferred and filtered on the MSSQL side, thus I transfer 99.5% rubbish. Is that true and ifso, is there any way to get around this?
Yup, you are transfering all the records and THEN filtering, try:

declare @.startdate as datetime, @.TSQL as varchar(255)
select @.startdate = getdate()
set @.TSQL = 'select * from openquery(INGRES, ''select * from ingrestable where date > ''' + convert(varchar(25),@.startdate,121) + ''')'
print @.TSQL
exec(@.TSQL)

I don't exactly recall what date format Ingres uses but you can adjust the convert as needed.

as for your sp, I think you are on the right track but I see some problems. Consider:

CREATE PROCEDURE import_all(
@.Debug bit = 0)
AS

declare @.start as datetime
, @.tblname as nvarchar(50)
, @.TSQL as varchar(255)

select @.tblname = min(tblname from synctables
while (@.tblname is not null) begin
set @.TSQL = 'select * from openquery(INGRES, ''select * from ' + @.table + ' where date ''' + convert(varchar(25),@.startdate,121) + ''')'
if (@.Debug > 0)
raiserror('%s',0,1,@.TSQL)
else
exec(@.TSQL)
select @.tblname = min(tblname from synctables where tblname > @.tblname
end

return 0

Of course I have no way of test this, on your first run you may want to set @.Debug to 1 to check the resulting code.|||Thanks alot. Seems to be just what I needed. Couldn't test it though because of a defective ingres odbc driver I won't reinstall before monday or tuesday. I'll post my results afterwards ;-)