Showing posts with label run. Show all posts
Showing posts with label run. Show all posts

Thursday, March 29, 2012

Executable or Way for User to Launch an SQL Package?

I have a sitation where I need a dts package or similar to run at a user initiated time. I do not want to give the user access to the server. Any ideas on how one goes about something like this?Howdy

If its through a web or VB type app, let the web app execute a stored procedure called by the app.

Cheers,

SG.|||Hey,
from a vb app or vb script you can do this function:

Public Sub ExecuteEDIPackage(FileName As Variant)

Dim sServer As String
Dim sUsername As String
Dim sPassword As String
Dim sPackageName As String
Dim lErr As Long
Dim sSource As String
Dim sDesc As String

Set oPKG = New DTS.Package

' Set Parameter Values
sPackageName = "EDIPackage"

' Load Package
oPKG.LoadFromSQLServer DataSource, UserName, Password, _
DTSSQLStgFlag_Default, , , , sPackageName

' Set Exec on Main Thread
For Each oStep In oPKG.Steps
oStep.ExecuteInMainThread = True
Next

' Execute
oPKG.Execute

' Get Status and Error Message
For Each oStep In oPKG.Steps
If oStep.ExecutionResult = DTSStepExecResult_Failure Then
oStep.GetExecutionErrorInfo lErr, sSource, sDesc
sMessage = sMessage & "Step """ & oStep.Name & _
""" Failed" & vbCrLf & _
vbTab & "Error: " & lErr & vbCrLf & _
vbTab & "Source: " & sSource & vbCrLf & _
vbTab & "Description: " & sDesc & vbCrLf & vbCrLf
Else
sMessage = sMessage & "Step """ & oStep.Name & _
""" Succeeded" & vbCrLf & vbCrLf
End If
Next

oPKG.UnInitialize

Set oStep = Nothing
Set oPKG = Nothing

End Sub

EXEC(@SQL) And Unicode Result Bug

I've got a dynamic SQL query that is generated inside a SP, and is run using
the
EXEC (@.SQL)
or
EXEC sp_executesql @.SQL
This has worked fine until now, where we are now using a database for
unicode charachters to support Japanese language.
All fixed code stored procedures return data correctly in the unicode
format. However, i have had to use string splicing in certain situations to
generate a fully customisable query. These queries all run using EXEC /
sp_executesql from inside the SP. However, i have discovered that all data i
s
return '?' instead of unicode charachters.
This is a cause of some serious issues, and i hope someone can tell me if
there is a solution for this!
Cheers
TrisTris (Tris@.discussions.microsoft.com) writes:
> I've got a dynamic SQL query that is generated inside a SP, and is run
> using the
> EXEC (@.SQL)
> or
> EXEC sp_executesql @.SQL
> This has worked fine until now, where we are now using a database for
> unicode charachters to support Japanese language.
> All fixed code stored procedures return data correctly in the unicode
> format. However, i have had to use string splicing in certain situations
> to generate a fully customisable query. These queries all run using EXEC
> / sp_executesql from inside the SP. However, i have discovered that all
> data is return '?' instead of unicode charachters.
> This is a cause of some serious issues, and i hope someone can tell me if
> there is a solution for this!
First of all, you should use sp_executesql and parameterised statements
rather than EXEC() for dynamic SQL. For a longer disucssion see
http://www.sommarskog.se/dynamic_sql.html.
As for your actual problem, it's diffcult to say without seeing the code.
But my guess would be that you have some varchar variable somewhere that
causes problems, or that you use '' for literals rather than N''. Again,
I suspect that these are problems that would go away if you always use
parameterised statements and never interpolate values into the query string.
I like to stress that this is all guessworks.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||Can you post a script that reproduces the problem? Erland mentioned causes
of these symptoms that are not bugs but a specific case is needed to clearly
determine whether or not your issue is a defect or expected behavior.
Hope this helps.
Dan Guzman
SQL Server MVP
"Tris" <Tris@.discussions.microsoft.com> wrote in message
news:A6E5E6A6-F96E-44C8-938F-EC0D459C7862@.microsoft.com...
> I've got a dynamic SQL query that is generated inside a SP, and is run
> using
> the
> EXEC (@.SQL)
> or
> EXEC sp_executesql @.SQL
> This has worked fine until now, where we are now using a database for
> unicode charachters to support Japanese language.
> All fixed code stored procedures return data correctly in the unicode
> format. However, i have had to use string splicing in certain situations
> to
> generate a fully customisable query. These queries all run using EXEC /
> sp_executesql from inside the SP. However, i have discovered that all data
> is
> return '?' instead of unicode charachters.
> This is a cause of some serious issues, and i hope someone can tell me if
> there is a solution for this!
> Cheers
> Tris|||Hi, thanks for the responses.
Yes, some of the arguments used to generate the string were VARCHAR, and
changing them to NVARCHAR has solved the problem.
Cheers
T

Exec VBScript file from T-SQL?

Is there a way to run a VBScript file from a T-SQL script (SQL 2000)?

Yes, it requires using xp_executeSQL.

That is a 'MAJOR' security issue and should not be done lightly -if at all. It also requires admin permissions in the server (or a proxy).

Perhaps if you were to provide more detail about your needs, folks here would help come up with 'safer' alternatives -if possible.

|||The root of the problem is that CDOSYS email has stopped working from SQL. It still works from VBScript, though. We rebooted the server (Win 2000 SP 3) and that fixed the problem, but only for a few days. Someone suggested converting our CDOSYS emails to VBScript. I am hoping that someday CDOSYS works again from SQL so I wanted to not change the job too much if possible. However, if it's a big security issue, I may change the steps that generate emails from T-SQL to OS Command line steps and exec the VBScript that way.|||

If you are wanting to send email from SQL Server 2000, then I recommend that you examine xp_smtp_email. It is more reliable and less of a security issue than using a mapi client on the server.

Email for SQL Server 2000
http://www.sqldev.net/xp/xpsmtp.htm

Also, click here for a similar forum thread.

sql

Exec VBScript file from T-SQL?

Is there a way to run a VBScript file from a T-SQL script (SQL 2000)?

Yes, it requires using xp_executeSQL.

That is a 'MAJOR' security issue and should not be done lightly -if at all. It also requires admin permissions in the server (or a proxy).

Perhaps if you were to provide more detail about your needs, folks here would help come up with 'safer' alternatives -if possible.

|||The root of the problem is that CDOSYS email has stopped working from SQL. It still works from VBScript, though. We rebooted the server (Win 2000 SP 3) and that fixed the problem, but only for a few days. Someone suggested converting our CDOSYS emails to VBScript. I am hoping that someday CDOSYS works again from SQL so I wanted to not change the job too much if possible. However, if it's a big security issue, I may change the steps that generate emails from T-SQL to OS Command line steps and exec the VBScript that way.|||

If you are wanting to send email from SQL Server 2000, then I recommend that you examine xp_smtp_email. It is more reliable and less of a security issue than using a mapi client on the server.

Email for SQL Server 2000
http://www.sqldev.net/xp/xpsmtp.htm

Also, click here for a similar forum thread.

Exec time for a query to run in QA?

Hi All
I want to see how long it takes for my query to execute in QA. How do i do
that? Thanx in advanceThere is an Execution Time element at the lower right hand part of the
screen in QA. Optionally you could turn on Client Statistics, Statistics
Time or using GETDATE() before and after your query.
HTH
Jerry
"MittyKom" <MittyKom@.discussions.microsoft.com> wrote in message
news:00E0F137-A60C-44F6-964B-23C0D27A89C9@.microsoft.com...
> Hi All
> I want to see how long it takes for my query to execute in QA. How do i do
> that? Thanx in advance|||When it's done, look in the lower right corner of the status bar, the third
box from the right shows elapsed time.
You can also do another tactic, like
SELECT @.dt = CURRENT_TIMESTAMP
-- query here
SELECT DATEDIFF(MS, @.dt, CURRENT_TIMESTAMP)
You can also look at SET STATISTICS TIME and SET STATISTICS IO topics in
books online to see how to return different stats about the query or
queries. Showing execution plan and server/client statictics can also be
useful.
http://www.aspfaq.com/2245
A
"MittyKom" <MittyKom@.discussions.microsoft.com> wrote in message
news:00E0F137-A60C-44F6-964B-23C0D27A89C9@.microsoft.com...
> Hi All
> I want to see how long it takes for my query to execute in QA. How do i do
> that? Thanx in advance|||MittyKom wrote:
> Hi All
> I want to see how long it takes for my query to execute in QA. How do
> i do that? Thanx in advance
Best way is to use Profiler. But you can use SET STATISTICS TIME ON /
OFF from Query Analyzer to see the execution. STATISTICS IO is also
useful. Try this:
SET STATISTICS IO ON
SET STATISTICS TIME ON
GO
SELECT * FROM pubs.dbo.authors
GO
SET STATISTICS IO OFF
SET STATISTICS TIME OFF
GO
David Gugick
Quest Software
www.imceda.com
www.quest.com

Exec Stored Procedures with high level user permissions

I need to run a stored procedure with admin rights inside the stored procedure like so

Exec xp_cmdshell "c:\start.exe"

i need this to have administrator access so when it is called upon by an asp.net web page that executes the stored procedure it is not run by Network Service user but Administrator. How would i do this.it's the account that runs sqlserver serice that you need|||i am sorry i still don't understand if you could give an example stored procedure or

are you stating that the user that stored the stored procedure is the user level it is run at.|||ohh i forgot to add thank you for replying so fast last time|||what i am saying is that you need to make sure that the account that is used to start sqlserver service is an account that is given enough priveleges to perform the task you need.|||so if the service is started by user Administrator which it alwasy is. That is the user used to start any programs in the stored procedure.

Tuesday, March 27, 2012

exec sp_dropmergearticle @publication = N'RWBreathe_Publication', @article = N'Call'

hi :
i got error when i run above command
Cannot drop article 'Call' from publication 'RWBreathe_Publication'
because its snapshot has been run and this publication could have active
subscriptions.
i used merge replication , and PDA as subscriber.
Cheers
Nick
Nick,
this is one difference to transactional replication. In merge you can't drop
subscriptions then drop an article. In fact, as soon as the snapshot agent
has run, your options are limited. If you script it out then recreate it
without running the snapshot agent, you'll ba able to drop the article from
Enterprise Manager. Alternatively of course you could remove references to
the article in the script before running it.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
sql

Exec replacement

I have a large query that needs to run .
This query has a lot of dinamic parameters ( i.e. wich are send from
the aplicattion ie (1,2,3)).
There are NO select rights granted on the table for the application
role so i need to run a stored proc.
If I put exec in the stored proc i get a error message saying I do not
have the rights. How should I go around and replace exec. I need a
efficient solution.
Thank you,Perhasps you need to create a UDF . Or grant SELECT/UPDATE/INSERT/DELETE
permissions on underlying tables
<petcu.bogdan@.gmail.com> wrote in message
news:1127908009.777329.306010@.g14g2000cwa.googlegroups.com...
>I have a large query that needs to run .
> This query has a lot of dinamic parameters ( i.e. wich are send from
> the aplicattion ie (1,2,3)).
> There are NO select rights granted on the table for the application
> role so i need to run a stored proc.
> If I put exec in the stored proc i get a error message saying I do not
> have the rights. How should I go around and replace exec. I need a
> efficient solution.
> Thank you,
>|||On 28 Sep 2005 04:46:49 -0700, petcu.bogdan@.gmail.com wrote:

>I have a large query that needs to run .
>This query has a lot of dinamic parameters ( i.e. wich are send from
>the aplicattion ie (1,2,3)).
>There are NO select rights granted on the table for the application
>role so i need to run a stored proc.
>If I put exec in the stored proc i get a error message saying I do not
>have the rights. How should I go around and replace exec. I need a
>efficient solution.
>Thank you,
Hi petcu,
Check out the site below. It explains why you can't use dynamic SQL with
your security setup, and also gives alternatives for all common uses for
dynamic SQL.
http://www.sommarskog.se/dynamic_sql.html
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)

Monday, March 26, 2012

EXEC in SQL Functions

Hi,

I need to pass a table name and id to a function and return a row count
I need to use EXEC or SP_EXECUTESQL to run dynamic SQL
It wont work in functions. Following is my function

alter FUNCTION [dbo].[GetRowCount] (@.TblName NVARCHAR(25) , @.Itemid INT)
RETURNS INT
AS BEGIN
DECLARE @.RowCnt INT
set @.RowCnt = 0
DECLARE @.Sqlstring nvarchar(2000)

set @.Sqlstring = 'SELECT @.RowCnt = COUNT(*) FROM ['+ @.TblName +'] WHERE Itemid = '+ convert(varchar(10),@.Itemid)
EXEC @.Sqlstring

RETURN @.RowCnt
END

while executing this I get the following error ....
"Only functions and extended stored procedures can be executed from within a function." and "Incorrect syntax near the keyword 'EXEC' "

does anyone have any ideas of this ?
Thanks.
vidhya

Moving to the T-SQL forum.|||

You can't use sp_executesql inside functions.

Why would you want to do this? Perhaps you can change the calling mechanism?

|||You cannot execute a command with exec or sp_executesql nor can execute a stored procedure in a function.
HTH, jens Suessmeyer.

http://www.sqlserver2005.de
|||

instead of using sp_execute, write another function and pass that variable value into that function.

u can call function into another function.

|||

You cannot use an exec statement with in a user defined function. What i can see in your code is you are returning single integer value from your function which you can very well do in a stored procedure using return statement there as well.

I think you should do it in a stored procedure

sql

EXEC in SQL Functions

Hi,

I need to pass a table name and id to a function and return a row count
I need to use EXEC or SP_EXECUTESQL to run dynamic SQL
It wont work in functions. Following is my function

alter FUNCTION [dbo].[GetRowCount] (@.TblName NVARCHAR(25) , @.Itemid INT)
RETURNS INT
AS BEGIN
DECLARE @.RowCnt INT
set @.RowCnt = 0
DECLARE @.Sqlstring nvarchar(2000)

set @.Sqlstring = 'SELECT @.RowCnt = COUNT(*) FROM ['+ @.TblName +'] WHERE Itemid = '+ convert(varchar(10),@.Itemid)
EXEC @.Sqlstring

RETURN @.RowCnt
END

while executing this I get the following error ....
"Only functions and extended stored procedures can be executed from within a function." and "Incorrect syntax near the keyword 'EXEC' "

does anyone have any ideas of this ?
Thanks.
vidhya

Moving to the T-SQL forum.|||

You can't use sp_executesql inside functions.

Why would you want to do this? Perhaps you can change the calling mechanism?

|||You cannot execute a command with exec or sp_executesql nor can execute a stored procedure in a function.
HTH, jens Suessmeyer.

http://www.sqlserver2005.de
|||

instead of using sp_execute, write another function and pass that variable value into that function.

u can call function into another function.

|||

You cannot use an exec statement with in a user defined function. What i can see in your code is you are returning single integer value from your function which you can very well do in a stored procedure using return statement there as well.

I think you should do it in a stored procedure

Friday, March 23, 2012

exe to export reports to pdf

Hi,
We have a need to create something like a win app that would be scheduled to
run on the web/reporting server, query the db, pass some parameters to
reports and auto-generate them in pdf format (to be stored in db or on the
same box) to make them available for the website visitors.
Have anybody done something like this before or seen an example of? We tried
to do something similar when reporting services when it just came out but
were unable to implement. Would really appreciate any advice on how to
tackle this!Thanks! Are you using data-driven subscription feature for this? Is it only
available with Enterprise SQL edition?
"Wickherm" <Wickherm@.discussions.microsoft.com> wrote in message
news:3CF580B4-0CD1-4C37-8099-2B65FBF846B2@.microsoft.com...
> We use the subscriptons in RS to schedule reports to save to a file share.
> The parameters in the reports call outside dll's to get the values.
> "ilona" wrote:
>> Hi,
>> We have a need to create something like a win app that would be scheduled
>> to
>> run on the web/reporting server, query the db, pass some parameters to
>> reports and auto-generate them in pdf format (to be stored in db or on
>> the
>> same box) to make them available for the website visitors.
>> Have anybody done something like this before or seen an example of? We
>> tried
>> to do something similar when reporting services when it just came out but
>> were unable to implement. Would really appreciate any advice on how to
>> tackle this!
>>

Wednesday, March 21, 2012

Excluding a column with snapshot replication

I have a database that I'm trying to replicate to allow users to run MI
type queries. This would remove the impact on the operational database
of long running expensive queries. The database records details of
emails including the text and is about 40 GB in size. The database is
part of a package system. One table contains all the text of all emails
in an ntext column and accounts for 25 GB. I would like to exclude the
column from replication as with it, replication takes over 12 hours and
the MI queries do not use the column. However, the queries do use views
that reference the column.
I'm using snapshot replication that runs once a day. In the
"Publication Properties" in the "Filter Columns" tab, I de-selected the
column. The target database has an identical schema to the source
database. When the distribution job runs it fails with a message
indicating it couldn't bulk load the table in question and the error
message indicates that an "Unexpected EOF encountered in BCP data-file".
I've assumed that the BCP data file has a structure that is at
variance with the table. I tried dropping the column from the target
table but replication then fails during the application of a number of
*View.sch scripts because the views reference the column. This is
despite the fact that the publication property for all database objects
is not to drop them.
Can anyone suggest a way in which I can get replication to work without
including the data in one column but to retain the complete schema.
TIA
Laurence Breeze
Laurence,
you could replicate the table (minus the problem column) to a table of
another name. Create a view which has the old tablename and queries the new
table, with an additional column containing a hardcoded null.
Rgds,
Paul Ibison
|||Thanks Paul,
This has done the trick.
Laurence
Paul Ibison wrote:
> Laurence,
> you could replicate the table (minus the problem column) to a table of
> another name. Create a view which has the old tablename and queries the new
> table, with an additional column containing a hardcoded null.
> Rgds,
> Paul Ibison
>

Monday, March 19, 2012

Exclude a Table from SQL 2005 Backup Maintenance Plan

Hi All,

I'm seeking feedback on a backup issue. I have several databases that I run full backups on nightly (simple recovery) using a SQL 2005 maintenance plan.

Each database has 1 or 2 tables that hold non-critical spam hit data. This data accounts for approximately half the database size and grows daily.

My question: Is there a simple way to skip / exclude 1 or 2 tables during a native SQL backup routine either via SQL maintenance plan of TSQL.

All help is greatly appreciated.

Thanks.

Rick B

Have you considered moving this tables to their own file group. You can then skip backing up this file group. Other choice may to move these tables to another database?

Thanks

|||Supporting Sunil's suggestion to move the table to a different FILEGROUP there is a Books Online topic on this:

Partial Backups (link to it).

Regards,
Boris.|||

Thanks Sunil and Boris. I guess I was leaning towards that way. THanks you for taking the time to reply.

Regards,

Rick Broider

Exclude a Table from SQL 2005 Backup Maintenance Plan

Hi All,
I'm seeking feedback on a backup issue. I have several databases that I run
full backups on nightly (simple recovery) using a SQL 2005 maintenance plan.
Each database has 1 or 2 tables that hold non-critical spam hit data. This
data accounts for approximately half the database size and grows daily.
My question: Is there a simple way to skip / exclude 1 or 2 tables during a
native SQL backup routine either via SQL maintenance plan of TSQL.
All help is greatly appreciated.
Thanks.
--
Rick BWhat about creating seperate filegroups for those tables and not backup
up those filegroups?
http://sqlservercode.blogspot.com/|||But be aware that such a restore is not trivial, and one has to ensure that one has complete
knowledge of the implications such strategy has on the restore process. I'd move those tables into
another database instead.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"SQL" <denis.gobo@.gmail.com> wrote in message
news:1134133417.029908.208880@.g49g2000cwa.googlegroups.com...
> What about creating seperate filegroups for those tables and not backup
> up those filegroups?
> http://sqlservercode.blogspot.com/
>

Exchange Linked Server

I'm trying to run a view that calls a table in a linked server (linked to
Exchange on an SBS 03 box)
The linked server shows the correct tables in the Exchange public folders.
The query is;
CREATE VIEW dbo.vw_Exchange_Contacts
AS
SELECT CONVERT(nvarchar(50), [DAV:id]) AS DAVUID, CONVERT(nvarchar(50),
[urn:schemas:Customers:title]) AS Title, CONVERT(nvarchar(50),
[urn:schemas:Customers:sn]) AS Surname,
CONVERT(nvarchar(50), [urn:schemas:Customers:o]) AS Company,
CONVERT(nvarchar(50),
[urn:schemas:Customers:mailingstreet]) AS
Mailing_Street, CONVERT(nvarchar(25), [urn:schemas:Customers:mailingstate])
AS Mailing_State,
CONVERT(nvarchar(25),
[urn:schemas:Customers:mailingpostalcode]) AS Mailing_Postal_Code,
CONVERT(nvarchar(50),
[urn:schemas:Customers:mailingpostaladdress]) AS
Mailing_Postal_Address, CONVERT(nvarchar(50),
[urn:schemas:Customers:mailingcity])
AS Mailing_City, CONVERT(nvarchar(50),
[urn:schemas:Customers:fileas]) AS FileAS, CONVERT(nvarchar(50),
[urn:schemas:Customers:telephoneNumber]) AS Tel,
CONVERT(nvarchar(50), [urn:schemas:Customers:givenName]) AS FirstName
FROM OPENQUERY(Exchange,
'SELECT
"DAV:id","urn:schemas:Customers:title","urn:schema s:Customers:sn","urn:schemas:Customers:o","urn:sch emas:Customers:mailingstreet","urn:schemas:Custome rs:mailingstate","urn:schemas:Customers:mailingpos talcode","urn:schemas:Customers:mailingpostaladdre ss","
urn:schemas:Customers:mailingcity","urn:schemas:Cu stomers:fileas"
,"urn:schemas:Customers:telephoneNumber" ,"urn:schemas:Customers:givenName"
FROM "http://vj-sbs/public/Customers"')
Rowset_2
The problem is that the only field that is returned correctly is the DAV:ID
field; the rest are returned as NULL.
I've run the same sort of view on another SBS 2000 box correctly.
Any thoughts?
I should have added that if there is a better way to achieve the same thing,
i.e. bringing in the contacts from an exchange public folder then I'd also
love to hear about it.
Thanks in advance,
Mike
OnSite Applications.
"Mike" <yada@.yada.com> wrote in message news:42bf610c$1@.quokka.wn.com.au...
> I'm trying to run a view that calls a table in a linked server (linked to
> Exchange on an SBS 03 box)
> The linked server shows the correct tables in the Exchange public folders.
> The query is;
> CREATE VIEW dbo.vw_Exchange_Contacts
> AS
> SELECT CONVERT(nvarchar(50), [DAV:id]) AS DAVUID,
> CONVERT(nvarchar(50), [urn:schemas:Customers:title]) AS Title,
> CONVERT(nvarchar(50),
> [urn:schemas:Customers:sn]) AS Surname,
> CONVERT(nvarchar(50), [urn:schemas:Customers:o]) AS Company,
> CONVERT(nvarchar(50),
> [urn:schemas:Customers:mailingstreet]) AS
> Mailing_Street, CONVERT(nvarchar(25),
> [urn:schemas:Customers:mailingstate]) AS Mailing_State,
> CONVERT(nvarchar(25),
> [urn:schemas:Customers:mailingpostalcode]) AS Mailing_Postal_Code,
> CONVERT(nvarchar(50),
> [urn:schemas:Customers:mailingpostaladdress]) AS
> Mailing_Postal_Address, CONVERT(nvarchar(50),
> [urn:schemas:Customers:mailingcity])
> AS Mailing_City, CONVERT(nvarchar(50),
> [urn:schemas:Customers:fileas]) AS FileAS, CONVERT(nvarchar(50),
> [urn:schemas:Customers:telephoneNumber]) AS Tel,
> CONVERT(nvarchar(50), [urn:schemas:Customers:givenName]) AS FirstName
> FROM OPENQUERY(Exchange,
> 'SELECT
> "DAV:id","urn:schemas:Customers:title","urn:schema s:Customers:sn","urn:schemas:Customers:o","urn:sch emas:Customers:mailingstreet","urn:schemas:Custome rs:mailingstate","urn:schemas:Customers:mailingpos talcode","urn:schemas:Customers:mailingpostaladdre ss"
,"urn:schemas:Customers:mailingcity","urn:schemas: Customers:fileas"
> ,"urn:schemas:Customers:telephoneNumber"
> ,"urn:schemas:Customers:givenName" FROM "http://vj-sbs/public/Customers"')
> Rowset_2
> The problem is that the only field that is returned correctly is the
> DAV:ID field; the rest are returned as NULL.
> I've run the same sort of view on another SBS 2000 box correctly.
> Any thoughts?
>

Exchange Linked Server

I'm trying to run a view that calls a table in a linked server (linked to
Exchange on an SBS 03 box)
The linked server shows the correct tables in the Exchange public folders.
The query is;
CREATE VIEW dbo.vw_Exchange_Contacts
AS
SELECT CONVERT(nvarchar(50), [DAV:id]) AS DAVUID, CONVERT(nvarchar(5
0),
[urn:schemas:Customers:title]) AS Title, CONVERT(nvarchar(50),
[urn:schemas:Customers:sn]) AS Surname,
CONVERT(nvarchar(50), [urn:schemas:Customers:o]) AS Company,
CONVERT(nvarchar(50),
& #91;urn:schemas:Customers:mailingstreet]
) AS
Mailing_Street, CONVERT(nvarchar(25), [urn:schemas:Customers:mailingstat
e])
AS Mailing_State,
CONVERT(nvarchar(25),
& #91;urn:schemas:Customers:mailingpostalc
ode]) AS Mailing_Postal_Code,
CONVERT(nvarchar(50),
& #91;urn:schemas:Customers:mailingpostala
ddress]) AS
Mailing_Postal_Address, CONVERT(nvarchar(50),
[urn:schemas:Customers:mailingcity])
AS Mailing_City, CONVERT(nvarchar(50),
[urn:schemas:Customers:fileas]) AS FileAS, CONVERT(nvarchar(50),
& #91;urn:schemas:Customers:telephoneNumbe
r]) AS Tel,
CONVERT(nvarchar(50), [urn:schemas:Customers:givenName]) AS FirstName
FROM OPENQUERY(Exchange,
'SELECT
"DAV:id","urn:schemas:Customers:title","urn:schemas:Customers:sn","urn:schem
as:Customers:o","urn:schemas:Customers:mailingstreet","urn:schemas:Customers
:mailingstate","urn:schemas:Customers:mailingpostalcode","urn:schemas:Custom
ers:mailingpostaladdress","
urn:schemas:Customers:mailingcity","urn:schemas:Customers:fileas"
,"urn:schemas:Customers:telephoneNumber" ,"urn:schemas:Customers:givenName"
FROM "http://vj-sbs/public/Customers"')
Rowset_2
The problem is that the only field that is returned correctly is the DAV:ID
field; the rest are returned as NULL.
I've run the same sort of view on another SBS 2000 box correctly.
Any thoughts?I should have added that if there is a better way to achieve the same thing,
i.e. bringing in the contacts from an exchange public folder then I'd also
love to hear about it.
Thanks in advance,
Mike
OnSite Applications.
"Mike" <yada@.yada.com> wrote in message news:42bf610c$1@.quokka.wn.com.au...
> I'm trying to run a view that calls a table in a linked server (linked to
> Exchange on an SBS 03 box)
> The linked server shows the correct tables in the Exchange public folders.
> The query is;
> CREATE VIEW dbo.vw_Exchange_Contacts
> AS
> SELECT CONVERT(nvarchar(50), [DAV:id]) AS DAVUID,
> CONVERT(nvarchar(50), [urn:schemas:Customers:title]) AS Title,
> CONVERT(nvarchar(50),
> [urn:schemas:Customers:sn]) AS Surname,
> CONVERT(nvarchar(50), [urn:schemas:Customers:o]) AS Company,
> CONVERT(nvarchar(50),
> & #91;urn:schemas:Customers:mailingstreet]
) AS
> Mailing_Street, CONVERT(nvarchar(25),
> & #91;urn:schemas:Customers:mailingstate])
AS Mailing_State,
> CONVERT(nvarchar(25),
> & #91;urn:schemas:Customers:mailingpostalc
ode]) AS Mailing_Postal_Code,
> CONVERT(nvarchar(50),
> & #91;urn:schemas:Customers:mailingpostala
ddress]) AS
> Mailing_Postal_Address, CONVERT(nvarchar(50),
> [urn:schemas:Customers:mailingcity])
> AS Mailing_City, CONVERT(nvarchar(50),
> [urn:schemas:Customers:fileas]) AS FileAS, CONVERT(nvarchar(50),
> & #91;urn:schemas:Customers:telephoneNumbe
r]) AS Tel,
> CONVERT(nvarchar(50), [urn:schemas:Customers:givenName]) AS FirstName
> FROM OPENQUERY(Exchange,
> 'SELECT
> "DAV:id","urn:schemas:Customers:title","urn:schemas:Customers:sn","urn:schemas:Cus
tomers:o","urn:schemas:Customers:mailingstreet","urn:schemas:Customers:mailingstate"
,"urn:schemas:Customers:mailingpostalcode"," urn:schemas:Customers:mailingpostaladdre
ss"
,"urn:schemas:Customers:mailingcity","urn:schemas:Customers:fileas"
> ,"urn:schemas:Customers:telephoneNumber"
> ,"urn:schemas:Customers:givenName" FROM "http://vj-sbs/public/Customers"')
> Rowset_2
> The problem is that the only field that is returned correctly is the
> DAV:ID field; the rest are returned as NULL.
> I've run the same sort of view on another SBS 2000 box correctly.
> Any thoughts?
>

Monday, March 12, 2012

Exchange

Can I run Exchange 2003 and SQL 2000 on the same server
Hi
Yes, but the 2 will compete for disk, CPU and memory resources. Lightly used
servers are a candidate.
If you do, you must set SQL to a fixed memory size so that it will not give
up or claim more and starve it self of Exchange.
Regards
Mike
"Walleye" wrote:

> Can I run Exchange 2003 and SQL 2000 on the same server
>

Exchange

Can I run Exchange 2003 and SQL 2000 on the same serverHi
Yes, but the 2 will compete for disk, CPU and memory resources. Lightly used
servers are a candidate.
If you do, you must set SQL to a fixed memory size so that it will not give
up or claim more and starve it self of Exchange.
Regards
Mike
"Walleye" wrote:
> Can I run Exchange 2003 and SQL 2000 on the same server
>

Wednesday, March 7, 2012

EXCEPTION_ACCESS_VIOLATION

hello!

i am trying to import a text file using dts into a table created by the
package. everything checks out until it is run. the table is created
but then i get an error:
"need to run the object to perform the operation. Provider generated
code execution exception EXCEPTION_ACCESS_VIOLATION"

any ideas?
this is a development box. maybe the server cant handle it?
thanks in advance!
Tom<tomcaml@.yahoo.com> wrote in message
news:1106153734.711603.163950@.z14g2000cwz.googlegr oups.com...
> hello!
> i am trying to import a text file using dts into a table created by the
> package. everything checks out until it is run. the table is created
> but then i get an error:
> "need to run the object to perform the operation. Provider generated
> code execution exception EXCEPTION_ACCESS_VIOLATION"
>
> any ideas?
> this is a development box. maybe the server cant handle it?
> thanks in advance!
> Tom

You don't mention your version of MSSQL, but here are a couple of related KB
articles:

http://support.microsoft.com/kb/268413/EN-US/
http://support.microsoft.com/kb/271889/EN-US/

Another possibility is to try setting the task to execute on the main
package thread:

http://www.sqldts.com/default.aspx?232

If that doesn't help, you might want to post to
microsoft.public.sqlserver.dts, with more details of your environment and
exactly what task is failing.

Simon

Sunday, February 26, 2012

Exception found in thread "main"

Hi all,
I have a program running problem. When I run the java program, it shows
Exception in thread "main" java.lang.NoClassDefFoundError: jdbcTest
I'm not sure if it is related to the JDBC driver setting program coding error. Thanks.
Elaine
Can you post your code that demonstrates the behavior? Which JDBC driver
version are you using?
Carb Simien, MCSE MCDBA MCAD
Microsoft Developer Support - Web Data
Please reply only to the newsgroups.
This posting is provided "AS IS" with no warranties, and confers no rights.
Are you secure? For information about the Strategic Technology Protection
Program and to order your FREE Security Tool Kit, please visit
http://www.microsoft.com/security.
| Thread-Topic: Exception found in thread "main"
| thread-index: AcQfH4L5LXqtk8vFSkueop9pm+wJ5A==
| X-Tomcat-NG: microsoft.public.sqlserver.jdbcdriver
| From: =?Utf-8?B?ZWxhaW5l?= <anonymous@.discussions.microsoft.com>
| Subject: Exception found in thread "main"
| Date: Sat, 10 Apr 2004 10:16:07 -0700
| Lines: 9
| Message-ID: <8067C18E-B98F-4192-BEAE-3F70608AB539@.microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.sqlserver.jdbcdriver
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.sqlserver.jdbcdriver:5882
| NNTP-Posting-Host: tk2msftcmty1.phx.gbl 10.40.1.180
| X-Tomcat-NG: microsoft.public.sqlserver.jdbcdriver
|
| Hi all,
I have a program running problem. When I run the java program, it shows
Exception in thread "main" java.lang.NoClassDefFoundError:
jdbcTest
I'm not sure if it is related to the JDBC driver setting program coding
error. Thanks.
Elaine
|