Showing posts with label via. Show all posts
Showing posts with label via. Show all posts

Thursday, March 29, 2012

data synchronisation

Hi,

I'm working with two databases on to physicaly separated servers: #1
is on a local machine en I can only connect to #2 via an ADSL
connection.
I need to syncrhonise the data. This works fine via the wizard from
the Enterprise Manager. But I want to get this done via a script form
the Query Analyzer that I can run whenever I want to. Something like:

insert into srv1.database.dbo.table1
select * from srv2.database.dbo.table1

When I do this I get an error about "linked servers". That surprises
me, because I have no linked servers configured and yet the wizard
works fine?

Can anyone tell me how to accomplish this?

tav
Jan Willemsjhmwillems@.hotmail.com (Jan) wrote in message news:<240176c1.0404060206.4bfaaca3@.posting.google.com>...
> Hi,
> I'm working with two databases on to physicaly separated servers: #1
> is on a local machine en I can only connect to #2 via an ADSL
> connection.
> I need to syncrhonise the data. This works fine via the wizard from
> the Enterprise Manager. But I want to get this done via a script form
> the Query Analyzer that I can run whenever I want to. Something like:
> insert into srv1.database.dbo.table1
> select * from srv2.database.dbo.table1
> When I do this I get an error about "linked servers". That surprises
> me, because I have no linked servers configured and yet the wizard
> works fine?
> Can anyone tell me how to accomplish this?
> tav
> Jan Willems

The Import/Export Data wizard uses a separate connection to each
server, so linked servers are not involved. The INSERT statement above
does require the linked servers to exist, however.

So you could just create the linked servers you need, or if that's not
possible for some reason, then you can save a DTS package from the
wizard, and execute it in whatever way is most convenient:

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

Simon

Sunday, March 25, 2012

Data source connection to SAS via SS05

Hi all, does anyone have a sample (or knows of one on the web, maybe screenshots) of how to connect via SQL Server 2005 to a SAS box? The SAS machine is Unix, I am able to connect via Enterprise Guide from my local machine - which is also runing SS05 Developer. I'm investingating the possibility of building a cube of off a SAS dataset.

Thanks in advance.

Mark

Two things to keep in mind when building a cube. First, you have to have a driver with which SSAS can connect to the data source and through which SSAS can build objects within the DSV. Next, you need to have a cartridge with which SSAS can construct query statements to pull data from the data source.

You might be able to present SAS objects through SQL Server views using the OPENROWSET function. (This may be where you are already headed.) So, is there a way to connect SQL Server Database Engine to SAS using OPENROWSET?

One other thing, SAS has their own OLAP solution. Is that an option for you?

B.

|||

Ho Bryan,

I went in a different direction (FTP text files for awhile), but am re-visiting this now. We don't have the SAS OLAP Server in house, so unfortunately that isn't an option. However, is there a SAS/MSFT web-site where cartriges can be obtained from? I'm able to connect to the SAS box and can see the SAS datasets, but, I can't render them. Its literally the last step that's blowing up, and I believe it may be cartrige driven.

Thanks,

Mark

|||

Sorry to say I'm not aware of any cartridges other than those provided by default. Worst case, can you perform an OPENROWSET query through SQL Server? If so, you might be able to construct a query in SQL Server using OPENROWSET against SAS which would faciliate processing. Still, no guarantees that would work.

B.

Data source connection to SAS via SS05

Hi all, does anyone have a sample (or knows of one on the web, maybe screenshots) of how to connect via SQL Server 2005 to a SAS box? The SAS machine is Unix, I am able to connect via Enterprise Guide from my local machine - which is also runing SS05 Developer. I'm investingating the possibility of building a cube of off a SAS dataset.

Thanks in advance.

Mark

Two things to keep in mind when building a cube. First, you have to have a driver with which SSAS can connect to the data source and through which SSAS can build objects within the DSV. Next, you need to have a cartridge with which SSAS can construct query statements to pull data from the data source.

You might be able to present SAS objects through SQL Server views using the OPENROWSET function. (This may be where you are already headed.) So, is there a way to connect SQL Server Database Engine to SAS using OPENROWSET?

One other thing, SAS has their own OLAP solution. Is that an option for you?

B.

|||

Ho Bryan,

I went in a different direction (FTP text files for awhile), but am re-visiting this now. We don't have the SAS OLAP Server in house, so unfortunately that isn't an option. However, is there a SAS/MSFT web-site where cartriges can be obtained from? I'm able to connect to the SAS box and can see the SAS datasets, but, I can't render them. Its literally the last step that's blowing up, and I believe it may be cartrige driven.

Thanks,

Mark

|||

Sorry to say I'm not aware of any cartridges other than those provided by default. Worst case, can you perform an OPENROWSET query through SQL Server? If so, you might be able to construct a query in SQL Server using OPENROWSET against SAS which would faciliate processing. Still, no guarantees that would work.

B.

Tuesday, March 20, 2012

Data Pump Failing

I did not see a forum for the SQL Server 2000 DTS.

I have a flat file feeding a table via a data pump. The table is only used by this process. It will run for about 30minutes and then fail. The message in the history does not give any detail on why it is failing. Below is the message I get and if I rerun the job it works fine. Anyone help me please.

Date 07/23/2007 6:00:02 AM
Log Job History (Daily: Load EOL from MVS1 (First Run))

Step ID 1
Server PIT-CS-M608
Job Name Daily: Load EOL from MVS1 (First Run)
Step Name Daily: Load tblCaseMasterSched
Duration 00:28:05
Sql Severity 0
Sql Message ID 0
Operator Emailed
Operator Net sent
Operator Paged
Retries Attempted 0

Message
Executed as user: PIT-CS-M608\SYSTEM. ...rt: DTSStep_DTSActiveScriptTask_1 DTSRun OnFinish: DTSStep_DTSActiveScriptTask_1 DTSRun OnStart: DTSStep_DTSExecuteSQLTask_1 DTSRun OnFinish: DTSStep_DTSExecuteSQLTask_1 DTSRun OnStart: DTSStep_DTSDataPumpTask_1 DTSRun OnProgress: DTSStep_DTSDataPumpTask_1; 1000 Rows have been transformed or copied.; PercentComplete = 0; ProgressCount = 1000 DTSRun OnProgress: DTSStep_DTSDataPumpTask_1; 2000 Rows have been transformed or copied.; PercentComplete = 0; ProgressCount = 2000 DTSRun OnProgress: DTSStep_DTSDataPumpTask_1; 3000 Rows have been transformed or copied.; PercentComplete = 0; ProgressCount = 3000 DTSRun OnProgress: DTSStep_DTSDataPumpTask_1; 4000 Rows have been transformed or copied.; PercentComplete = 0; ProgressCount = 4000 DTSRun OnProgress: DTSStep_DTSDataPumpTask_1; 5000 Rows have been transformed or copied.; PercentComplete = 0; ProgressCount = 5000 DTSRun OnProgress: DTSStep_DTSDataP... Process Exit Code 1. The step failed.

DTS questions can be asked in the DTS newsgroup:

http://groups.google.com/group/microsoft.public.sqlserver.dts?lnk=srg

Monday, March 19, 2012

Data Processing Extensions - Parameters ?

Hi,
I am submitting a report to be run via sending the reportname and some
parameters via the RS WebService. Behind this I have a DPE. This all works
fine when there are no parameters. when I do pass params though, I have a
problem.
Trouble is that I cannot seem to lay my hands on the passed parameter values
(I presume a collection ?) when in my implementation class of the IDbCommand,
IDbCommandAnalysis interfaces
How can I obtain these params in the DPE ?
any help would be appreciated, thanks,The IDbCommandAnalysis interface serves the orthogonal purpose. It lets the
Report Designer know about the parameters that your query expects. During
runtime the Report Server calls IDataParameterCollection.Add to pass the
parameter values. This is where you will load them, e.g.:
public int Add(IDataParameter value)
{
Trace.WriteLine("DataSet Extension: Add(IDataParameter value");
if (((DsDataParameter)value).ParameterName != null)
{
return base.Add(value);
}
else
throw new ArgumentException("parameter must be named");
}
public DsDataParameter GetByName(string parameterName)
{
DsDataParameter parameter = null;
IEnumerator enumerator = this.GetEnumerator();
while (enumerator.MoveNext())
{
DsDataParameter tempParameter = (DsDataParameter) enumerator.Current;
if (tempParameter.ParameterName == parameterName)
{
parameter = tempParameter;
break;
}
}
return parameter;
}
Then, in your DataReader implementation you can get the parameters:
DsDataParameter parameter = m_parameters.GetByName(Util.DATA_SOURCE)
as DsDataParameter;
You can get a complete working DPE sample here:
http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=B8468707-56EF-4864-AC51-D83FC3273FE5
--
Hope this helps.
----
Teo Lachev, MVP [SQL Server], MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
----
"softgui" <softgui@.discussions.microsoft.com> wrote in message
news:FE3B6E92-4E95-42E7-8E1B-2868F9670CB0@.microsoft.com...
> Hi,
> I am submitting a report to be run via sending the reportname and some
> parameters via the RS WebService. Behind this I have a DPE. This all
works
> fine when there are no parameters. when I do pass params though, I have a
> problem.
> Trouble is that I cannot seem to lay my hands on the passed parameter
values
> (I presume a collection ?) when in my implementation class of the
IDbCommand,
> IDbCommandAnalysis interfaces
> How can I obtain these params in the DPE ?
> any help would be appreciated, thanks,
>|||Many thanks Teo.
- simon
"Teo Lachev [MVP]" <teo.lachev@.nospam.prologika.com> wrote in message
news:%23OFyCBoqEHA.3712@.TK2MSFTNGP15.phx.gbl...
> The IDbCommandAnalysis interface serves the orthogonal purpose. It lets
> the
> Report Designer know about the parameters that your query expects. During
> runtime the Report Server calls IDataParameterCollection.Add to pass the
> parameter values. This is where you will load them, e.g.:
> public int Add(IDataParameter value)
> {
> Trace.WriteLine("DataSet Extension: Add(IDataParameter value");
> if (((DsDataParameter)value).ParameterName != null)
> {
> return base.Add(value);
> }
> else
> throw new ArgumentException("parameter must be named");
> }
> public DsDataParameter GetByName(string parameterName)
> {
> DsDataParameter parameter = null;
> IEnumerator enumerator = this.GetEnumerator();
> while (enumerator.MoveNext())
> {
> DsDataParameter tempParameter = (DsDataParameter) enumerator.Current;
> if (tempParameter.ParameterName == parameterName)
> {
> parameter = tempParameter;
> break;
> }
> }
> return parameter;
> }
> Then, in your DataReader implementation you can get the parameters:
> DsDataParameter parameter = m_parameters.GetByName(Util.DATA_SOURCE)
> as DsDataParameter;
> You can get a complete working DPE sample here:
> http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=B8468707-56EF-4864-AC51-D83FC3273FE5
> --
> Hope this helps.
> ----
> Teo Lachev, MVP [SQL Server], MCSD, MCT
> Author: "Microsoft Reporting Services in Action"
> Publisher website: http://www.manning.com/lachev
> Buy it from Amazon.com: http://shrinkster.com/eq
> Home page and blog: http://www.prologika.com/
> ----
> "softgui" <softgui@.discussions.microsoft.com> wrote in message
> news:FE3B6E92-4E95-42E7-8E1B-2868F9670CB0@.microsoft.com...
>> Hi,
>> I am submitting a report to be run via sending the reportname and some
>> parameters via the RS WebService. Behind this I have a DPE. This all
> works
>> fine when there are no parameters. when I do pass params though, I have a
>> problem.
>> Trouble is that I cannot seem to lay my hands on the passed parameter
> values
>> (I presume a collection ?) when in my implementation class of the
> IDbCommand,
>> IDbCommandAnalysis interfaces
>> How can I obtain these params in the DPE ?
>> any help would be appreciated, thanks,
>>
>|||Hi Mr Softgui,
You can extend the DataParameter Extension to create your own types and then
cast them back into the (object) value property.
What do you think Teo?
Peter.
"softgui" wrote:
> Hi,
> I am submitting a report to be run via sending the reportname and some
> parameters via the RS WebService. Behind this I have a DPE. This all works
> fine when there are no parameters. when I do pass params though, I have a
> problem.
> Trouble is that I cannot seem to lay my hands on the passed parameter values
> (I presume a collection ?) when in my implementation class of the IDbCommand,
> IDbCommandAnalysis interfaces
> How can I obtain these params in the DPE ?
> any help would be appreciated, thanks,
>

Friday, February 24, 2012

Data just disappears

I have a client running SQL server 2000 on Windows 2003. Yesterday
data just started disappearing. It is being accessed by asp via his
website and when the data is being inserted it seems to all of a
sudden drop all data in the table. Earlier in the day the table
disappeared all together. Anyone ever see this?

LSThis can happen if the website is being "hacked". This is done via SQL
Injection, where by DDL language is used in the fields that are on the
screen. With the clever use of quotes and semi-colons, a hacker can issue a
TRUNCATE TABLE or DROP table.

Oscar...

"Len Svitenko" <its_goodtobethe_king@.yahoo.com> wrote in message
news:6092a26a.0401181707.3134bde1@.posting.google.c om...
> I have a client running SQL server 2000 on Windows 2003. Yesterday
> data just started disappearing. It is being accessed by asp via his
> website and when the data is being inserted it seems to all of a
> sudden drop all data in the table. Earlier in the day the table
> disappeared all together. Anyone ever see this?
> LS|||its_goodtobethe_king@.yahoo.com (Len Svitenko) wrote in message news:<6092a26a.0401181707.3134bde1@.posting.google.com>...
> I have a client running SQL server 2000 on Windows 2003. Yesterday
> data just started disappearing. It is being accessed by asp via his
> website and when the data is being inserted it seems to all of a
> sudden drop all data in the table. Earlier in the day the table
> disappeared all together. Anyone ever see this?
> LS

You can use Profiler to trace all SQL to the server, and see where the
DELETE or TRUNCATE statements are coming from. It may be a genuine
error in application code, or it may be malicious exploitation of a
security hole.

Simon|||Have a look at Erland's site which has more info on this :

http://www.algonet.se/~sommar/dynam...html#Security2

"Oscar Santiesteban Jr." <oscarsantiesteban@.worldnet.att.net> wrote in message news:<KjIOb.31844$VS4.992004@.bgtnsc04-news.ops.worldnet.att.net>...
> This can happen if the website is being "hacked". This is done via SQL
> Injection, where by DDL language is used in the fields that are on the
> screen. With the clever use of quotes and semi-colons, a hacker can issue a
> TRUNCATE TABLE or DROP table.
> Oscar...
> "Len Svitenko" <its_goodtobethe_king@.yahoo.com> wrote in message
> news:6092a26a.0401181707.3134bde1@.posting.google.c om...
> > I have a client running SQL server 2000 on Windows 2003. Yesterday
> > data just started disappearing. It is being accessed by asp via his
> > website and when the data is being inserted it seems to all of a
> > sudden drop all data in the table. Earlier in the day the table
> > disappeared all together. Anyone ever see this?
> > LS

Sunday, February 19, 2012

Data Integrity

Hi,

I have a table of products and a table of price bands. e.g. ( Qty: 1-5 = $2, 6+ = $1 ) The price bands are related to products via a foreign key.

To get a product's data, a stored procedure does something like this....

SELECT * FROM products WHERE productID = @.prodID
If isPriceBands
SELECT * FROM priceBands WHERE productID = @.prodID

The question is, what if somebody updates the price bands of a product during a retrieval of the product's data?

My concern is that the select query could have retrieved 2 out of 3 price bands at the point of the update. Lets say the update has deleted all the original price bands and has replaced them with 3 new ones. Then, wouldn' the select query return 5 price bands?

Obviously this would be incorrect.

What is there to stop a modification of an entity spread over several different tables and rows intruding on a select query?

Is the only way to rule this out to lock the entire database for each read?

Cheers,

I.One possible solution is to use serializable transactions. This makes a shared multiuser resource like a db act as if one person is accessing it at a time. Basically you are putting exclusive locks on the records so that no one can change them.|||Thanks for your reply.

I don't see how a serializable transaction would work unless every query was of that kind. This has got to be out of the question for a simple retrieval of a product.

If only the procedures which updated or deleted parts of a product were to be serializable, I still don't think that would stop them from interupting a retrieval of a product's data thus making the final result set potentially inconsistent with itself.

What I think would be good is if you could put a lock on a stored procedure, x, such that a given stored procedure, y, couldn't run until all current x's had completed.
WT.

Data Insert via SQL Express using VB Issue

I've been doing a lot of research lately to determine the most secure way to issue an insert statement to insert my data into my SQL database. I'm coding this following using Visual Basic:

Protected Sub submitButton_Click(ByVal senderAs Object,ByVal eAs System.EventArgs)Dim strConnAs String ="server=.\SQLEXPRESS;database=C:\SJ-site\SJ\App_Data\SJDb.mdf; User Id=user; password=password"Dim MyQueryAs String ="Insert into sjTable (PostID, Category, TitleofPost, Description, Price, Loc, ContactInfo, DatePosted, Disclaimer) Values (@.Category, @.TitleofPost, @.Description, @.Price, @.Loc, @.ContactInfo, @.DatePosted)"Dim MyConnAs New Data.SqlClient.SqlConnection(strConn)Dim cmdAs New Data.SqlClient.SqlCommand(MyQuery, MyConn)Dim curDateAs String On Error Resume Next MyConn.Open()If Err.Number <> 0Then MsgBox("There was an error connecting to the database.", MsgBoxStyle.OkOnly) Err.Number = 0End If curDate = Now()With cmd.Parameters .Add(New System.Data.SqlClient.SqlParameter("@.Category", categoryDropDown.Text)) .Add(New System.Data.SqlClient.SqlParameter("@.TiteofPost", titleTextbox.Text)) .Add(New System.Data.SqlClient.SqlParameter("@.Description", descriptionTextbox.Text)) .Add(New System.Data.SqlClient.SqlParameter("@.Price", priceTextbox.Text)) .Add(New System.Data.SqlClient.SqlParameter("@.Loc", locationTextbox.Text)) .Add(New System.Data.SqlClient.SqlParameter("@.ContactInfo", contactTextbox.Text)) .Add(New System.Data.SqlClient.SqlParameter("@.DatePosted", curDate))End With If Err.Number <> 0Then MsgBox("There was an error inserting the data into the database.", MsgBoxStyle.OkOnly) Err.Number = 0End If MyConn.Close()If Err.Number <> 0Then MsgBox("There was an erro closing the database connection.", MsgBoxStyle.OkOnly) Err.Number = 0End If Server.Transfer("submitted.aspx")End Sub
The code gives no errors, it directs me straight to thesubmitted.aspx page but when I query the database it is not insertingany data into my database. .

My Error log shows the following:
2006-06-27 12:14:16.68 spid51 Starting up database 'C:\SJ-SITE\SJ\APP_DATA\SJDB.MDF'.
2006-06-27 12:14:26.93 Logon Error: 17828, Severity: 20, State: 3.
2006-06-27 12:14:26.93 Logon The prelogin packet used to open the connection is structurally invalid; the connection has been closed. Please contact the vendor of the client library. [CLIENT: <local machine>]

I am able to log into the database using my account via SQL Server Management Studio Express. I've been all over the forums and google looking for a solution but everything I've been trying to mock up from other people's code hasn't helped. Thanks in advance for your assistance

Hi, do you have 17190 error in your SQL ERRORLOG when SQL startup?

2006-03-24 10:37:09.80 Server Error: 17190, Severity: 16, State: 1.
2006-03-24 10:37:09.80 Server FallBack certificate initialization failed with error code: 1.
2006-03-24 10:37:09.81 Server Warning:Encryption is not available, could not find a valid certificate to load.

And is your SQL service startup account a local account whose password has been changed recently?

If so, try to delete the file in folder

C:\Documents and Settings\<SQL Server startup
account>\Application Data\Microsoft\Crypto\RSA\S-1-5-21-963106725-2405722570-177647575-1023


The last part (S-1-5-21-963106725-2405722570-177647575-1023) may be different for
every account. Then restartSQL Server services to take effect.

|||I went ahead and upgraded to SQL Express 2005 SP1 w/ Advanced Services. I re-built my user accounts and what not. Now, I am still getting no error messages but also when I open the log file the last thing it says is:
2006-06-28 09:06:57.93 spid51 Starting up database 'C:\SJ-SITE\SJ\APP_DATA\SUGARJACKS.MDF'.

The data from the forms still isn't inserting into the database. The code hasn't changed and like I said the only thing I did was upgrade the SQL Express and re-build the user account.
|||On a side note I just wanted to say that yes I did change the database name and yes I did update the connection string accordingly in the code.