Showing posts with label application. Show all posts
Showing posts with label application. Show all posts

Thursday, March 29, 2012

Directly printing Report from RS without previewing

Hi All,
Is there a way to send a report from Reporting service directly to the printer without previewing in VS 2005 web application? I tried out an example which exports the report into a pdf and then sends it over to the printer but apparently it did not print. It stopped working after saving the reoprt on the client machine. The article is located at

http://www.codeproject.com/vb/net/RSPrintLandscape.asp

Thanks for the help in advance.

Sanat

what version ? 2000 or 05 ?

printer on the server or on the client ?
if you look at the samples there is a printer delivery sample.

in rs 2000 I hacked that up some to output to a printer w/o the subscription stuff.
basicly when Render() is called it makes a windows EMF file that can then be sent to a printer as a page of output.

do that in a loop and you get printed copy.

just set the page up at the start with the right settings...

|||

and, you know how send the emf correctly to a printer?...

mm.. or how to construct a Printer Settigs or PrinterDocument?...

what should i do?

this is a part of code, and


PrinterSettings printerSettings = new PrinterSettings();
printerSettings.MaximumPage = m_numberOfPages;
printerSettings.MinimumPage = 1;
printerSettings.PrintRange = PrintRange.SomePages;
printerSettings.FromPage = 1;
printerSettings.ToPage = m_numberOfPages;
printerSettings.PrinterName = "Hp Dj 550"; //here goes printer's name.
PrintDocument pd = new PrintDocument();

pd.PrinterSettings = printerSettings;

pd.PrintPage += new PrintPageEventHandler(this.pd_PrintPage);

pd.Print();

Inside of pd_PrintPage method, i don't have anything about the printer, just code to conver a byte[] into a graphics file... what ever, nothing goes to the printer... thanks in advance for your attention.

|||Have you taken a look at http://www.gotreportviewer.com/? There is a sample called "Print a report from a console app" that uses the ReportViewer control to do this.|||

Thanks for the link Brian - this is almost exactly what I need to do (automatically print local reports).

My ADO.NET skills are not quite up to par - how would I modify the Run method of this example to execute an existing server based report that I have? I have managed to convert the report from an RDL to an RDLC, and added it to my Console Project with VB.NET. In addition, I created a new Data Set within this project that returns the data from the original stored procedure that was used for the RDL file. I now need to associate this new Data Set with the RDLC report, as well as pass some parameters to it, but I am not sure how to proceed.

Any suggestions/direction would be greatly appreciated.

Thanks!

Directly printing Report from RS without previewing

Hi All,
Is there a way to send a report from Reporting service directly to the printer without previewing in VS 2005 web application? I tried out an example which exports the report into a pdf and then sends it over to the printer but apparently it did not print. It stopped working after saving the reoprt on the client machine. The article is located at

http://www.codeproject.com/vb/net/RSPrintLandscape.asp

Thanks for the help in advance.

Sanat

what version ? 2000 or 05 ?

printer on the server or on the client ?
if you look at the samples there is a printer delivery sample.

in rs 2000 I hacked that up some to output to a printer w/o the subscription stuff.
basicly when Render() is called it makes a windows EMF file that can then be sent to a printer as a page of output.

do that in a loop and you get printed copy.

just set the page up at the start with the right settings...

|||

and, you know how send the emf correctly to a printer?...

mm.. or how to construct a Printer Settigs or PrinterDocument?...

what should i do?

this is a part of code, and


PrinterSettings printerSettings = new PrinterSettings();
printerSettings.MaximumPage = m_numberOfPages;
printerSettings.MinimumPage = 1;
printerSettings.PrintRange = PrintRange.SomePages;
printerSettings.FromPage = 1;
printerSettings.ToPage = m_numberOfPages;
printerSettings.PrinterName = "Hp Dj 550"; //here goes printer's name.
PrintDocument pd = new PrintDocument();

pd.PrinterSettings = printerSettings;

pd.PrintPage += new PrintPageEventHandler(this.pd_PrintPage);

pd.Print();

Inside of pd_PrintPage method, i don't have anything about the printer, just code to conver a byte[] into a graphics file... what ever, nothing goes to the printer... thanks in advance for your attention.

|||Have you taken a look at http://www.gotreportviewer.com/? There is a sample called "Print a report from a console app" that uses the ReportViewer control to do this.|||

Thanks for the link Brian - this is almost exactly what I need to do (automatically print local reports).

My ADO.NET skills are not quite up to par - how would I modify the Run method of this example to execute an existing server based report that I have? I have managed to convert the report from an RDL to an RDLC, and added it to my Console Project with VB.NET. In addition, I created a new Data Set within this project that returns the data from the original stored procedure that was used for the RDL file. I now need to associate this new Data Set with the RDLC report, as well as pass some parameters to it, but I am not sure how to proceed.

Any suggestions/direction would be greatly appreciated.

Thanks!

Directly printing Report from RS without previewing

Hi All,
Is there a way to send a report from Reporting service directly to the printer without previewing in VS 2005 web application? I tried out an example which exports the report into a pdf and then sends it over to the printer but apparently it did not print. It stopped working after saving the reoprt on the client machine. The article is located at

http://www.codeproject.com/vb/net/RSPrintLandscape.asp

Thanks for the help in advance.

Sanat

what version ? 2000 or 05 ?

printer on the server or on the client ?
if you look at the samples there is a printer delivery sample.

in rs 2000 I hacked that up some to output to a printer w/o the subscription stuff.
basicly when Render() is called it makes a windows EMF file that can then be sent to a printer as a page of output.

do that in a loop and you get printed copy.

just set the page up at the start with the right settings...

|||

and, you know how send the emf correctly to a printer?...

mm.. or how to construct a Printer Settigs or PrinterDocument?...

what should i do?

this is a part of code, and


PrinterSettings printerSettings = new PrinterSettings();
printerSettings.MaximumPage = m_numberOfPages;
printerSettings.MinimumPage = 1;
printerSettings.PrintRange = PrintRange.SomePages;
printerSettings.FromPage = 1;
printerSettings.ToPage = m_numberOfPages;
printerSettings.PrinterName = "Hp Dj 550"; //here goes printer's name.
PrintDocument pd = new PrintDocument();

pd.PrinterSettings = printerSettings;

pd.PrintPage += new PrintPageEventHandler(this.pd_PrintPage);

pd.Print();

Inside of pd_PrintPage method, i don't have anything about the printer, just code to conver a byte[] into a graphics file... what ever, nothing goes to the printer... thanks in advance for your attention.

|||Have you taken a look at http://www.gotreportviewer.com/? There is a sample called "Print a report from a console app" that uses the ReportViewer control to do this.|||

Thanks for the link Brian - this is almost exactly what I need to do (automatically print local reports).

My ADO.NET skills are not quite up to par - how would I modify the Run method of this example to execute an existing server based report that I have? I have managed to convert the report from an RDL to an RDLC, and added it to my Console Project with VB.NET. In addition, I created a new Data Set within this project that returns the data from the original stored procedure that was used for the RDL file. I now need to associate this new Data Set with the RDLC report, as well as pass some parameters to it, but I am not sure how to proceed.

Any suggestions/direction would be greatly appreciated.

Thanks!

sql

Directly printing Report from RS without previewing

Hi All,
Is there a way to send a report from Reporting service directly to the printer without previewing in VS 2005 web application? I tried out an example which exports the report into a pdf and then sends it over to the printer but apparently it did not print. It stopped working after saving the reoprt on the client machine. The article is located at

http://www.codeproject.com/vb/net/RSPrintLandscape.asp

Thanks for the help in advance.

Sanat

what version ? 2000 or 05 ?

printer on the server or on the client ?
if you look at the samples there is a printer delivery sample.

in rs 2000 I hacked that up some to output to a printer w/o the subscription stuff.
basicly when Render() is called it makes a windows EMF file that can then be sent to a printer as a page of output.

do that in a loop and you get printed copy.

just set the page up at the start with the right settings...

|||

and, you know how send the emf correctly to a printer?...

mm.. or how to construct a Printer Settigs or PrinterDocument?...

what should i do?

this is a part of code, and


PrinterSettings printerSettings = new PrinterSettings();
printerSettings.MaximumPage = m_numberOfPages;
printerSettings.MinimumPage = 1;
printerSettings.PrintRange = PrintRange.SomePages;
printerSettings.FromPage = 1;
printerSettings.ToPage = m_numberOfPages;
printerSettings.PrinterName = "Hp Dj 550"; //here goes printer's name.
PrintDocument pd = new PrintDocument();

pd.PrinterSettings = printerSettings;

pd.PrintPage += new PrintPageEventHandler(this.pd_PrintPage);

pd.Print();

Inside of pd_PrintPage method, i don't have anything about the printer, just code to conver a byte[] into a graphics file... what ever, nothing goes to the printer... thanks in advance for your attention.

|||Have you taken a look at http://www.gotreportviewer.com/? There is a sample called "Print a report from a console app" that uses the ReportViewer control to do this.|||

Thanks for the link Brian - this is almost exactly what I need to do (automatically print local reports).

My ADO.NET skills are not quite up to par - how would I modify the Run method of this example to execute an existing server based report that I have? I have managed to convert the report from an RDL to an RDLC, and added it to my Console Project with VB.NET. In addition, I created a new Data Set within this project that returns the data from the original stored procedure that was used for the RDL file. I now need to associate this new Data Set with the RDLC report, as well as pass some parameters to it, but I am not sure how to proceed.

Any suggestions/direction would be greatly appreciated.

Thanks!

Directly print to Printer

Hi,
I have a VB Application with Crystal Report 8. If I click the print button in VB, I dont want to show the Crystal Report. I want to print the contents of the report directly to the Printer without showing the report. Is there a way to do this?
Thanks in advance
MadhivananFrom memory, so.........please forgive any errors from failed memory......:-))

assumes using CR active x control:

Dim objPrintApp As CRAXDRT.Application
Dim objReport As CRAXDRT.Report

Set objPrintApp = New CRAXDRT.Application
Set objReport = objPrintApp.OpenReport(strReportSourcePath & strSourceFile)
objPrintApp.LogOnServerEx "pdsodbc.dll", "database", "database", "user", "pwd"

' set PromptUser to False, NumberOfCopies to value >=1
' all parameters in brackets are optional.
objReport.Printout [PromptUser], [NumberOfCopies], [Collated], [StartPageNumber], [StopPageNumber]

dave|||Thanks springsoft. I think this is for CR9 but what is the code for CR8?.

Madhivanan

Direct Printing

Hallo,
we have a Windows Application in .Net.
Now we want to use Reporting Services. That is no problem.
But how we can print direct on a client pc?Hi sqlhaas,
You can do this by installing a new printer extension for RS. Take a look
at this article (under Yesterday's QOD):
http://www.sqlservercentral.com/newsletter/452004newsletter.htm
--
Regards,
Jake Marx
MS MVP - Excel
www.longhead.com
[please keep replies in the newsgroup - email address unmonitored]
sqlhaas wrote:
> Hallo,
> we have a Windows Application in .Net.
> Now we want to use Reporting Services. That is no problem.
> But how we can print direct on a client pc?|||Check Bryan's log http://blogs.msdn.com/bryanke/articles/71491.aspx.
--
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/
---
"Jake Marx" <msnews@.longhead.com> wrote in message
news:u%23nFdEQvEHA.1988@.TK2MSFTNGP12.phx.gbl...
> Hi sqlhaas,
> You can do this by installing a new printer extension for RS. Take a look
> at this article (under Yesterday's QOD):
> http://www.sqlservercentral.com/newsletter/452004newsletter.htm
> --
> Regards,
> Jake Marx
> MS MVP - Excel
> www.longhead.com
> [please keep replies in the newsgroup - email address unmonitored]
>
> sqlhaas wrote:
> > Hallo,
> > we have a Windows Application in .Net.
> > Now we want to use Reporting Services. That is no problem.
> > But how we can print direct on a client pc?
>

Direct print in RS 2000 no longer works in RS 2005 --what's the secret?

Hi all,
I have a Windows Forms application in VS 2005 that displays reports inside a
System.Windows.Forms.WebBrowser. The user can print using the print icon
within the browser window, but I also have a big Print button on the form
that prints directly. Now, with RS 2000, my print button worked fine, I
directed the ActiveX control to directly print like this:
rsBrowser.Navigate(ReportServicesPath & SpecifiedReportURL &
"&rs%3aCommand=Get&rc%3aGetImage=8.00.1038.00RSClientPrint.html")
But, I've now upgraded to SQL 2005 and RS 2005, and this code doesn't work,
although printing via the print icon still works fine. What is the
equivalent of the above code for RS 2005'
The above code puts an error into the browser window:
>>
Reporting Services Error
----
a.. An internal error occurred on the report server. See the error log for
more details. (rsInternalError) Get Online Help
a.. Specified argument was out of the range of valid values. Parameter
name: offset
<<
I looked at the error log, but it is impenetrable to me.
Thanks,
C17Hello C17,
I understand that you want to use the URL access to print the report.
In Reporting Services 2005, the RC parameter prefix is changed and you
could not use the GetImage now.
I would like to suggest you use the ReportViewer control.
Here is the article for your reference:
http://msdn2.microsoft.com/en-us/library/microsoft.reporting.winforms.report
viewer(VS.80).aspx
Hope this helps.
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================This posting is provided "AS IS" with no warranties, and confers no rights.|||Thank you. The ReportViewer control looks like a better way to display
reports anyway. I will switch over to it.
--C17|||Hello C17,
If you have any question, pleae feel free to let me know.
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================This posting is provided "AS IS" with no warranties, and confers no rights.

Direct link between a camera and the database.

Where to look for a direct link between
a camera, an application (to be build) and storage
directly in a database.
(Use Identification sized pictures of customers).
Thanks for any pointers.
Ben Brugman
Hi
You may want to look at http://www.aspfaq.com/show.asp?id=2149. The method
of transferring the image to the computer may be dependent on the make of the
camera.
Binary files can be loaded in to the database (if you really want to!) using
the bii example program. As this is a sample you also have the code.
This may also be useful
http://support.microsoft.com/default...b;en-us;317034
http://support.microsoft.com/default...b;en-us;316887
John
"ben brugman" wrote:

> Where to look for a direct link between
> a camera, an application (to be build) and storage
> directly in a database.
> (Use Identification sized pictures of customers).
> Thanks for any pointers.
> Ben Brugman
>
>
sql

Direct link between a camera and the database.

Where to look for a direct link between
a camera, an application (to be build) and storage
directly in a database.
(Use Identification sized pictures of customers).
Thanks for any pointers.
Ben BrugmanHi
You may want to look at http://www.aspfaq.com/show.asp?id=2149. The method
of transferring the image to the computer may be dependent on the make of th
e
camera.
Binary files can be loaded in to the database (if you really want to!) using
the bii example program. As this is a sample you also have the code.
This may also be useful
http://support.microsoft.com/defaul...kb;en-us;317034
http://support.microsoft.com/defaul...kb;en-us;316887
John
"ben brugman" wrote:

> Where to look for a direct link between
> a camera, an application (to be build) and storage
> directly in a database.
> (Use Identification sized pictures of customers).
> Thanks for any pointers.
> Ben Brugman
>
>

Direct link between a camera and the database.

Where to look for a direct link between
a camera, an application (to be build) and storage
directly in a database.
(Use Identification sized pictures of customers).
Thanks for any pointers.
Ben BrugmanHi
You may want to look at http://www.aspfaq.com/show.asp?id=2149. The method
of transferring the image to the computer may be dependent on the make of the
camera.
Binary files can be loaded in to the database (if you really want to!) using
the bii example program. As this is a sample you also have the code.
This may also be useful
http://support.microsoft.com/default.aspx?scid=kb;en-us;317034
http://support.microsoft.com/default.aspx?scid=kb;en-us;316887
John
"ben brugman" wrote:
> Where to look for a direct link between
> a camera, an application (to be build) and storage
> directly in a database.
> (Use Identification sized pictures of customers).
> Thanks for any pointers.
> Ben Brugman
>
>

Direct access to SQL Server 2005 from Windows Mobile

Hi everyone,

I've created a SQL Server database in Visual Studio 2005 and I am also planning to create a Windows Mobile application to access, edit and update this data.
So I heard that it is possible to directly access to SQL Server from the device using SQLClient rather than creating an SQL ServerCE.

I tried to use that method but I get a connection error. Here is the bit of code that was generated.

this._connection = new System.Data.SqlClient.SqlConnection();
this._connection.ConnectionString = "Data
Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirecto ry|\\MainRestaurantManagementdb.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True;";
}


Can anyone help me on this please as I am stuck and can't figure out how to solve it?

Quote:

Originally Posted by Hezal

Hi everyone,

I've created a SQL Server database in Visual Studio 2005 and I am also planning to create a Windows Mobile application to access, edit and update this data.
So I heard that it is possible to directly access to SQL Server from the device using SQLClient rather than creating an SQL ServerCE.

I tried to use that method but I get a connection error. Here is the bit of code that was generated.

this._connection = new System.Data.SqlClient.SqlConnection();
this._connection.ConnectionString = "Data
Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirecto ry|\\MainRestaurantManagementdb.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True;";
}


Can anyone help me on this please as I am stuck and can't figure out how to solve it?


Moved to SQL forum. This is more of an applications issue then a mobile specific issue.

Tuesday, March 27, 2012

Dimension Writeback

I am interested in using the Dimension Writeback feature to solve a specific problem in a forecasting application.

I only need to Update attribute values on existing dimension members, I don't need to insert or delete members.

Looking at various resources on the web, I think I understand the following ...
- I must be using the Enterprise version of SQL Server / SSAS
- I need to write enable the relevant dimension from within my development environment
- My users need to be using an OLAP Client which supports dimension writeback.

Some questions ...
- Is my understanding above correct ?
- Do the following OLAP clients support dimension writeback
Excel 2007 Pivot Tables
Excel Services running within Sharepoint 2007
If not, can someone point me towards a client which does support dimension writeback
- Is there any way to experiment with this feature without having an Enterprise edition SQL Server setup ?

Thanks

Marcus

Hello. I have som experience regarding this on SSAS2000 and I have not seen any information about changes in SSAS2005.

Here is a link to what functionality that is included in different editions of SQL Server 2005: http://www.microsoft.com/sql/prodinfo/features/compare-features.mspx

Dimension writeback is not a client feature, but cell or cube writeback is. I think that you can only write back to dimensions in BIDS unless you find a way to write code for this with the new object model in SSAS2005. Dimension writeback is normally used to add members to a dimension, restructure a dimension(because it is not correct in the source system) and add some calculation logic to the writeback dimension.

I do not think it is a good idea to permit users to change members in a dimension. You will see a problem with different ideas of how a dimension should be built and clients changing other clients writeback members.

HTH

Thomas Ivarsson

|||

> Dimension writeback is not a client feature, but cell or cube writeback is. I think that you can only write back to dimensions in BIDS unless you find a way to write code for this with the new object model in SSAS2005

Actually, you are wrong. Dimension writeback is as client feature as cell writeback is. There are ALTER CUBE statements which can do it available since AS2000. In AS2005 there is also an XML flavor of these APIs.

|||

Hello Mosha. I am most sure I am wrong because I have only seen dimension writeback in the SSAS2000 dimension editor. I can only remember IntelligentApps as a client that used it, if I am not wrong.

It is not in ProClarity or previous versions of Excel(before 2007)

From my professional point of view we have had a lot of problem with cell writeback before SSAS2005. Dimension writeback is actually good because it have helped with shortcomings in products like Cognos Controller. But this is only as a centralized feature in order to add accounts that are missing in that Cognos product.

What you can do by writing code is a different story.Perhaps I was not clear enough on that point.

Would you recommend client dimension writeback, from the point of having a UDM and a single version of the truth?

Edit: Another question. If a client add a member to a dimension or reorganize it, what will happen to your cube project in BIDS?

Regards

Thomas Ivarsson

|||

Thomas,

Regarding your last question, I don't think the project in BIDS would change based on dimension writeback changes as these types of changes are simply pushed into the dimension table; they don't cause structural changes to the dimension (unless I'm missing something or misunderstand your question and comments).

HTH,

Dave Fackler

|||

Hello Dave. In AS2000 it was possible to move members and groups of members in a dimension that was write enabled. I have not tested this on SSAS2005 because my client, that use this feature, is still on AS2000.

Would not this be a structural change that could cause problems for BIDS? The structure of the dimension in the BI project would not be the same as on the SSAS2005 server?

Another problem will be if several users can add changes on the same members?

I accept Mosha's conclusion that it is technically possible to do it, from a client, but would this not create more problems than it solves?

Regards

/Thomas Ivarsson

|||

Dave is right - writing back to the dimension (or more precisely to the attribute) is not a structural change - it is like incremental process of dimension from all points of view (i.e. indexes and aggregations need to be recomputed after dimension writeback, just like with incremental processing).

Like everything else, dimension writeback is transactional, so multiple users is not a problem by itself either.

But as Thomas says, there is a difference between "technically possible" and "widely used in practice". I haven't seen any client tool which supported dimension writeback except for the one built-in into BIDS, and I don't have a real-life experience with customers using this feature.

Thursday, March 22, 2012

Digital Signature

Hi I have created a Client/Server application. The Client connects remotely to the SQL 2005 server using thier unique user name and password.

The client application allows the users to update a form.

I need to add to the database a digital signature for that user when they update that form. This is intended to be a replacement for a physical signature that would appear on a paper form.

For such an application, most of the signing logic should be at the client level. I'm not sure what is your question and how it relates to SQL Server security - please clarify.

Thanks
Laurentiu

Difficulty in writing a DateTime to a table

I'm developing an application in VB 2005 Express using SQL 2005 Express. I need to put a timestamp into my table each time I create a row...

The following is a snippet...

Dim DDate As [SqlDateTime] = Now()

Dim TheQuery As String = "INSERT INTO Groups (PC_Name_Stamp, OperatorNo, Group_Type, Date_Time) VALUES ('Development', '2', 'Test',' " & DDate & " ')"

Which won't work as I am attempting to concatinate a SqlDateTime into a string.

My best guess is that I need to somehow to use a DEFAULT value in the table that persists so each time a row is created the datetime it was created is saved with the row, rather than being re-calculated each time the table is opened. There are probably several other ways of doing it and this may not be the easiest.

I'm not a programmer, just an Engineer, so I can only read Help for 5 minutes at a time.

Hi Ian,

What is the data type of the field named Date_Time? What is the error you are getting?

I would suggest removing the quotes from your query and just letting SQL handle the data type change from SqlDateTime into what ever Date_Time is defined as. If it is a string, the conversion will likely happen automatically. (At least it does in T-SQL.)

If that doesn't work, consider using a type conversion function rather than just wraping the value in quotes. You should be able to find information about data type conversion functions in the VB help documentations.

One final consideration, if you only need to determine if a row has been updated and the actual time is not really important, you might consider the timestamp data type. This data type automatically updates when a row is added or changed, but it stores a relative time, no the time associated with a clock.

Regards,

Mike Wachal
SQL Express team

-
Mark the best posts as Answers!

|||

Mike,

In order: "datetime"

The error I get is a VB pre-complier error warning that I am attempting to mix "String" with "SqlDateTime".

Removing the quotes does not help as the connection to the database is made with the following command:

Dim TheCommand As SqlCommand = New SqlCommand(TheQuery, TheConnection)

Where both "TheQuery" and "TheConnection" are strings.

Unfortunately I need to know the time and date, this will be used for locating information later.

My most recent attempts have used :

Dim TheQuery As String = "INSERT INTO Groups (PC_Name_Stamp, OperatorNo, Group_Type, Date_Time) VALUES ('Development', '2', 'Test',' GETDATE() ')"

Which throws "Cannot insert an explicit value into a timestamp column. Use INSERT with a column list to exclude the timestamp column, or insert a DEFAULT into the timestamp column." on execution (of the VB program).

I have attempted to set the default on the Date_Time column in "Groups" to be calculated as Getdate() and persistent, but then I get the following error: "Computed column 'DateTime' in table 'Tmp_Groups' cannot be persisted because the column is non-deterministic." I note that a calculated column in the table has no "format", which makes sense if it is not to be saved.

I am assuming that this is the correct forum, I think that the problem is related to SQL rather than .NET or VB.

I will be off the air now for 54 hours due to the weekend.

Thanks for your time Mike.

Ian

|||

It's interesting that you're getting an error specifying a timestamp field. Timestamp is different than datetime, you should make sure that you really have a datetime field.

That said, you're still trying to create string values by putting quotes around them. That isn't how you do it, you have to conver non-string values into strings using a conversion function, in this case CStr(). I managed to write an insert from VB by converting the output of Now() to a string and passing that in my query. I've povided the table definition and VB code below for you to examine.

Table Def-

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

CREATE TABLE [dbo].[Shippers](

[ShipperID] [int] IDENTITY(1,1) NOT NULL,

[CompanyName] [nvarchar](40) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,

[Phone] [nvarchar](24) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

[tsTime] [datetime] NULL,

[sTime] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

CONSTRAINT [aaaaaShippers_PK] PRIMARY KEY NONCLUSTERED

(

[ShipperID] ASC

)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]

) ON [PRIMARY]

-- End Table -

- Code--

Sub Main()

Dim cnn As New SqlConnection

cnn.ConnectionString = "Data Source=.\sqlexpress;Initial Catalog=NorthwindSQL_Upsize;Integrated Security=True"

cnn.Open()

Dim cmd As New SqlCommand

cmd.CommandText = "INSERT INTO Shippers (CompanyName, Phone, tsTime) VALUES('VB Shippers','555-1212','" & CStr(Now()) & "')"

cmd.Connection = cnn

cmd.ExecuteNonQuery()

End Sub

- End Code --

|||

Mike,

A very astute observation, I do have an issue with the column format.

A search of my harddisk shows a total of 8 copies of this database, two I have as backups, one is a copy I was importing data into using Management Studio, the rest have uncertain pedigree, (some I no doubt created in error).

I long for the days of SQL Server 2000 when I only kept two copies of the database, (one live & one copy). Having a cut-back latest version makes it very tempting to develop & use the latest, but I wonder if SQL Server Express has been emasculated to the extent that it is no longer worthy of the title "Database". Yes, the mistake was mine, I think it was an easier mistake to make due to the "over enthusiastic feature removal".

Thank you for you help Mike.

Ian

sql

Wednesday, March 7, 2012

Different SQL server 2000 editions

Hi all
I am just wondering, will there be any issues if i use different SQL server
editions in different environments for an application that requires a
database? Meaning, this application that i hv writes to a database, and
there are 2 environments for this application, i.e. Production and SIT/UAT.
Each environment will hv 1 SQL server, but the question is, since the SIT/UA
T
environment is only for use by a few users, can i deploy SQL Server std
edition in this environment while the prod environment, we install the
Enterprise edition?
ThanxYes , you can do so.
We also follow the same startegy , if users are few and no logshipping
and replication requried you can use standard edition, that savings,
you can spend more on your prod environment.|||Actually, I use the Developer Edition for this since I get the full
functionality of the Enterprise Edition with some minor restrictions.
Mike
Mentor
Solid Quality Learning
http://www.solidqualitylearning.com
"swat" <swat@.discussions.microsoft.com> wrote in message
news:4AEC196C-0CC3-4E60-A499-FAEFB6FB7EEF@.microsoft.com...
> Hi all
> I am just wondering, will there be any issues if i use different SQL
> server
> editions in different environments for an application that requires a
> database? Meaning, this application that i hv writes to a database, and
> there are 2 environments for this application, i.e. Production and
> SIT/UAT.
> Each environment will hv 1 SQL server, but the question is, since the
> SIT/UAT
> environment is only for use by a few users, can i deploy SQL Server std
> edition in this environment while the prod environment, we install the
> Enterprise edition?
> Thanx

Different SQL server 2000 editions

Hi all
I am just wondering, will there be any issues if i use different SQL server
editions in different environments for an application that requires a
database? Meaning, this application that i hv writes to a database, and
there are 2 environments for this application, i.e. Production and SIT/UAT.
Each environment will hv 1 SQL server, but the question is, since the SIT/UAT
environment is only for use by a few users, can i deploy SQL Server std
edition in this environment while the prod environment, we install the
Enterprise edition?
ThanxYes , you can do so.
We also follow the same startegy , if users are few and no logshipping
and replication requried you can use standard edition, that savings,
you can spend more on your prod environment.|||Actually, I use the Developer Edition for this since I get the full
functionality of the Enterprise Edition with some minor restrictions.
--
Mike
Mentor
Solid Quality Learning
http://www.solidqualitylearning.com
"swat" <swat@.discussions.microsoft.com> wrote in message
news:4AEC196C-0CC3-4E60-A499-FAEFB6FB7EEF@.microsoft.com...
> Hi all
> I am just wondering, will there be any issues if i use different SQL
> server
> editions in different environments for an application that requires a
> database? Meaning, this application that i hv writes to a database, and
> there are 2 environments for this application, i.e. Production and
> SIT/UAT.
> Each environment will hv 1 SQL server, but the question is, since the
> SIT/UAT
> environment is only for use by a few users, can i deploy SQL Server std
> edition in this environment while the prod environment, we install the
> Enterprise edition?
> Thanx

Different SQL server 2000 editions

Hi all
I am just wondering, will there be any issues if i use different SQL server
editions in different environments for an application that requires a
database? Meaning, this application that i hv writes to a database, and
there are 2 environments for this application, i.e. Production and SIT/UAT.
Each environment will hv 1 SQL server, but the question is, since the SIT/UAT
environment is only for use by a few users, can i deploy SQL Server std
edition in this environment while the prod environment, we install the
Enterprise edition?
Thanx
Yes , you can do so.
We also follow the same startegy , if users are few and no logshipping
and replication requried you can use standard edition, that savings,
you can spend more on your prod environment.
|||Actually, I use the Developer Edition for this since I get the full
functionality of the Enterprise Edition with some minor restrictions.
Mike
Mentor
Solid Quality Learning
http://www.solidqualitylearning.com
"swat" <swat@.discussions.microsoft.com> wrote in message
news:4AEC196C-0CC3-4E60-A499-FAEFB6FB7EEF@.microsoft.com...
> Hi all
> I am just wondering, will there be any issues if i use different SQL
> server
> editions in different environments for an application that requires a
> database? Meaning, this application that i hv writes to a database, and
> there are 2 environments for this application, i.e. Production and
> SIT/UAT.
> Each environment will hv 1 SQL server, but the question is, since the
> SIT/UAT
> environment is only for use by a few users, can i deploy SQL Server std
> edition in this environment while the prod environment, we install the
> Enterprise edition?
> Thanx

Friday, February 24, 2012

Different indexes - performance analysis question

Hello

I'm doing some performance analysis for my application. I'm doing 7600 SQL queries based on the following SQL query:

SELECT LocationId, ProductId, BatchId, SUM(Quantity) AS Quantity FROM Logistics WHERE UserId = [number] AND ProductId IN ([productidlist]) GROUP BY LocationId, ProductId, BatchId;

Data in table Logistics has LocationId = 1 and BatchId = 0 for absolute all rows in this test, UserId and ProductId may be different. For each SQL Query it's doing, it's also inserting new rows in the table. The table starts with 0 rows for the first SQL query above, ends with 35 000 rows. Execution for both Editions below is exactly the same (same data inserts)

The graph below is showing the time used in milliseconds (y axis) for each query (x axis) - both editions is doing the exactly the same query but with different indexes.

URL to graph: http://www.lostfields.com/sqlindexing.gif

Edition 2 has the following priority on the PK: UserId, LocationId, ProductId, BatchId
Edition 2 Optimized has the following priority on the PK: UserId, ProductId, BatchId, LocationId.

How come Edition 2 have to scan over a lot more indexes than Edition 2 Optimized? As I can see it this shouldn't have happened since LocationId = 1 all the time. Or am I missing something?

[edit] <img> tag didn't work so I have to just paste the url

What happens if you put locationId = 1 in your query. Its all about selectivity.

What other columns are on the table. I would also look at what happens if you include userid in the group by.

Can you capture the two query plans.

|||

Yes, thank you

It did help a lot to include LocationId = 1 in the query, when I did this in Edition 2 it became just similar to Edition 2 Optimized. I couldn't see any performance increase by including UserId in the GROUP BY.

The other fields/columns are just a TransactionDate (date for the insert) and TransactionId (identity to make it unqiue for stopping a duplicate insert).

The two Execution Plans can be found at http://www.lostfields.com/sqlindexing_plan.gif

I'm not sure why Edition 2 Optimized has a sort method there though, as Edition 2 doesn't, but have a filter (since LocationId isn't in where clause I guess).

different environment fails to fill a dataset

I have a C# client application that uses SQL Server as a backend. It works
fine on my development workstation. But when I moved it to another test
workstation four out of the five winforms worked fine but one doesn't. The
one that doesn't can open the connection and return the server version as a
test of whether the open worked right. I does. But when you run the
oledbadapter.fill command to fill the dataset it fails. It acts as if it
can't open the server. Further reading shows that the fill command can
actually open a connection on its own if necessary without the open command.
Is there anything in the environment or SQL Server that could be causing this
rejection. The SQL Server database was detached, copied, and then reattached
on the test workstation. SO it should be a duplicate.
Randy
Did you resync the logins to the users in that db after you attached it? If
not check out sp_change_users_login in BooksOnLine.
Andrew J. Kelly SQL MVP
"rseedle" <rseedle@.discussions.microsoft.com> wrote in message
news:C298B6AF-C57D-40EE-905C-CB50F29126F3@.microsoft.com...
>I have a C# client application that uses SQL Server as a backend. It works
> fine on my development workstation. But when I moved it to another test
> workstation four out of the five winforms worked fine but one doesn't. The
> one that doesn't can open the connection and return the server version as
> a
> test of whether the open worked right. I does. But when you run the
> oledbadapter.fill command to fill the dataset it fails. It acts as if it
> can't open the server. Further reading shows that the fill command can
> actually open a connection on its own if necessary without the open
> command.
> Is there anything in the environment or SQL Server that could be causing
> this
> rejection. The SQL Server database was detached, copied, and then
> reattached
> on the test workstation. SO it should be a duplicate.
> Randy

Different Edition of SSIS

We have an application that needs SSIS on the application server to upload data to our SQL database server which runs enterprise edition. Do I need to install the same editon of SSIS on the application server? Can SQL 2005 Standard editon SSIS communicate with the Enterprise Edition? Thanks.

Yes, you can use any SQL Server edition that includes an SSIS license on your application server.
|||

isd83 wrote:

We have an application that needs SSIS on the application server to upload data to our SQL database server which runs enterprise edition. Do I need to install the same editon of SSIS on the application server? Can SQL 2005 Standard editon SSIS communicate with the Enterprise Edition? Thanks.

Yep, the standard or enterprise versions of SQL Server are required. Either will work in this case.

|||Thank you Phil and JayH for you help.