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

Thursday, March 22, 2012

create a flat file on a remote server

Hi,

In the new flat file connection dialog box, can i create a flat file on a remote server? thanks.

Yes, if you can access that server through a network share. Try using the UNC path, e.g.

\\ServerName\ShareName\Folder\File.txt

\\DGPC\C$\Temp\File.txt

sql

Sunday, March 11, 2012

CR from only code(VS 2005)

Hey gurus

I need to create a crystal report entirely from code

i have a form where a customer will add table(s) to a list box, depending on the added tables, a list of fields applicable to the respective table can be added to another list. On selection of each of these fields, values may be entered so as to filter the data displayed on the report.

From each of the availble fields that can be "Parametized", a group can be created, with ascending/descending order

Finally summaries can be added such as the sum of all amounts(total,VAT etc) to the end of the report
Report options like drill-down will need to be able to be set dynamically also.

so far everything above here is basicly how to generate my SQL statement, which won'y be that difficult.

But i have no idea how to make my report document show information the way i have described above.

left list < > right list (Panel with combobox, textbox , checkbox(enable/disable))

tables,field, groups are added/removed as depicted above
fields and groups have a panel next to each rightlistbox where parameters can be set like (< = > between like <> asc desc)

at the bottom of the form there are 3 buttons
Preview report data --> shows datagrid of Data retrieved via generated SQL statement
Preview Report --> shows a itempanel with items for each field/group/summary field
Create report - Creates crystal report and shows in report viewer on a tab created before the report begins creation

At this point, i am not very close to being far from completion
any help will be greatly appreciated
Thanks
Jsee attached file of GUI so you can get a better idea of what i am trying to do, sorry bout bad quality 100kb is not alot but sufficient|||I have made some progress on this

The code below shows the population of a dataset and subsequently binding it to a report, then showing that report in a report viewer control on a new tab created here also.

The report is completely blank. There is however data in the TRDS dataset



Private Sub MakeReport()

Dim TRDS As New DataSet

Dim ConString As String = ""

Dim CON As OleDb.OleDbConnection

Dim DA As OleDb.OleDbDataAdapter

Dim NewTabPanel As New DevComponents.DotNetBar.TabControlPanel

Dim RptUC As New ReportOnTab ' Usercontrol with crystal reportviewer on a panel

'Get Data

Try

TRDS = New Report1DataSet

If My.Settings.User_Claims_ManagementConnection_String = "" Then

ConString = My.Settings.Claims_Management_SystemConnectionString.ToString

Else

ConString = My.Settings.User_Claims_ManagementConnection_String.ToString

End If

CON = New OleDb.OleDbConnection(ConString)

DA = New OleDb.OleDbDataAdapter(FullSQL, CON)

'Fill the dataset

DA.Fill(TRDS, "Client")

'Make report on new tab

NewTabPanel.Name = "NewTab_Panel"

NewTabPanel.Text = "This is the new reports panel"

'Report creation

Report = New Report1

'Settings for the report

'Set datasource to the generated dataset

Report.SetDataSource(TRDS)

'At this point there is a blank report, with a dataset attached to it containing, one table and rows filtered by where in FULLSQL

'Set groups

'Add fields that will be shown to detail section

'Add summaries

'Apply formatting

'End of report creation

'Create tab on tab control

ReportTab.CreateTab("Name of this report", -1)

'Attach usercontrol to tab panel and make dock fill

ReportTab.Tabs.Item(ReportTab.Tabs.Count - 1).AttachedControl.Controls.Add(RptUC)

ReportTab.Tabs.Item(ReportTab.Tabs.Count - 1).AttachedControl.Controls.Item(0).Dock = DockStyle.Fill

'Reset the report creation form

ReportDefinitionsClear()

'Select the newly created tab

ReportTab.SelectedTab = ReportTab.Tabs.Item(ReportTab.Tabs.Count - 1)

'Set source of the usercontrol report viewer to this report

RptUC.ReportViewer.ReportSource = Report

Catch ex As Exception

MessageBox.Show(ex.Message)

End Try

End Sub



now the FULLSQL variable is rather dynamic and is generated through use of the above picture's gui, thats 2000 lines, shud i post that to?

anyway, it works, all i need to do now is...

1.! create fields from the SELECT statement on the report

2.! create groups via the ORDERBY statement on the report

3.! Finally add any other summaries,special fields, and so on to the report

My question is how do i achieve such a feat,

How do i add groups via code to the detail section?
How do i add fields via code to my blank reports detail section?
Is it even possible?

So far have discovered that most things within the report1 class are readonly.

I have looked everywhere online, searched for 2 days and found nothing like this

Please help
Thanks
J

CPU/Core Prio. on SQL Server Express Instance?

Hi,
I am currently using a single SQL Server Express Instance on a Core 2 Duo
box.
I know that the Express version is limited to use 1 CPU/Core.
I now want to setup a second SQL Server Express instance for unrelated
purposes.
Is it possible to give one instance Core 0 prio, and the Second the Core 1
prio, or do they ALWAYS (MUST/ONLY) use Core 0?
Also, if I don't set it specifically will Windows manage it properly?
I guess my main question in detail is:
Is the Express version build in such a way that it will always use the first
core/cpu regardless how many there are? For example, if I have 3 instances
running, would they all fight for cycles on the first core/cpu?
If not, do I have to do/set something to make it work properly?
Thanks for any Info. on this!
Regards,
FrankExpress will only create one scheduler. A scheduler is by default not bound to a particular core, it
can "float" between the cores. However, there is no guarantee that your two express instances will
always be on different cores.
However, you can use sp_configure and the "affinity mask" option to specify that instance it is tied
to core 0 and instance 2 is tied to core 1. This way you've configured the two instances to use
different cores.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Frank Osterberg" <raven7370@.yahoo.com> wrote in message
news:uVFYNK6dIHA.748@.TK2MSFTNGP04.phx.gbl...
> Hi,
> I am currently using a single SQL Server Express Instance on a Core 2 Duo box.
> I know that the Express version is limited to use 1 CPU/Core.
> I now want to setup a second SQL Server Express instance for unrelated purposes.
> Is it possible to give one instance Core 0 prio, and the Second the Core 1 prio, or do they ALWAYS
> (MUST/ONLY) use Core 0?
> Also, if I don't set it specifically will Windows manage it properly?
> I guess my main question in detail is:
> Is the Express version build in such a way that it will always use the first core/cpu regardless
> how many there are? For example, if I have 3 instances running, would they all fight for cycles on
> the first core/cpu?
> If not, do I have to do/set something to make it work properly?
> Thanks for any Info. on this!
> Regards,
> Frank
>|||> Also, if I don't set it specifically will Windows manage it properly?
To add on to Tibor's response, the OS can schedule work on any available
core when the SQL Server affinity mask is not set. You do not need to do
anything special to make this happen.
--
Hope this helps.
Dan Guzman
SQL Server MVP
http://weblogs.sqlteam.com/dang/
"Frank Osterberg" <raven7370@.yahoo.com> wrote in message
news:uVFYNK6dIHA.748@.TK2MSFTNGP04.phx.gbl...
> Hi,
> I am currently using a single SQL Server Express Instance on a Core 2 Duo
> box.
> I know that the Express version is limited to use 1 CPU/Core.
> I now want to setup a second SQL Server Express instance for unrelated
> purposes.
> Is it possible to give one instance Core 0 prio, and the Second the Core 1
> prio, or do they ALWAYS (MUST/ONLY) use Core 0?
> Also, if I don't set it specifically will Windows manage it properly?
> I guess my main question in detail is:
> Is the Express version build in such a way that it will always use the
> first core/cpu regardless how many there are? For example, if I have 3
> instances running, would they all fight for cycles on the first core/cpu?
> If not, do I have to do/set something to make it work properly?
> Thanks for any Info. on this!
> Regards,
> Frank
>|||Great! Thank you very much!!!
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> schrieb
im Newsbeitrag news:eI1NqL7dIHA.4728@.TK2MSFTNGP03.phx.gbl...
> Express will only create one scheduler. A scheduler is by default not
> bound to a particular core, it can "float" between the cores. However,
> there is no guarantee that your two express instances will always be on
> different cores.
> However, you can use sp_configure and the "affinity mask" option to
> specify that instance it is tied to core 0 and instance 2 is tied to core
> 1. This way you've configured the two instances to use different cores.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "Frank Osterberg" <raven7370@.yahoo.com> wrote in message
> news:uVFYNK6dIHA.748@.TK2MSFTNGP04.phx.gbl...
>> Hi,
>> I am currently using a single SQL Server Express Instance on a Core 2 Duo
>> box.
>> I know that the Express version is limited to use 1 CPU/Core.
>> I now want to setup a second SQL Server Express instance for unrelated
>> purposes.
>> Is it possible to give one instance Core 0 prio, and the Second the Core
>> 1 prio, or do they ALWAYS (MUST/ONLY) use Core 0?
>> Also, if I don't set it specifically will Windows manage it properly?
>> I guess my main question in detail is:
>> Is the Express version build in such a way that it will always use the
>> first core/cpu regardless how many there are? For example, if I have 3
>> instances running, would they all fight for cycles on the first core/cpu?
>> If not, do I have to do/set something to make it work properly?
>> Thanks for any Info. on this!
>> Regards,
>> Frank
>|||Ok, i was hoping it would be like that. Thank you!!!
"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> schrieb im Newsbeitrag
news:D1D2B4EC-1D77-4D1E-941C-9E2E0F985F8C@.microsoft.com...
>> Also, if I don't set it specifically will Windows manage it properly?
> To add on to Tibor's response, the OS can schedule work on any available
> core when the SQL Server affinity mask is not set. You do not need to do
> anything special to make this happen.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> http://weblogs.sqlteam.com/dang/
> "Frank Osterberg" <raven7370@.yahoo.com> wrote in message
> news:uVFYNK6dIHA.748@.TK2MSFTNGP04.phx.gbl...
>> Hi,
>> I am currently using a single SQL Server Express Instance on a Core 2 Duo
>> box.
>> I know that the Express version is limited to use 1 CPU/Core.
>> I now want to setup a second SQL Server Express instance for unrelated
>> purposes.
>> Is it possible to give one instance Core 0 prio, and the Second the Core
>> 1 prio, or do they ALWAYS (MUST/ONLY) use Core 0?
>> Also, if I don't set it specifically will Windows manage it properly?
>> I guess my main question in detail is:
>> Is the Express version build in such a way that it will always use the
>> first core/cpu regardless how many there are? For example, if I have 3
>> instances running, would they all fight for cycles on the first core/cpu?
>> If not, do I have to do/set something to make it work properly?
>> Thanks for any Info. on this!
>> Regards,
>> Frank
>

Thursday, March 8, 2012

CPU Utilization

Hi All,

I want to keep track of the CPU utilization & number of users connected for each database on our production box. I chose to get the data from sysprocesses table from master database.

But I realised that for some reason the master..sysprocesses.CPU column stays static or just keeps on adding to existing values.

Is there any ways thru which I can clear this data ( cpu column in sysprocesses table) after I have captured it in a table ?

Any help is appreciated.

Thanks.You may be better off using perfmon with those two counters. yOu can put the output to a .csv, for later import into databases. This will not give you CPU usage per connection, however, so it is somewhat useless if you want to do chargebacks of some sort.

Saturday, February 25, 2012

CPU and I/O affinity config

I have 8 Processors and 12 GB memory box, I want to install two production
SQl Server 2005
instances on this box. Please advise what is the correct seeting to set these
processor affinity and i/0 affinity.
I am planning to assaign 4 CPu for one instace and 3 instances for another
instance.
My confusion is i need to use same CPUs for CPU affinity and i/o affinity or
how to achive this?
4 CPU for one instanec - 0,1,2,3. here confusion i need to check 0,1,2,3 use
CPY affinitymask and 0,1,2,3 to i/o affinity mask or 0,1 for CPU affinity
mask 2,3 for i/o affinity mask.
Please give some advise or related articleas on this how to do configure.
--
SQL serer DBAHi
According to http://msdn2.microsoft.com/en-us/library/ms189629(SQL.90).aspx
"When specifying the affinity I/O mask option, you must use it with the
affinity mask configuration option. Do not enable the same CPU in both the
affinity I/O mask switch and the affinity mask option"
John
"Srikanth" wrote:
> I have 8 Processors and 12 GB memory box, I want to install two production
> SQl Server 2005
> instances on this box. Please advise what is the correct seeting to set these
> processor affinity and i/0 affinity.
> I am planning to assaign 4 CPu for one instace and 3 instances for another
> instance.
> My confusion is i need to use same CPUs for CPU affinity and i/o affinity or
> how to achive this?
> 4 CPU for one instanec - 0,1,2,3. here confusion i need to check 0,1,2,3 use
> CPY affinitymask and 0,1,2,3 to i/o affinity mask or 0,1 for CPU affinity
> mask 2,3 for i/o affinity mask.
> Please give some advise or related articleas on this how to do configure.
>
> --
> SQL serer DBA

CPU and I/O affinity config

I have 8 Processors and 12 GB memory box, I want to install two production
SQl Server 2005
instances on this box. Please advise what is the correct seeting to set thes
e
processor affinity and i/0 affinity.
I am planning to assaign 4 CPu for one instace and 3 instances for another
instance.
My confusion is i need to use same CPUs for CPU affinity and i/o affinity or
how to achive this?
4 CPU for one instanec - 0,1,2,3. here confusion i need to check 0,1,2,3 use
CPY affinitymask and 0,1,2,3 to i/o affinity mask or 0,1 for CPU affinity
mask 2,3 for i/o affinity mask.
Please give some advise or related articleas on this how to do configure.
SQL serer DBAHi
According to http://msdn2.microsoft.com/en-us/library/ms189629(SQL.90).aspx
"When specifying the affinity I/O mask option, you must use it with the
affinity mask configuration option. Do not enable the same CPU in both the
affinity I/O mask switch and the affinity mask option"
John
"Srikanth" wrote:

> I have 8 Processors and 12 GB memory box, I want to install two production
> SQl Server 2005
> instances on this box. Please advise what is the correct seeting to set th
ese
> processor affinity and i/0 affinity.
> I am planning to assaign 4 CPu for one instace and 3 instances for another
> instance.
> My confusion is i need to use same CPUs for CPU affinity and i/o affinity
or
> how to achive this?
> 4 CPU for one instanec - 0,1,2,3. here confusion i need to check 0,1,2,3 u
se
> CPY affinitymask and 0,1,2,3 to i/o affinity mask or 0,1 for CPU affinity
> mask 2,3 for i/o affinity mask.
> Please give some advise or related articleas on this how to do configure.
>
> --
> SQL serer DBA