Some Things Not Working In 2005 And Working In 2000

Mar 3, 2006

hi

I had a view in which I did something like this
isnull(fld,val) as 'alias'

when I assign a value to this in the client (vb 6.0) it works ok in sql2000 but fails in 2005.
When I change the query to fld as 'alias' then it works ok in sql 2005 .
why ?? I still have sql 2000 (8.0) compatability.

Also some queries which are pretty badly written run on sql 2000 but dont run at all in sql 2005 ???

any clues or answers ?? it is some configuration issue ?

Thanks in advance.

View 5 Replies


ADVERTISEMENT

Bit-data From SQL Server 2000 (2005 Working, 2000 Doesn't)

May 19, 2008

 Hi, I am trying to edit some data from a SQL2000-datasource in ASP.NET 2.0 and have a problem with a column that has bit-data and is used for selection. SQL2005 works fine when declaring             <SelectParameters>                <asp:Parameter DefaultValue="TRUE" Name="APL" Type="boolean" />            </SelectParameters>When running this code with SQL2000, there are no error-msgs, but after editing a record the "APL"-column looses its value of 1 and is set to 0. Looks like an issue with type-conversion, we've hit incompatibilities between SQL200 and 2005 with bit/boolean several times before. So, how is this done correctly with SQL2000?  (I've tried setting the Type to "int16" -> err. Also setting Defval="1" gave an err) ThanksMichael   

View 2 Replies View Related

2000 &> 2005 And Xp_cmdshell Stopped Working!

Jun 18, 2008

Hi,

I'm just moving over one of our databases from SQL2000 to 2005. Everything is working fine, and all web sites are working, however I just can't seem to get xp_cmdshell to function on the 2005 server.

I have enabled xp_cmdshell, and when I run a stored procedure, which writes the contents of one column to a text file, it says "invalid object name". This table is definitely there, and is actually updated earlier on in the same SP, so permissions for that are fine.

This is the line causing the problem (if I take it out, the rest of the SP works no problems):

--write the text file
EXEC master.sys.xp_cmdshell 'bcp "SELECT newslettertext FROM mydatabase.dbo.newsletters" queryout D:ewslettertext extbody.txt -U -P -c'


Error = [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'mydatabase.dbo.newsletters'.

SQLState = 37000, NativeError = 8180
Error = [Microsoft][ODBC SQL Server Driver][SQL Server]Statement(s) could not be prepared.
NULL

Could it be to do with permissions on the master.sys.xp_cmdshell? If so, wouldn't it give me a "permission denied" error?

Any help would be greatly appreciated!

Thanks

View 6 Replies View Related

Query Working Fine On 2000 But Not On 2005

Apr 25, 2008

Hello to all,

if have a problem with a SELECT query that works very fine on SQL Server 2000 but not on 2005. I've transfered my db by creating a full backup and restoring the db on 2005. The db is working except this problem.

When i start executing it doesn't finish. I waited a couple of minutes. On 2000 it only takes about 6 seconds to run.

Here it is:







Code Snippet

SELECT * FROM PPS_TERMbesttmpwhere PPS_TermBestTmp.BestNr + CONVERT(varchar(30),CAST(REPLACE(PPS_TermBestTmp.Pos1, ',', '.') AS float),2)



NOT IN (SELECT PPS_TermBest.BestNr + CONVERT(varchar(30), PPS_TermBest.Pos1,2) FROM PPS_TermBest)
Any ideas?

Thanx

Alex

View 7 Replies View Related

Working With SQL 2005 Interface But Internally It Works As SQL 2000

Aug 27, 2007

Hi! I have installed SQL 2000 and SQL 2005 in my computer.I tried to use some new features like row_number(),try..catch.. but are not working giving syntax error.� So someone told me that i had to check the version and when I cheked I realized I was working with SQL 2000: “Microsoft SQL Server 2000 - 8.00.194 (Intel X86) Aug 6 2000 00:57:48 Copyright (c) 1988-2000 Microsoft Corporation Developer Edition on Windows NT 5.1 (Build 2600: Service Pack 2)� So, how can I change it for working with SQL 2005?. It’s like I’m working with SQL 2005 interface but internally it works as SQL 2000. Can you help me please?

View 2 Replies View Related

Database Conversion From SQL Server 2005 To 2000 Is Not Working

Aug 1, 2006

hello friends,
i am facing a problem in SQL Server 2005 Express Edition. The database created in the SQL Server 2005 Express is when opened in SQL Server 2000, it changes the data type of all the columns of all the table to text type. can anybody help me?

View 4 Replies View Related

Working With SQL 2005 Interface But Internally It Works As SQL 2000

Aug 27, 2007

Hi!

I have installed SQL 2000 and SQL 2005 in my computer. But none of 2005 feature is working. So someone told me that i had to check the version and when I cheked I realized I was working with SQL 2000:
€œMicrosoft SQL Server 2000 - 8.00.194 (Intel X86)
Aug 6 2000 00:57:48
Copyright (c) 1988-2000 Microsoft Corporation
Developer Edition on Windows NT 5.1 (Build 2600: Service Pack 2)€?

So, how can I change it for working with SQL 2005?. It€™s like I€™m working with SQL 2005 interface but internally it works as SQL 2000. Can you help me please?

View 1 Replies View Related

Keyboard Not Working (backspace And Arrow Keys) When Viewing 2000 DTS Packages From 2005 (backward Compatibility)

May 4, 2006

I know my problem is not directly associated w/ SSIS, so please forgive the post here. I figured this would be the "most" appropriate place to post this challenge.

We're attempting to edit a 2000 DTS package in Design mode from within the 2005 SQL Management Studio. To do this we downloaded/installed the following packages from the MS download site:

Microsoft SQL Server 2000 DTS Designer Components
Microsoft SQL Server 2005 Backward Compatibility Components

We're able to open the package in design mode from the Management Studio (Server > Management > Legacy > Data Transformation Services > DTS Package Name). But, when the DTS designer is open, the backspace and arrow keys won't respond in the Management Studio. They begin responding when we close the DTS designer. There are no error messages when we close the DTS designer.

Does anyone know of a fix or a workaround? Any help would be greatly appreciated.

Thanks, Mike

View 7 Replies View Related

SQL Server 2000 + 2005 Working On Same Windows 2003 Server As Seperate Instances

Nov 20, 2006

Hi all,I just asked some people to help me out and phone microsoft with thefollowing information, kindly they refused unless we setup a supportcontract with them first, for pre-sales information. (That really doesnot sound like good business sense to me - anyway here is our problem,if anyone could help thanks)."To tell and ask microsoft:We will be setting up a microsoft sql server 2000 instance running on awindows 2003 server.1) We need to check this can run alongside a microsoft 2003 sql server(either workgroup or standard edition), on the same machine. Are thereany .dll clashes if we do this? If there are can we run SQL Server2000, in a virtual machine running windows 2000 professional. (I have alicenced copy we can use for this).2) If we run one instance of 2000, and one of 2003 of the sql servers,can one use the processor licence model, and one use the CAL licencemodel."Thanks for any help, and any idea why they actually force you to usenews groups for pre-sales information?David

View 4 Replies View Related

ExecuteNonQuery - Add Working/Update Not Working

Jan 7, 2004

I am writing a pgm that attaches to a SQL Server database. I have an Add stored procedure and an Update stored procedure. The two are almost identical, except for a couple parameters. However, the Add function works and the Update does not. Can anyone see why? I can't seem to find what the problem is...

This was my test:


Dim cmd As New SqlCommand("pContact_Update", cn)
'Dim cmd As New SqlCommand("pContact_Add", cn)

Try
cmd.CommandType = CommandType.StoredProcedure

cmd.Parameters.Add("@UserId", SqlDbType.VarChar).Value = UserId
cmd.Parameters.Add("@FirstName", SqlDbType.VarChar).Value = TextBox1.Text
[...etc more parameters...]
cmd.Parameters.Add("@Id", SqlDbType.VarChar).Value = ContactId

cn.Open()
cmd.ExecuteNonQuery()

Label1.Text = "done"
cn.Close()

Catch ex As Exception
Label1.Text = ex.Message
End Try


When I use the Add procedure, a record is added correctly and I receive the "done" message. When I use the Update procedure, the record is not updated, but I still receive the "done" message.

I have looked at the stored procedures and the syntax is correct according to SQL Server.

Please I would appreciate any advice...

View 2 Replies View Related

-delbkups Not Working For SQL 2000

Jan 8, 2004

Hello,

In our maintenance plan for SQL Server 2000, we are performing full backups which in turn has their retention setting to 2 days. Unfortunately, it appears that this option is not working. Has anybody else seen this? We are running on Windows 2000 Advanced Server.

-LIONSPARC

View 5 Replies View Related

Microsoft SQL SERVER 2000 Not Working!!!

May 7, 2004

I'm unable to gain connectivity to two stand- alone PC's having WIN XP PROFESSIONAL, v. 2002, through Microsoft SQL SERVER 2000. :eek:

Both the PC's are stand-alone and have both have WIN XP PROF. I installed Microsoft SQL SERVER 2000 in which only the Client Components were successfully installed.

I have the Administrator Rights on both the PC's.

The Problem on both the PC's that I'm facing is as follows:-

On starting SQL Server Enterprise Manager, the PC was not detected as a Server under the SQL Server Group, and thus I selected the option 'New SQL Server Registration', then I gave my full computer name (as appears in the properties of 'my computer'), selected Windows Authentication and then selected OK to start or connect.

It did not connect and then I got the following error message:

-------------------------------------------
A connection could not be established to 'COMPUTER NAME'.

Reason: SQL Server does not exist or access denied.

ConnectionOpen(Connect())

Please verify SQL Server is running and check your SQL Server registration property (by right click on the COMPUTER NAME_node) and try again.


OK

-------------------------------------------


On starting the SQL Query Analyzer, firstly the message connecting to 'COMPUTER NAME' was seen and then it also gave the following error message:

-------------------------------------------
Unable to connect to server 'COMPUTER NAME':

Server: Msg 17, Level 16, State 1

[Microsoft][ODBC SQL Server Driver][Shared Memory] SQL Server does not exist or access denied.


OK

-------------------------------------------

where the 'COMPUTER NAME' stands for the name of the particular system that can be seen in System Properties-> Computer Name-> Full computer name.

I had installed the MDAC Components from the Windows Update website.

I checked the registration properties and have tried many times but everytime the same error messages were received in both the systems and all the efforts bore no fruits.

Both the systems are:
Intel P4
WINXP PROF. v2002
128MB DDR RAM
40 GB HDD

Please help soon as I am studying SQL Server!

THANKS. ;)

View 14 Replies View Related

View Not Working SQLSERVER 2000

Jul 20, 2005

Hi allWe have some tables with a couple of layers of very simple views built ontop. In the table are maybe 6 columns and about 15000 records. The firstview cobines the data in the table with some other data from a lookuptable. The second view does some sorting on the first view using certaindates . They have worked fine for well over a year now.Until this morning that is... the views stopped returning the full set ofresults- even the very simple one that sits just above the table. The viewreturned the core of the data from the main table, but nothing from thelookup table.In order to get them to work we had to delete each view (using access frontend to do this), and then recreate it with exactly the same SQL text. I amguessing this causes SQL Server to recompile it. As soon as view 1 had beenrecreated it worked, but view 2 still failed, again rebuilding view 2 itstarted working.The only thing I can think of is that this morning I added 2 new fields tothe base table, but I'm sure I've done this before without any (noticable)problems.any thoughts as to why it happened would be welcome, I am a bit nervousnow...thanksAndy

View 5 Replies View Related

Remote SQL Server 2000 Perfmon Not Working

Jun 22, 2007

I have a SQL Server 2000 cluster running on x64 OS. I found the threads in the forum to run perfmon locally by using the x86 version of perfmon (mmc /32 perfmon). However, I cannot run a perfmon remotely from another machine and see the SQL Server perfmon data on any of the nodes in the cluster. The remote perfmon picks up all of the other perfmon variables but no SQL.

I found another thread where somebody asked this question but it wasn't answered. Thanks in advance.



Mark

View 4 Replies View Related

Help Needed Urgent. Delete Is Not Working MFC And MS SQL Server 2000

Jul 21, 2004

Hi

if i try to delete data via MFC from Microsofts SQL Server 2000
i get following message: Data can be read only.. Weird i can write and read already. do i have to setup anything in Micrsofts SQL Server 2000 ??

please help its urgent.

Greets
Indian

View 1 Replies View Related

Service Broker Not Working For Restored Databases (SQL 2000 Databases Restored On 2005)

Jan 24, 2006

I just restored my SQL server 2000 database on the SQL server 2005. after this i ran the Service broker sample ("Hello World") on this database by changing the AdventureWorks name to the new database name. The "setup.sql" runs fine. When i run the "SendMessage.sql" i was not getting any rows in the output (The message was not getting inserted into the queue). I checked the Service broker is enabled on this databased using the query "select is_broker_enabled from sys.databases where name = 'newdbname' " It was 1. I even tried the ALTER DATABASE SET ENABLE_BROKER. but it didnt work.

When i tried the sample on a newly created database it worked fine.

Is there any solution to make the restored database to work for service broker.

Thanks

Prashanth

View 3 Replies View Related

Working In A Stored Procedure's Result Set In MSSQL 2000 (eg.: Selecting From)

Mar 4, 2004

Hy all.
My main goal would be to create some kind of map of the database, wich contains information of all connecting fields, including wich fields has key references to the other one and wich table. I'd like to have a table wich shows all the database connections tablename, field, field/table_key (from or to the key points), field_key_type (prymary or foreign)
So I thaugh to get sp_fkeys and sp_pkeys from master table and inner joining their results, but I simplay cannot "catch" their result sets. The script must have been written in SQL.
Obviously I'd like to do this:
SELECT * FROM EXEC sp_fkeys @table_name = 'xy'
of course it is not working this way, but I'd like something like this.


Please help! Thanx!

View 3 Replies View Related

IS ASP.Net 1.x Working Together With SQL 2005?

Feb 9, 2007

Hi
Should ASP.Net 1.x work togheter with sql 2005 without problems? I have try to open a web project but I got the following error:
Cannot open database "crm" requested by the login. The login failed. Login failed for user 'crmuser'.
This crmuser is "promoted" to owner of the crm base, but still I got the problem.
I upgrade this web project to ASP.Net 2.0 and I don't have the login problems, that's why I'm wondring.
Hope someone can answear me on this question. Thanks!
Jan

View 3 Replies View Related

Working In VB.Net 2005 Inserting NULL Into A Field In Microsoft SQL Server 2005

Feb 2, 2007

I am update/inserting records threw a web form in vb.net. I need to insert 'NULL'  into my microsoft sql server database.  I am not talking about the below line of code where website is the name of my paramater.  If i do that it will just place a blank into that field in the database.  If i dont enter anything into that textbox I want it to to say NULL in that field. So if I go into the actual table in the SQL Server Management Studio and look at the website field of the recored I just added or updated and did not type anything into the web site textbox it needs to say NULL.  I also tried the second line of code but that places a single quote in front and behind NULL. So the field will have the value 'NULL'.
website.value = txtwebsite.text.tostirng
 if txtwebsite.text ="" then
   website.value ="NULL"
end if
The reason why I need the NULL there is because I bind the website filed to a hyperlink template in a gridview.  The actual text of the hyperlink is bound to PAYER which is a name of a insurance payer but the navigateto is bound to the website field.  If i do not enter any data into the website field and it stays as NULL, then when my gridview is loaded, payers that dont have a website will not be underlined and user wont have the option to click on them since there is no value for the navigateto.  But if i use my form to update/add a payer and leave the website textbox blank in puts a blank into that field in my database and when it loads that new row into the gridview the PAYER is underlined and u can click on it but it will just take u to the web site is unavailable page.  So is there anyway to actaull have NULL placed into a filed and not just blank space

View 3 Replies View Related

MODULUS Not Working In SQL 2005

May 13, 2008

I have the code below to text. Unfortunately, the result I keep getting when I run my query does not make sense to me. Can anyone please help me ? Thanks in advance
 DECLARE @TOtalPoints AS INTEGER
DECLARE @TOtalPointsFinal AS INTEGER
SET @TOtalPoints = CONVERT( INTEGER, (SELECT COALESCE(SUM(AMOUNT),0)
FROM Transactions WHERE USERID = 4337011
AND Amount < 20 AND UPPER([Status]) ='SUCCESS' ))
SELECT @TOtalPointsFinal = @TotalPoints%(CONVERT(INTEGER, 20))
PRINT @TOtalPoints
PRINT @TOtalPointsFinal
 
 
QUERY OUTPUT MESSAGE
 
17
17

View 3 Replies View Related

Parser Not Working In 2005

Jun 1, 2007

When I'm in query analyzer writing a stored procedure, if I make a mistake it will frequently go on and create the procedure without any warnings...I am on 9.00.3042.00, developer edition when this happens.



i.e., i had a stored procedure that had input parameters, and I declared a parameter @xyz nvarchar=NULL. It created the stored procedure anyway, and parsed it correctly as well. In fact, clicking the little 'parse' checkmark doesn't appear to do anything at all...



I didn't find out about my error until I ran the script in a 2000 database.



Is this a known defect? Will there be a patch? Is there a setting I don't yet know about to fix this?

View 2 Replies View Related

UsedInQuery Working In 2005 RDL?

Jan 29, 2007

When supporting interactive grouping in reports using an execution snapshot, In 2000 I used:

<UsedInQuery>False</UsedInQuery>  in the RDL below the appopriate Report Paramater names as well as using stored procedure based reports with Prompts set to certain paramaters. These prompted parameters would still show up after an excecution snapshot was run with default parameters. The UsedInQuery was just used to determine if it would rerun vs database or not.

 

I'm trying to do the same in 2005 but can't seem to get it to work anymore.

Per books online:

"The UsedInQuery element must contain one of the following string values:

True
False
Auto

You use the UsedInQuery to determine whether queries containing parameters that are associated with the report parameter are executed if the report parameter changes. This impacts whether the parameter can be changed in snapshot reports. Setting the value to Auto indicates that the report server attempts to detect whether the parameter is used in a query. "

 

Any suggestions on how to get interactive grouping to work with execution snapshots based on stored procedure reports in 2005? In 2005, the prompt Parameters are showing up as not enabled even though I've used false for UsedInQuery when I base the report from stored proc. It looks like they may work if the report is not based off of a store proc. I'll continue to test the query side to confirm the problem is only with stored proc based reports. Thanks!

View 2 Replies View Related

SQL 2005 X64 Working Set Error

Apr 7, 2008

I have the same error occuring each day at the same exact time on my mirror server. I looked online, and there are tons of references online to people having this issue, but not so many with resolutions. The server is identical to its Primary server in every aspect. It has the same patches, same exact hardware, it was originally going to be a cluster until some other issues turned it into a mirror set, and the Primary doesn't have this issue, just the mirror which is why it doesn't make sense.

Everyday between 17:56:30 and 17:58:30 I get this error

Date 4/6/2008 5:57:56 PM
Log SQL Server (Current - 4/7/2008 12:00:00 AM)
Source spid1s
Message
A significant part of sql server process memory has been paged out. This may result in a performance degradation. Duration: 2361601 seconds. Working set (KB): 147436, committed (KB): 461280, memory utilization: 31%.

There is no plausible reason for this to occur on this particular server and not on the Primary which is doing all the work. I read the blog on PSS about this, as well as some of the MVP blogs. Is there anything else I can look at for this? Some of the existing references I have looked at are below.

http://msmvps.com/blogs/omar/archive/2007/09/19/a-significant-part-of-sql-server-process-memory-has-been-paged-out-this-may-result-in-performance-degradation.aspx
http://blogs.msdn.com/psssql/archive/2007/05/31/the-sql-server-working-set-message.aspx

http://support.microsoft.com/kb/918483/en-us
No matter what I do the problem persists. I gave up on this a while back since it was a mirror only, and I was busy working on other projects, but now that I have a bit of time to look at it again I am going to. Any one got any ideas?

View 8 Replies View Related

Sorts Not Working In SQL Server 2005

Aug 23, 2007

I wrote some views in sql2000 and all was well. I upgraded to sql 2005 and non of the order by clauses work when I run the views directly. If I open the view up in desing mode and run them, they work.
Any Ideas?
Thanks,
Rick

View 9 Replies View Related

New 2005 Syntax With - Update Not Working

Oct 26, 2007

I have tried the following, the update part i snot working. Any idea why? alter PROCEDURE dbo.SP_FeaturedClassifieds
@PageIndex INT,
@NumRows INT,
@FeaturedClassifiedsCount INT OUTPUT
 
AS
BEGIN
select @FeaturedClassifiedsCount = (Select Count(*) From classifieds_Ads Where AdStatus=100 And Adlevel=50 )
Declare @startRowIndex INT;
Set @startRowIndex = (@PageIndex * @NumRows) + 1;
 
With FeaturedClassifieds as (Select ROW_NUMBER() OVER (Order By FeaturedDisplayedCount * (1-(Weight-1)/100) ASC) as
Row, Id, PreviewImageId, Title, DateCreated, FeaturedDisplayedCountFrom
classifieds_Ads
WhereAdStatus=100 And AdLevel=50
)
 
SelectId, PreviewImageId, Title, DateCreated, FeaturedDisplayedCount
From
FeaturedClassifieds
Where
Row between@startRowIndex And @startRowIndex+@NumRows-1
Update FeaturedClassifiedsSET FeaturedDisplayedCount = FeaturedDisplayedCount+1
Where
Row between
@startRowIndex And @startRowIndex+@NumRows-1
END
 
 I have tried function too for this, but function can not update table I guess.... Can I call stored procedure for each column? How?
 I thought the code above would work? What am I missing?

View 3 Replies View Related

Working With Dates In SQL Server 2005

Nov 20, 2007

I'm trying to add records to a table that includes datetime value using INSERT query.
No matter what date value I'm giving the query, the value saved is 1/1/1900 00:00 .
Also, I'm interested in saving only the short date, without time. I thought changing the type from datetime to smalldatetime would do the job, but it didn't help.

View 7 Replies View Related

Auto Stats Not Working Sql 2005

Dec 29, 2007

The auto stats not working

I have both Auto Update Statistics and Auto Update Statistics Asynchronously set to True

Created a little test table.
USE [TEST]

GO

/****** Object: Table [dbo].[CUSTOMER] Script Date: 12/29/2007 10:42:49 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

CREATE TABLE [dbo].[CUSTOMER](

[Customer_Id] [nchar](10) NOT NULL,

[Customer_Name] [nvarchar](1000) NULL,

[Customer_Address] [nvarchar](1000) NULL,

[Customer_Address1] [nchar](1000) NULL,

CONSTRAINT [PK_CUSTOMER] PRIMARY KEY CLUSTERED

(

[Customer_Id] ASC

)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]

) ON [PRIMARY]





--Created an insert table

DECLARE @COUNT INT

SET @COUNT = 1

WHILE @COUNT <= 1000

begin

insert into CUSTOMER (CUSTOMER_ID, CUSTOMER_NAME)

VALUES (@COUNT, '12345678901234567890')

SET @COUNT = @COUNT + 1

END



I then look at Tables then statistics the statistics are empty so i fire update statistics and see 1000 rows in here.



I run again the insert script

DECLARE @COUNT INT

SET @COUNT = 1001

WHILE @COUNT <= 2000

begin

insert into CUSTOMER (CUSTOMER_ID, CUSTOMER_NAME)

VALUES (@COUNT, '12345678901234567890')

SET @COUNT = @COUNT + 1

END



Look again at statistics it does not have 2000 rows in here.


If i do select * from CUSTOMER where CUSTOMER_ID = '2000' then go checks statictics it works.



I was under the impression that when you do insert or delete, update then the statistics are fired.



The sys.sysindexes rowmodctr shows the 1000 rows.



I checked the conditions that sql fires if the no of rows int able > 6 and < 500 then updates when 500 mods made.

Also if row > 500 auto update done when 500 = 20% are added



So both are met.



Anyone other any other suggestions about the auto stats ?

View 7 Replies View Related

SQL Server 2005 Not Working On Vista

Feb 10, 2008

Hi

I have a VB project in VS 2005 Express that uses SQL 2005. I use Click Once to deploy the project. The s/w installs and installs the SQL 2005 prerequisit on XP and Vista machines without problem.

Problem: As soon as the apps tries to use SQL 2005 on a Vista machine it says sqlservr.exe has stopped working and has to close. XP machines work like a dream.

Any ideas please? Any help would be welcomed.


Dim sql As String = "CREATE DATABASE " + dataBaseName + " ON (NAME = " + dataBaseName + ", FILENAME = '" _

+ UKHRdataFolder + "" + dataBaseName + ".mdf')"

Dim myCommand As New SqlCommand

Dim myAdapter As New SqlDataAdapter

Dim myData As New System.Data.DataTable

Dim conn As New SqlConnection

conn.ConnectionString = _

"Data Source=.SQLEXPRESS;AttachDbFilename=;Integrated Security=True;Connect Timeout=30;User Instance=True"

myCommand.Connection = conn

Try

conn.Open()

Try

myCommand.Connection = conn

myCommand.CommandText = sql

myCommand.ExecuteNonQuery()

Catch myerror As SqlException

End Try

Catch myerror As SqlException

Finally

If conn.State <> ConnectionState.Closed Then conn.Close()

End Try

conn.Close()

conn.Dispose()

View 13 Replies View Related

Replication Between SQL CE 2.0 And SQL Server 2005 Not Working

Apr 19, 2006

Hi,

I've been trying to get my merge replication to work with a sql ce 2.0 on
sql server 2005, but it keeps generating shapshot scripts my pocket pc can't
execute.

Example of my table.sch file in my snapshot folder:
drop Table [dbo].[Application]
go

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Application](
[AppID] [nvarchar](20) NOT NULL,
[AddOnInfo] [nvarchar](50) NULL,
[MaxClients] [int] NULL,
[AppName] [nvarchar](255) NULL,
[NbrDaysHistory] [int] NOT NULL CONSTRAINT [DF_Application_NbrDaysHistory]
DEFAULT (10),
[NbrDaysFuture] [int] NOT NULL CONSTRAINT [DF_Application_NbrDaysFuture]
DEFAULT (10),
[rowguid] [uniqueidentifier] ROWGUIDCOL NOT NULL CONSTRAINT
[DF__Applicati__rowgu__4C364F0E] DEFAULT (newid())
)

GO
SET ANSI_NULLS ON

go

SET QUOTED_IDENTIFIER ON

go

ALTER TABLE [dbo].[Application] ADD CONSTRAINT [Application_PK] PRIMARY KEY
CLUSTERED
(
[AppID]
)
GO

I've selected that I was setting up a merge replication that needs to be
compatible with sql ce. But it doesn't seem to do this...

I've tried to set the compatibility level to 80SP3 manually but it remains
80RTM...
I've tried everything.....

Does anyone have any ideas what could be causing this?

If I remove these lines from the sch file everything works jsut fine:

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON

go

SET QUOTED_IDENTIFIER ON

go

ALTER TABLE [dbo].[Application] ADD CONSTRAINT [Application_PK] PRIMARY KEY
CLUSTERED
(
[AppID]
)
GO

Even if I make a publication for sql mobile 2005 it generates the same
script.... It's almost as if SQL 2005 is ignoring my settings...

Thanks,

Desperate Natasja

View 12 Replies View Related

Auto Stats Not Working Sql 2005

Dec 29, 2007

The auto stats not working

I have both Auto Update Statistics and Auto Update Statistics Asynchronously set to True




USE [TEST]

GO

/****** Object: Table [dbo].[CUSTOMER] Script Date: 12/29/2007 10:42:49 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

CREATE TABLE [dbo].[CUSTOMER](

[Customer_Id] [nchar](10) NOT NULL,

[Customer_Name] [nvarchar](1000) NULL,

[Customer_Address] [nvarchar](1000) NULL,

[Customer_Address1] [nchar](1000) NULL,

CONSTRAINT [PK_CUSTOMER] PRIMARY KEY CLUSTERED

(

[Customer_Id] ASC

)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]

) ON [PRIMARY]




--Created an insert table
DECLARE @COUNT INT

SET @COUNT = 1

WHILE @COUNT <= 1000

begin

insert into CUSTOMER (CUSTOMER_ID, CUSTOMER_NAME)

VALUES (@COUNT, '12345678901234567890')

SET @COUNT = @COUNT + 1

END

Look at Tables then statistics the statistics are empty so i fire update statistics and see 1000 rows in here.

I run again the insert script
DECLARE @COUNT INT

SET @COUNT = 1001

WHILE @COUNT <= 2000

begin

insert into CUSTOMER (CUSTOMER_ID, CUSTOMER_NAME)

VALUES (@COUNT, '12345678901234567890')

SET @COUNT = @COUNT + 1

END


Look again at statistics it not firing.

If i do select * from CUSTOMER where CUSTOMER_ID = '2000' then go checks statictics it works.

I was under the impression that when you do insert or delete, update then the statistics are fired.

The sys.sysindexes rowmodctr shows the 1000 rows.

I checked the conditions that sql fires if the no of rows int able > 6 and < 500 then updates when 500 mods made.
Also if row > 500 auto update done when 500 = 20% are added

So both are met.

Anyone other any other suggestions about the auto stats ?

View 2 Replies View Related

Database Connection Working In Vs 2003 But Not In Vs 2005

Nov 21, 2006

Hi, I'm fairly new to the asp.net enviroment.. I have a project in asp.net and I need to upgraded to asp.net 2.0... I just did that, and the few errors that I got are resolved already, the only error that I have not been able to figure out is when I tried to retrieve data from a database I get the following error:
An error has ocurred while establishsing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.(provider:Named Pipes Provider, error:40- could not open a connection to SQL Server)  and it points to the following line:

Dim ds As DataSet = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(ConfigurationManager.AppSettings(GlobalD.CfgKeyConnString), CommandType.StoredProcedure, "PG_LST_MENU_BY_SUBJECT")
As I said before my project with the previous version works fine, and this is the only part that is giving me trouble...
thank you  
 

 

View 1 Replies View Related

I Can't Get SQL Server 2005 Enterprise Edition Working

Apr 30, 2007

Hi all,



I can't get SQL Server 2005 Enterprise Edition working on my notebook with Windows Vista Business Edition. I installed SQL Server 2005 Enterprise Edition and then i ran SP2 for SQL Server EE.



But now when i a am trying to connect to any server from SQL SERVER MANAGEMENT STUDIO i can't see any Server in Server Name list. When I click on Browse for more, I don't see any server. I am able to get Network servers.



While installing the SQL SERVER all the features were disabled as it is, then i went to advanced and selected all the options.



Any suggestions are apperiacted in advance.



Regards,

Syed Abbas Naqvi

Sr. Software Developer.

View 6 Replies View Related

Restarted SQL Server 2005, And It's Working Great Now, But WHY??

Aug 3, 2007

My small business has about 21GIGs of data in our database. This entire week we've been running absolutely slow. Posting transactions have been taking up to 30+ seconds when they're normally instant.

We ran the profiler and found that certain stored procedures were taking an absolutely long time to run. We checked for fragmentation, indexing, etc. Keep in mind our hardware was constantly pegged at 80%+ all the time. We have about 60 users connected to our server at any given time.

After much effort to no avail, we finally resorted to just restarting the software. Some have even suggested powering down and rebooting our hardware, but I halted that. We stopped and restarted the server via the management studio and now everything is just peachy. We're funning super fast and smooth.

My concern is that we're just bandaid-ing the problem and not resolving it; so eventually we're going to be faced with this problem again. Even though restarting the server is quite easy and not too effective on our downtime, personally, I'd like to know what the real issue is. Isn't sql server 2005 a self-tuning software to begin with?

Has anyone experienced this and share some insights on what they did and didn't do to resolve this quirk?

View 3 Replies View Related







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