MAJOR PROBLEM: New SQL2005 Installation Performance Problem.

Sep 26, 2006

We are experiencing a major issue since upgrading from SQL2000 to SQL2005 over the weekend. Starting today, it appears that the performance of SQLServer reaches a limit every 15 minutes.

Our configuration is as follows:

Window Server 2K3 x64 Enterprise

SQLServer 2005 x64 Enterprise

HP DL585 with 4 dual core Opterons

32 GB of RAM

2 TB EMC SAN

At first, I thought there was a memory pressure problem, since I had the default max memory set. After changing the max memory to only 25 GB (out of 32 available), the issue went away temporarily. However, after 15-20 minutes, the number of batches/sec dropped in half, and remained after half until I changed the max memory setting again. Over the course of the day, I was able to fix the issue each time by just changing the max memory by 1MB. (From 30,000 to 29,999 and back from 29,999 to 30,000). Each time, the batches/sec counter immediately doubles and remains there for about 15-20 minutes. None of the SQL statements have changed since upgrading.

I have found this post, which talks about a similar issue at the end of the thread:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=746299&SiteID=1

Any ideas?...this is frustrating to no end.

Thanks!

Ryan

View 8 Replies


ADVERTISEMENT

Major SQL Server/SSIS 2005 Performance Issue

Mar 24, 2006

SQL Server 2005 is installed on a brand new 64-bit server (Windows 2003 x64 std. Edition, 2.4 Ghz AMD opteron- 2cpu, 8.8 Gb of RAM). There is barely few hundred rows of data scattered among few tables in one database.

SQL server and SSIS performace grossly degrades overnight and in the morning everything is slow including the clicking of tool bar selection.It takes 3 seconds to execute a simple select statement against an empty table.

It takes15-20 seconds to execute a SSIS package that normally would take 2-3 seconds.

But once SQL Server is restarted, everything returns to normal and the performance is good all day and then the next day everything is slow again.

Thank you for your help.

View 3 Replies View Related

Stuck With A SQL2005 Installation

Aug 7, 2007

Hi there guys I am hitting my head against a brick wall trying to install SQL 2000 and SQL 2005 side by side and wonder if someone has a suggestion that may help please.


My operating system is win xp 32 bit, I have recently purchased this machine and it came with office 2007 already pre installed which comes with a named instance version of sql 2005 business contact manager, I then installed a default instance of sql 2000 (with SP 4)client tools and the server with no problem , I then purchased a cd of Microsoft SQL Server 2005 Standard Edition (32-Bit)for me to install to run alongside the 2000 version that is currently running on the same machine when all hell broke loose.

I selected the option saying install server components, tools , books online etc etc.

I agree to the licence agreement

Setup then installs Microsoft SQL Server 2005 Setup support Files succesfully, I press next...

Welcome to the Microsoft SQL Server installation wizard then comes up, I press next

System Configuration check brings back 14 successsful status messages and one warning message namely Edition Change Check warning
saying :

quote:Edition Change Check (Warning)
Messages
Edition Change Check

To change an existing instance of Microsoft SQL Server 2005 to a different edition of SQL Server 2005, you must run SQL Server 2005 Setup from the command prompt and include the SKUUPGRADE=1 parameter.

I ignore above and press Next..

It then comes up with registration information which i succesfully complete, pressing Next

I then select all the components to install and press next

I then set it up to be a named instance 'MSSQL2005DATA', fine >> pressed next

Then I set it up to run under the local system account , fine. >> pressed next.


Then using windows authentication mode pressed next >>

Left collation settings as per default pressed next >>

Install the default configuration in the report server installation options message box, I pressed next >> which then comes up with the following message :

(SQL Server Setup failed to obtain system account information for the ASPNET account.To proceed, reinstall the .net framework and then run SQL server Setup again)

i don't have a copy of the .net framework so I select the install but do not configure the server option.

Setup then comes up with Ready to install message box which i then press the install button, which shows the following:

Setup Progress Files Status:
SQL SETUP Support Setup Finished


OWC11 Setup failed, Refer to log

coming up with a error:

ERROR 1706 Setup cannot find the required files,Check your connection to the network, or cd rom, For other potential solutions to this problem, see c:Program FilesMicrosoft OfficeOffice111033Setup.chm


I then press ok

and the setup progress fails to install :

OWC11
SQL SErver Database Services
Analysis Services
Reporting Services
Notification Services
Integration Services
Workstation Components

but I can't view any of these log files the only one that is available to view is sqlsetup0014_PCName_OWC11_1.log which comes up with the same message

MSI (s) (78:48) [12:44:04:581]: SOURCEMGMT: Source is invalid due to missing/inaccessible package.
MSI (s) (78:48) [12:44:04:581]: Note: 1: 1706 2: -2147483647 3: OWC11.MSI
MSI (s) (78:48) [12:44:04:581]: SOURCEMGMT: Processing URL source list.
MSI (s) (78:48) [12:44:04:581]: Note: 1: 1402 2: UNKNOWNURL 3: 2
MSI (s) (78:48) [12:44:04:581]: Note: 1: 1706 2: -2147483647 3: OWC11.MSI
MSI (s) (78:48) [12:44:04:581]: Note: 1: 1706 2: 3: OWC11.MSI
MSI (s) (78:48) [12:44:04:581]: SOURCEMGMT: Failed to resolve source
MSI (s) (78:48) [12:49:43:192]: Product: Microsoft Office 2003 Web Components -- Error 1706. Setup cannot find the required files. Check your connection to the network, or CD-ROM drive. For other potential solutions to this problem, see C:Program FilesMicrosoft OfficeOFFICE111033SETUP.CHM.

Error 1706. Setup cannot find the required files. Check your connection to the network, or CD-ROM drive. For other potential solutions to this problem, see C:Program FilesMicrosoft OfficeOFFICE111033SETUP.CHM.

I have tried installing office 2003 to get the 0wc11.dll but to no avail it still gives me the same error..

Sorry this is a long winded post but can anyone shed a ray of light here.

Thank you.

View 8 Replies View Related

SQL2005 Std Edition Installation With CAL License

Jan 9, 2008

Hi how to install SQL 2005 Standard Edition with CAL License???

-Thanks N Regards,
Kanthi.

View 3 Replies View Related

SQL2005 SP2 Installation -starting Trouble

Jul 13, 2007

Hi,

I am running SQL2005 SP1 Standard Edition in Win2k3 , when i try to install SP2, at the initial stage itself it fails with login failure message. But with the same SA password i am able to login to the Management studio. I tried with Windows authentication , that also fails. Service is running with local system account and i am logged in the server using the administrator user.

Looks like i am missing something in the process.

Can anyone tell me what could be the issue?



Thanks in advance.

siva

View 3 Replies View Related

MS SQL2005 Express Ed + SSIS Installation Problem

Jun 22, 2007

Hi,

I have tried to install SSIS going steps msdn2 using "mssql setup" but my "ssis" option is not available for installation.

Pls, help!

View 4 Replies View Related

SQL2005 Installation Errr After Installing VS2008

Mar 12, 2008

Dear,

I Had VS20005 and SQL 2005 Working perfectly. For some errors, I did formatted my PC and installed VS2008. After doing that, I am trying to install MSSQL2005, when installation be in "Integration development environment with 2005" Phase, An error appears, and the installation stopped. What I have to Do to solve this?
Note: I ahve XPSP2 32 bit installed.

View 5 Replies View Related

Slow Performance In SQL2005

Feb 19, 2008

Hi,We have shifted one of our data processing to a new instance of SQL2005. For this a new DB was created in SQL2005 and it is not anupgrade of SQL200 DB.The data processing application is a VB6 application that runs a batchprocess to insert about4.5 million records everyday in this SQL 2005 database. I am usingADO(ver 2.6) Connection object to execute T-SQL insert statements toinsert the 4.5 mill. records.This same application used to insert the data in the SQL 2000databaseand used to take about 2.5 hours to do so. After moving it to SQL2005 the performance has really detriorated and it now takes morethan6 hours.Is there any configuration change that I need to do in SQL 2005?Please help.Note: There is also an instance of SQL 2000 running in the sameserver.TIA,Tawfiq

View 3 Replies View Related

SQL2005 Performance Problem

Mar 20, 2008

We have an installed site with two SQL2005 servers (workgroup, SP2).At the publisher we recently (yesterday) bulk inserted about 2million linesinto a table from a third server that's going to be part of the replicatinggroup. However, since importing these records (using 'Import Data' to getthe data in and then running a no-change update to make replication aware ofthem) the performance has become dreadful. The hard-drive is swamped withdisk writes.The first symptom that something was wrong was when replication startedtiming out, even when I turned off all subscriptions except for one - andthat one didn't have any of its tables modified by the import. Even puttingthe agent on a slow profile with extended query timeouts doesn't help.Any suggestions?Many thanks.Jim--http://www.ursaMinorBeta.co.uk"When one of the local cats, an especially fluffy creature with a vasttail, rushed down the street towards me the other day, mewing delightedly,I have to admit it was probably shouting 'HAZ CHEZBURGR?' " - Bella, ucsm

View 2 Replies View Related

Installation Of SQL2005 Enterprise(English Version) Under Different Lanuage Verion Of Windows 2003

May 6, 2008

I found sql2005 Enterprise cannot be installed under Simplied Chinese win 2003, the only thing i suspect is that win2003 is an envaluation copy with netframework 2.0 be installed.

View 1 Replies View Related

Question Regarding Slow Performance An PAGEIOLATCH_SH Locks On Sql2005

Dec 7, 2007

Hi,I wondered in anyone can help with the following problem that i'mexperiencing, i'll try to provide as much info as possible and anysuggestions would be appreciated.I have just started at an organsiation and there seems to be slowperformance maybe on the san on a 64bit itanium dual core machine. 4CPUs are being showed to sql server, it also has 16gb of RAM. I'llstart with the configuration of the SAN.After speaking to the SAN guy, rather than carve the SAN up intodifferent area's for san Logs/Data etc they have gone for the approachof spreading a Vdisk across as many spindles as possible (All 145 ofthem). So the area that is presented to the SQL Server according thethe SAN guys is a vraid 5 stripe made up of all 145 disks which areall 72gb fibre-channel disks.This storage is not just made available to sql server but also madeavailable to other apps as well that need storage. Having read themanufactres best practice on setting this up there is a valid argumentfor doing this.The bandwidth from the SAN is 2Gb fibre, with each computer that usesthe SAN having 2Gb fibre cards.Clearly, that could act as a bottle-neck. But, there's nothing thatcan be done about it according to the SAN guy.Needless to say, any changes on the SAN are pretty much going to beout of the question as far as he's concerned but i think performanceisn't that good for the type of box they have and the SAN its attachedto.The 2nd thing i'll explain is the setup of the database in question,firstly whoever set it up split the database into 16 different file of4 filegroups so the table that i'm selecting to is in one filegroupsplit over 4 files and the the table selecting from is in anotherfilegroup made up of another 4 files. These are placed on the samephysical disk made up of the SAN LUN with 145 spindles.Anyway when i do a select from a sales table which has various groupbys and then insert the results into a blank table with no indexes itcan take over 2hours for 200k rows which i find very slow.When i look at the sysprocesses table i am getting various waits asfollows :-72427200x0042900PAGEIOLATCH_SH 6:9:219209472427200x00690SLEEP_TASK72427200x00000SOS_SCHEDULER_YIELDThe process seams to be going inbetween a PAGEIOLATCH andSOS_SCHEDULER_YIELD a few times per second.Running the following to get io stalls gives the following :-Select * from sys.dm_io_virtual_file_stats (6,7)Select * from sys.dm_io_virtual_file_stats (6,8)Select * from sys.dm_io_virtual_file_stats (6,9)Select * from sys.dm_io_virtual_file_stats (6,10)gives results like :-67170853985015624218246512844829457222526431245540454412438340307010565449074954240x0000000000000954It worries me that when the process is on the PAGEIOLATCH the waitcan be over 1000. Is it normal for the wait to be this long and whatwould be the best way to prove one way or another if the configurationof the san is causing this kind of performance???Thanks for any suggestions in advanceIan.

View 1 Replies View Related

SQL2005 Enterprise Database Engine Performance Features (versus Standard)

Feb 21, 2007

Can anyone comment on the engine performance difference between SQL2005 Enterprise Edition versus Standard? I'm talking generalized performance of the engine and not admin features (parallel index operations) or scaled-storage (partitioning)

( http://www.microsoft.com/sql/editions/enterprise/comparison.mspx )

The marketing literature makes note of two things:

Enterprise can use more then 4 processors

Enhanced read-ahead and scan (super scan)
(note: I cannot find anything about this 'feature')
One un-noted Feature:

only Enterprise supports 'lock pages in memory'


We are in the process of migrating from SQL2000 to SQL2005 in an OLTP environment. Based on the marketing literature; I would have chosen SQL2005-standard. But based on our limited testing, we are seeing some strange differences.

Query Performance

With MaxDOP=1 and using a large batch query (select top 1500000); SQL2005-Enterprise is twice as fast as SQL2005-Standard.

(Note: this difference persists regardless of lock-pages-in-memory setting)

CPU Utilization

In addition, taskmgr shows that SQL2005-Enterprise uses a single processor at ~90%. While SQL2005-Standard shows a single processor at ~20%.

Lock Behavior

We are also seeing lock-behavior differences. A single DML statement that attempts to modify ~5000 rows will cause Table-locks on SQL2005-Standard but obtain normal row-locks on SQL2005-Enterprise.



These empirical differences make me wonder if the engine codebase is fundamentally different between the two?

Any insight would be appreciated.

View 4 Replies View Related

Performance Issues After Installation Of Sp2.

Jun 28, 2000

We have a program (originally written for sql 4.21) with a lot of embedded sql in it. The program was adapted for sql 7.0 but still uses embedded sql and did run quite well. After we have installed sp2 we noticed a considerable performance decrease. So we traced in order to find the sql causing this. Several statements (from the embedded code) using cursors seems to cause the trouble. When we ran the code in query manager, the access path was good (runtime some milliseconds), when running the code via the embedded-sql-program then same sql statement runs as slow as hell (runtime 3 to 10 minutes). When looking at reads/writes/cpu, it's obvious that the optimizer uses a whole other accesspath. Probably with a lot of tablescans instead of using the right indexes.

Has anyone a similar problem? Also related to sp2? Is this a bug in sp2? Anyone a clue how to work around this? Help...

Does anyone know how to report this to Microsoft, since we don't have direct support from them, only via HP?

Kurt De Cauwsemaecker
Database Administrator
Telepolis Antwerpen
Belgium.

View 6 Replies View Related

SQL Major Help!

May 21, 2008

Hello,
I need some major help, I need to make a database using SQL server for a forum, now I am using pHpBB, but i need that database. I was thinking about it, it doesnt need to be complicated or anything. I really have no idea where to start so any help.
Thank you in advance

View 2 Replies View Related

Need Some MAJOR Help, PLEASE

Apr 8, 2007

I have a new business, and a part of that business includes receiving large amounts of data from time to time. I just found out yesterday that I'm going to be receiving about 1TB of data from an new client! I'm not set up at all for this large of a data set.

I want to use SQL Server as my database. Can I load SQL on a Desktop PC without having to buy a server? How?

I don't have a clue as to how I need to get set up for this data...hardware or software. Any advice you can give will be outstanding!!!!!

Thanks.

View 8 Replies View Related

Major DB Problems!!!

Jan 22, 2008

I have a site that was supposed to go live yesterday.I am using M$ SQL Express 2005 and the Express Manager.I setup everything using Windows authentication on my local computer.  I backed up the database through the manager and simply did a restore to the live database server.I copied my aspx files and everything else.I changed my connection string to allow for SQL Authentication (because I was having trouble with Windows authentication).For some reason, my SQL authenticated user can do whatever it wants within the SQL manager, but I am unable to login to the site.  I get no errors, just the usual failed login attempt text.Can someone please help.  I don't know where to start on this one.Thanks,Joshua Foulk 

View 6 Replies View Related

HELP! Major LDF Problem...

May 26, 2004

I hope I haven't messed up! I was importing some data, and it started taking too long and seemed to have locked up, I did a cold boot and when I tried to open the db it would just load...

I have then detached it and tried to reattach the db, but it seems to just load forever.. I let it sit there for an hour and still nothing...

the DB has a 17gig LDF file and I can't attach without it...

PLEASE HELP!

View 2 Replies View Related

Major Problem

Apr 7, 2008

For some reason when I'm trying to restore a back up, I'm encountering this problem, I've asked numerous people and been in and out of chatrooms all day and night, has anyone got any idea what to do?



/Sil

View 6 Replies View Related

Having A MAJOR Brain Fart Here...

Feb 18, 2007

Guys I'm sorry to be asking such a routine question...
I'm having trouble figuring out how to make this function dynamic enough to handle multiple insert statements.1 public int Add()
2
3 {
4
5 string SQL;
6
7 SQL = "INSERT INTO [BuildingInterior] (PropertyID, CeilingHeight, " +
8
9 "LoadingDocks, PassengerElevators, FreightElevators, PassengerEscalators, " +
10
11 "FireSprinklersID, SecurityCameras, SmokeDetection, FireAlarms, " +
12
13 "GasDetection, SecureAccess, HeatTypeID, AirConditioningID, " +
14
15 "AirExchange, InternetAccessID, InteriorDescription) " +
16
17 "VALUES ( @PropertyID, @CeilingHeight, " +
18
19 "@LoadingDocks, @PassengerElevators, @FreightElevators, @PassengerEscalators, " +
20
21 "@FireSprinklersID, @SecurityCameras, @SmokeDetection, @FireAlarms, " +
22
23 "@GasDetection, @SecureAccess, @HeatTypeID, @AirConditioningID, " +
24
25 "@AirExchange, @InternetAccessID, @InteriorDescription)";
26
27 PropertyDB myConnection = new PropertyDB();
28
29 SqlConnection conn = myConnection.GetOpenConnection();
30
31 SqlCommand cmd = new SqlCommand(SQL, conn);
32
33 cmd.Parameters.Add("@PropertyID", SqlDbType.Int).Value = PropertyID;
34
35 cmd.Parameters.Add("@CeilingHeight", SqlDbType.NVarChar, 50).Value = CeilingHeight;
36
37 cmd.Parameters.Add("@LoadingDocks", SqlDbType.NVarChar, 50).Value = LoadingDocks;
38
39 cmd.Parameters.Add("@PassengerElevators", SqlDbType.NVarChar, 50).Value = PassengerElevators;
40
41 cmd.Parameters.Add("@FreightElevators", SqlDbType.NVarChar, 50).Value = FreightElevators;
42
43 cmd.Parameters.Add("@PassengerEscalators", SqlDbType.NVarChar, 50).Value = PassengerEscalators;
44
45 cmd.Parameters.Add("@FireSprinklersID", SqlDbType.Int).Value = FireSprinklersID;
46
47 cmd.Parameters.Add("@SecurityCameras", SqlDbType.NVarChar, 50).Value = SecurityCameras;
48
49 cmd.Parameters.Add("@SecurityAlarms", SqlDbType.NVarChar, 50).Value = SecurityAlarms;
50
51 cmd.Parameters.Add("@SmokeDetection", SqlDbType.NVarChar, 50).Value = SmokeDetection;
52
53 cmd.Parameters.Add("@FireAlarms", SqlDbType.NVarChar, 50).Value = FireAlarms;
54
55 cmd.Parameters.Add("@GasDetection", SqlDbType.NVarChar, 50).Value = GasDetection;
56
57 cmd.Parameters.Add("@SecureAccess", SqlDbType.NVarChar, 50).Value = SecureAccess;
58
59 cmd.Parameters.Add("@HeatTypeID", SqlDbType.Int).Value = HeatTypeID;
60
61 cmd.Parameters.Add("@AirConditioningID", SqlDbType.Int).Value = AirConditioningID;
62
63 cmd.Parameters.Add("@AirExchange", SqlDbType.NVarChar, 50).Value = AirExchange;
64
65 cmd.Parameters.Add("@InternetAccessID", SqlDbType.Int).Value = InternetAccessID;
66
67 cmd.Parameters.Add("@InteriorDescription", SqlDbType.NVarChar, 50).Value = InteriorDescription;
68
69 cmd.ExecuteNonQuery();
70
71 cmd.CommandText = "SELECT @@IDENTITY";
72
73 this.BuildingInteriorID = Int32.Parse(cmd.ExecuteScalar().ToString());
74
75 conn.Close();
76
77 return this.BuildingInteriorID;
78
79 }
80

 Should I just pass an array of column names and use the AddWithValues SqlCommand method while looping through the array?
Any comments are greatly welcomed.

View 2 Replies View Related

Major Difference Between Sp And Trigger

Dec 2, 2006

hi
stored procedure and trigger which runs on serverside and which runs on client side.

View 1 Replies View Related

Major Time Out Issue

Mar 27, 2007

I have created a database with three tables. The database has been up for a month now and contains about 20,000 records. In order to improve performance and resolve some issues I an attempting to change some of the table information. i.e. allow nulls in a few fields. When I use TSQL or the GUI to make these changes I get the following error: Timeout expired. The timeout period elapsed prior to completion of the operation or server not responding.

Source: .Net SQLClient Data Provider



I have SQL Server Express SP2 installed with .Net framework v3.0



Note: This issue appears when I attempt to delete a row from a table as well.



Any thoughts?

View 1 Replies View Related

Simple Report, Major Problem

Apr 13, 2008



I have a report with a table and three columns. Whenever the data in one of the columns cannot fit on a single page it continues on the next page BUT, there is no header on the next page and the data in the other two columns repeats itself on the next page. (This behavior happens when I export to PDF)


Is this a known issue? I have tried every setting I could think of.

Thanks

View 7 Replies View Related

Y Axis Labels, Major Gridline

Jul 5, 2006

I have a horizontal barchart with integer values, both positive and negative. Major gridlines are shown and I have not specified the interval or the label format. Sometimes the gridline labels (Y axis) show decimal values. Is there anyway to format these? I have tried to format the labels as "#0" but then I see labels occuring twice. I have also played with the intervals, but then sometimes, depending on the values, the zero line is not being shown.

Does anybody have an idea?

Thanks in advance!

Joos

View 4 Replies View Related

Reporting Services X64 Major Problem

Mar 13, 2007

Hi,
We have a product that is developed in ASP and works with SQL Server 2000 or 2005. Since it€™s an ERP, we also use Reporting Services 2000 or 2005. Our application needs 3 registered DLLs that were, a long time ago, developed to support our entire application.
Since we are using Windows Server 2003 x64 editions in our clients with SQL Server 2005 x64 edition, we managed to register the 32 bit DLLs in the 64 bit system. We installed them as a COM+ component, ran the command €œcscript.exe adsutil.vbs set W3SVC/AppPools/Enable32BitAppOnWin64 true€? and our application worked fine.
This command caused the IIS to use the .NET 2.0 32 bit version so that our DLLs could be correctly invoked.
But now Reporting Services doesn€™t work because it needs the 64 bit version of the .Net framework. When I try to connhecto to localhost/reports, I get the error "%1 is not a valid Win32 application".
Is there any workaround to this problem so that i can deploy the application and the database in the same machine?

View 1 Replies View Related

Major Problem With @@IDENTITY, Treeview And GUID

Nov 14, 2004

Hi,

I'm trying to insert data into locally stored database (SQL Server).
The data I want inserted, is presented in a Treeview control and the data is fetched from a Webservice. The data is returned in form of a dataset.
The treeview contains checkboxes allowing a user to select what to install in the locally stored database.

To sum up:


1. Get data from a webservice' not my problem
2. Present data in a Treview control' not my problem
3. Allow to user to select which data to install' not my problem
4. Insert data that the user has selected into my db' MY PROBLEM!!!!


The Treeview looks like this.

- Group1
| | ---- Rule1.1
| | ---- Rule1.2
|
- Group2
| | ---- Rule2.1
| | ---- Rule2.2
| | ---- Rule2.3

.....


The Treeview is generated with DataRelations between Group and Rule.

My locally stored database is designed by a third party provider and therefore the database must not be altered.
The table I want to store data in is called "Groups" and it looks like this:


GroupID uniqueidentifier ' (newid())
GroupName nvarchar(50)
ParentGroupID uniqueidentifier' if grouptype = 0 then ParentGroupID must have a value.
GroupType tinyint ' 0 = subgroup, 1 = "top"group

Data in the table "Groups" would look like this:

GroupID GroupNameParentGroupIDGroupType
---------------------------------------------------------
{000001...}Group1<NULL>1
{000011...}Rule1.1{000001...}0
{000012...}Rule1.2{000001...}0
{000002...}Group2<NULL>1
{000021...}Rule2.1{000002...}0
{000022...}Rule2.2{000002...}0
{000023...}Rule2.3{000002...}0



The third party also created a stored procedure called pr_AddGroup taking the following parameters:

@GroupName ' can be both the RuleName and the GroupName
@GroupType ' can be 0 for subgroup or 1 for "top"group
@ParentGroup ' GUID


The problem with this stored procedure is that it does not have return value, which is here my problem actually lies.
If it returned @@IDENTITY I could use this as the parameter for @ParentGroup.
Instead I figure I must create two sqlCommand's (one calling pr_AddGroup and another calling SELECT @@IDENTITY to get the newly created record).

My SQL Commands look like this

Dim cmd As SqlCommand
Dim Conn As SqlConnection = New SqlConnection
Conn.ConnectionString = "Data Source=myServer;Initial Catalog=myTable;Integrated Security=SSPI"
cmd = New SqlCommand
cmd.CommandType = CommandType.StoredProcedure
cmd.Connection = Conn
cmd.CommandText = "pr_AddGroup"

cmd.Parameters.Add(New SqlParameter("@GroupName", SqlDbType.NVarChar, 50, ParameterDirection.Input))
cmd.Parameters.Add(New SqlParameter("@GroupType", SqlDbType.TinyInt, ParameterDirection.Input))
cmd.Parameters.Add(New SqlParameter("@ParentGroup", SqlDbType.UniqueIdentifier, ParameterDirection.Input))

dim cmd2 as SqlCommand
cmd2 = new SqlCommand
cmd2.commandtype = commandtype.Text
cmd2.commandtext = "SELECT @@IDENTITY as ID FROM Groups"
cmd2.connection = Conn

dim ParentGroupGUID as system.guid


To get the data inserted in the Groups table I would something like the following, but the code is very ugly
(and it doesn't work either);

For Each Group In TreeView1.Nodes ' Loop through Groups
If Group.Checked Then
cmd.Parameters("@GroupName").Value = Group.Text.ToString
cmd.Parameters("@GroupType").Value = 1

cmd.ExecuteNonQuery()
ParentGroupGUID = cmd2.executescalar()

End If

For Each Rule In Group.Nodes ' Loop through Rules.
If Rule.Checked Then
cmd.Parameters("@GroupName").Value = Group.Text.ToString
cmd.Parameters("@GroupType").Value = 1
cmd.Parameters("@ParentGroup").value = ParentGroupGUID
cmd.ExecuteNonquery()
End If
Next
Next


I've spent the last 5 hours figuring out this problem, so ANY help is appreciated :-)

View 3 Replies View Related

Having Major Problems With My Insert Query Logic

Aug 20, 2004

I have a perl program that is looping through a hash of a hash. I need to Update any existing records but also insert any new records in the table using collected data in the hash.

Life would be very simple if it was possible to use a Where Clause in an Insert statement but not does not work.

Here is some example code from my program:
sub Test{
foreach my $table(keys %$HoH){
foreach my $field(keys %{$HoH->{$table}}){
if($table eq "CPU"){
my $CPUstatement = "INSERT INTO CPU(CPUNumber, Name, MaxClockSpeed, SystemNetName)
Values ('$field',
'$HoH->{CPU}{$field}{Name}',
'$HoH->{CPU}{$field}{MaxClockSpeed}' ,
'$HoH->{Host}{SystemNetName}')";
print "$CPUstatement";
if ($db->Sql($CPUstatement))
{
print "Error on SQL Statement";
Win32::ODBC::DumpError();
}
else
{
print "successful";
}
}
}


}
}

Thanks,
Laura

View 5 Replies View Related

SqlServer 2000 Enterprise Manager - Major Bug?

Jul 20, 2005

I had a problem today where I could not see column names and alltables had a _1 after them when viewing a Sql Server view inEnterprise Managere.g.TableName Company when added to the view would be named Company_1 andthe only columns available were 1 which was *(All Columns)After looking through the news groups I saw several occurrences ofthis problem but no answers that gave a fixAfter some investigation I found that it is caused when the databasename in SqlServer has a . in it!Test1 >> Fine the view designer works fineTest1.6 >> Problems as listed aboveI don't see why Enterprise Manager allows database names with .'s ifit is going to create such problems.

View 1 Replies View Related

Sql2005 Database Restore From Another Sql2005 Backup File Error.

Dec 15, 2005

hi

i try to restore a bak file from another sql2005 server to my sql2005 server, but it show the error message as below :

 

 

TITLE: Microsoft SQL Server Management Studio Express
------------------------------

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.Express.ConnectionInfo)

------------------------------
ADDITIONAL INFORMATION:

Cannot open backup device 'C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLBackupackup.bak'. Operating system error 5(error not found).
RESTORE HEADERONLY is terminating abnormally. (Microsoft SQL Server, Error: 3201)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.1399&EvtSrc=MSSQLServer&EvtID=3201&LinkId=20476

------------------------------
BUTTONS:

OK
------------------------------


 

 

 

pls some one can help me ???

 

thanks

chaus

View 62 Replies View Related

Major Query Optimiser Weirdness With UDFs And SPs On SQL 2000

Jul 20, 2005

There is something very strange going on here. Tested with ADO 2.7 andMSDE/2000. At first, things look quite sensible.You have a simple SQL query, let's sayselect * from mytab where col1 = 1234Now, let's write a simple VB program to do this query back to anMSDE/2000 database on our local machine. Effectively, we'llrs.open sSQLrs.closeand do that 1,000 times. We wont bother fetching the result set, itisn't important in this example.No problem. On my machine this takes around 1.6 seconds and modifyingthe code so that the column value in the where clause changes eachtime (i.e col1 = nnnn), doesn't make a substantial difference to thistime. Well, that all seems reasonable, so moving right along...Now we do it with a stored procedurecreate procedure proctest(@id int)asselect * from mytab where col1 = @idand we now find that executingproctest nnnn1,000 times takes around 1.6 seconds whether or not the argumentchanges. So far so good. No obvious saving, but then we wouldn'texpect any. The query is very simple, after all.Well, get to the point!Now create a table-returning UDFcreate function functest(@id int) returns table asreturn(select * from mytab where col1 = @id)try calling that 1,000 times asselect * from functest(nnnn)and we get around 5.5 seconds on my machine if the argument changes,otherwise 1.6 seconds if it remains the same for each call.Hmm, looks like the query plan is discarded if the argument changes.Well, that's fair enough I guess. UDFs might well be more expensive...gotta be careful about using them. It's odd that discarding the queryplan seems to be SO expensive, but hey, waddya expect?. (perhaps theUDF is completely rebuilt, who knows)last test, then. Create an SP that calls the UDFcreate procedure proctest1(@id int)asselect * from functest(@id)Ok, here's the $64,000 question. How long will this take if @idchanges each time. The raw UDF took 5.5 seconds, remember, so thisshould be slightly slower.But... IT IS NOT.. It takes 1.6 seconds whether or not @id changes.Somehow, the UDF becomes FOUR TIMES more efficient when wrapped in anSP.My theory, which I stress is not entirely scientific, goes somethinglike this:-I deduce that SQL Server decides to reuse the query plan in thiscircumstance but does NOT when the UDF is called directly. This iscounter-intuitive but it may be because SQL Server's query parser istuned for conventional SQL i.e it can saywell, I've gotselect * from mytab WHERE [something or other]and now I've gotselect * from mytab WHERE [something else]so I can probably re-use the query plan from last time. (I don't knowif it is this clever, but it does seem to know when twotextually-different queries have some degree of commonality)Whereas withselect * from UDF(arg1)andselect * from UDF(arg2)it goes... hmm, mebbe not.... I better not risk it.But withsp_something arg1andsp_something arg2it goes... yup, i'll just go call it... and because the SP was alreadycompiled, the internal call to the UDF already has a query plan.Anyway, that's the theory. For more complex UDFs, by the way, theperformance increase can be a lot more substantial. On a big complexUDF with a bunch of joins, I measured a tenfold increase inperformance just by wrapping it in an SP, as above.Obviously, wrapping a UDF in an SP isn't generally a good thing; theidea of UDFs is to allow the column list and where clause to filterthe rowset of the UDF, but if you are repeatedly calling the UDF withthe same where clause and column list, this will make it a *lot*faster.

View 3 Replies View Related

Ssis Security Short Coming, Major Issues

Jan 6, 2006

Hello,

I feel like ssis encryption model has a serious flaw. Especially when linked to SQL Agent jobs.

I have posted and others have posted messages about this. Something is plain wrong with ssis encryption keys and password protection. Also, you do not have the choice not to protect the packages. In my case, protecting packages is completely useless.

Here is the story.

After this post

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=131340&SiteID=1&mode=1

I created config files for al my packages connections passswords.

Now, by our IT Policy, I had to change again my password and of course, all packages now return multiple errors when I open them.

Hopefully, the config file did its job and the packages are ran anyways by SQL Agent, however, having to manually retype and resave all packages not to have the errors is just a plain hassle. Not to speak about people not using the config files and the correct "Run As" sql agent account.

I stress the fact that in a real world production environment all packages are driven by SQL Agent jobs and MUST run automatically.

Here is the error I get after opening a package after changing my password:

Error 1 Error loading Constants05.dtsx: Failed to decrypt protected XML node "DTS:Password" with error 0x8009000B "Key not valid for use in specified state.". You may not be authorized to access this information. This error occurs when there is a cryptographic error. Verify that the correct key is available.   c:projectsssis packagesssis constantsConstants05.dtsx 1 1 

So Why is'nt this key automatically adjusted after Windows NT Domain password Change?

How can I refresh the key, not to have to reype all the packages connections passwords and rebuilding, Checkin-in again all the stuff?

I do not think the solution is "Use an application account which password never changes when you create your ssis packages" however at this time, this is the only solution I can think of.

How do you guys deal with this problem?

I still do not understand the ssis security model I feel it is diconnected from the reality and unpracticable in a production environment like mine.

Thanks

Philippe

View 17 Replies View Related

Can You Open A Database Created In SQL2005 In SQL2005 Express?

Oct 12, 2007



Can you open/use a database created in SQL2005 in SQL2005 Express?

Thanks for the help!

Max

View 4 Replies View Related

Major Problem With REPLACE-expression In The Derived Column Transformation

Apr 26, 2006

I'm importing a csv-file delimited with semicolons. Firstly I LTRIM the columns "in place" and the data imports fine. All the numbers in right columns in the target table. Then I add another Derived Colum Transformation to replace decimal character comma (,) to a dot (.) in order to convert the string/varchar value to numeric. But here I run into trouble. Running the task ends in success but the result in the target table (same as above) is not. All the commas are now dots as expected but what is worse is that SSIS have added values in cells that should not be there. I get values in cells that shoud be empty!

Shortly: Only LTRIM([Column1]) as expression and "Derived Column" as Replace 'Column1' works OK.

But adding REPLACE-expression (i.e REPLACE(LTRIM([Column1]) , "," , ".") to this breaks things up

I'm aware that I could do this with SQL but this is not the point...

Any ideas?

BR Jompe

View 6 Replies View Related

Upgraded SQL2000 To SQL2005, SQL2005 VERY Slow

Dec 27, 2005

I just upgraded my SQL 2000 server to SQL2005. I forked out all that money, and now it takes 4~5 seconds for a webpage to load. You can see for yourself. It's pathetic. When I ran SQL2000, i was getting instant results on any webpage. I can't find any tool to optimize the tables or databases. And when I used caused SQL Server to use 100% cpu and 500+MB of ram. I can't have this.Can anyone give me some tips as to why SQL 2005 is so slow?

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved