TOP Statement In SQL Server 2000
Apr 23, 2008
Code Snippet
string sql = "SELECT TOP(@aantal) macID FROM MAC WHERE macID NOT IN (SELECT macID FROM ProductMAC) ORDER BY macAdres";
SqlParameter par = new SqlParameter("@aantal", aantal);
How come this works in sql server 2005 but not in sql server 2000? The error is on the parameter.
The parameter is an integer.
Does anybody know the answer?
Regards
Tim D'haeyer
View 4 Replies
ADVERTISEMENT
Jul 26, 2006
I have a SQL statement stored in a SQL varriable (after a lot of conditions)
Code:
declare @sql char(100)
set @sql = 'select ma_kh, ten from _khang'
Now, I want to create a cursor to recalculate some values
I've tried:
Code:
declare cur_T cursor for exec(@sql) open cur_T
but it doesn't work.
Can I have another way to do that???
View 2 Replies
View Related
Jul 20, 2005
Hi All,I am facing problem in MS SQL Server 2000. It is behaving slow forselect statements. It is even slower than MS ACCESS. For example, if iuse"Select count(*) from tbl;". i get the results after long time ifthere is more than 100k rows. What might be the possible reasons forthis??ThanksHoque
View 1 Replies
View Related
Apr 2, 2004
Hi every body i had a question
i want to insert an value well i want to incerment 2 values in my table called
"adsDispalyed","clickedAds" by one each based on their webpage
so i want to send webpage as a parameter to the procedure and i want it to find that sepcificed webpage and incerment relative "adsDispalyed","clickedAds" colum values by one
but i am newbi in this can any one help me what i kind of have is
ALTER PROCEDURE UpdateAdStatus
(
@webpage nvarchar(50)
)
AS
INSERT INTO AdvertiserProfile
(
BannerClicked,
BannerDisplayed
)
VALUES
(
BannerClicked+1,
BannerDisplayed+1
)
2 things are wrong with this
1- it says i cant have colum name in "value" section what i am trying to do is to say insert into BannerClicked value of BannerClicked plus one
2-@webpage, how do i create a conditional Insert stament, in this example the conidition is @webpage
View 1 Replies
View Related
Jul 20, 2005
Hi,I'm trying to do calculations in a SQL statement, but depending on onevariable (a.type in example) I'll need to pull another variable fromseperate tables.Here is my code thus far:select a.DeptCode DeptCode,a.Type Type,(a.ExpenseUnit / (select volume from TargetData b where b.type =a.type)) ExpenseFromcalc1 aThe problem... a.Type can be FYTD, Budget, or Target... and dependingon which one it is, I need to make b either FYTDData, TargetData, orBudgetData. I'm thinking a case statement might do the trick, but Ican't find any syntax on how to use Case in an MS SQL statement. EvenIf statements will work (if that's possible), though case would beless messy.Any suggestions would be much appriciative. Thanks...Alex.
View 4 Replies
View Related
May 23, 2008
Hi,
I have a simple update statement that looks like this:
UPDATE tblTableName
SET colDate = DATEADD(DAY, increment, colDate)
This works fine in SQL Server 2005, but in SQL Server 2000 I get the message:
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
This doesn't seem right to me as there is no subquery! Does anyone have any suggestions?
Regards,
View 5 Replies
View Related
Jan 9, 2015
Ok I have a query "SELECT ColumnNames FROM tbl1" let's say the values returned are "age,sex,race".
Now I want to be able to create an "update" statement like "UPATE tbl2 SET Col2 = age + sex + race" dynamically and execute this UPDATE statement. So, if the next select statement returns "age, sex, race, gender" then the script should create "UPDATE tbl2 SET Col2 = age + sex + race + gender" and execute it.
View 4 Replies
View Related
Jan 2, 2008
I hope this is a easy one. We are trying to find a fix for a select statement that works in 2000 but not in 2005 with a simple select statement.
The easiest statement that will duplicate the error is:
TestTable has 3 columns: Primary, strTest, strTest2
SELECT strTest, strTest AS Name
FROM TestTable
ORDER BY strTest2
If you sort by the Primary column you will not receive an error.
How can you select the same column twice and then sort in the SQL statement?
View 3 Replies
View Related
Jun 21, 2007
I just wanted to post a difference I found between SQL 2000 and SQL 2005 regarding UDPATE statements that are done on a join. I understand that if tables are designed correctly this won't be a problem. But, when you inherit a bad design, you are unfortunately stuck with it. Hopefully this will help ease data differences in your migration from SQL 2000 to SQL 2005.
Run this code on a SQL 2000 connection, then run on SQL 2005. My guess on the behavior difference is strictly performance based since 2005 pulls the top result. Either way it can cause a lot of head scratching if you're not aware of it.
IF OBJECT_ID('tempdb..#UpdateTestA') IS NOT NULL
DROP TABLE #UpdateTestA
IF OBJECT_ID('tempdb..#UpdateTestB') IS NOT NULL
DROP TABLE #UpdateTestB
CREATE TABLE #UpdateTestA(
UpdateTestA int identity(1, 1),
FullName varchar(20),
UpdateData varchar(10))
CREATE TABLE #UpdateTestB(
UpdateTestB int identity(1, 1),
FullName varchar(20),
UpdateData varchar(10))
INSERT INTO #UpdateTestA(
FullName)
VALUES ('Barney Rubble')
INSERT INTO #UpdateTestB(
FullName,
UpdateData)
VALUES ('Barney Rubble', 'First')
INSERT INTO #UpdateTestB(
FullName,
UpdateData)
VALUES ('Barney Rubble', 'Second')
SELECT * FROM #UpdateTestA
UPDATE a
SET a.UpdateData = b.UpdateData
FROM #UpdateTestA a
INNER JOIN #UpdateTestB b on b.FullName = a.FullName
SELECT * FROM #UpdateTestA
DROP TABLE #UpdateTestA
DROP TABLE #UpdateTestB
Hope this solves a problem that you were having too.
View 3 Replies
View Related
Jul 9, 2007
Hi,
I have a simple sql statement that used to work in SQL 2000 that isn't working in SQL 2005. The order by clause doesn't seem to have any effect on the result set. The sql statement is:
ALTER VIEW dbo.SELECT_PP_END
AS
SELECT TOP 100 PERCENT
PP_PERIOD_ID,
CONVERT(VARCHAR, PP_END_DATE, 101) AS PP
FROM dbo.PP_PERIODS
ORDER BY PP_END_DATE DESC
The period end date is appearing in ascinding order on sql server 2005 and in the correct order in sql 2000. Any idea? Thank you for your help
- T.A.
View 7 Replies
View Related
Aug 13, 2014
i was tasked to created an UPDATE statement for 6 tables , i would like to update 4 columns within the 6 tables , they all contains the same column names. the table gets its information from the source table, however the data that is transferd to the 6 tables are sometimes incorrect , i need to write a UPDATE statement that will automatically correct the data. the Update statement should also contact a where clause
the columns are [No] , [Salesperson Code], [Country Code] and [Country Name]
i was thinking of doing
Update [tablename]
SET [No] =
CASE
WHEN [No] ='AF01' THEN 'Country Code' = 'ZA7' AND 'Country Name' = 'South Africa'
ELSE 'Null'
END
What is the best way to script this
View 1 Replies
View Related
Feb 24, 2005
Hello, i have a question that the sql server 2000 is install in window 2000 server. If i want to update to window 2003. Is that any problem in sql server 2000. I am worry about whether we will have problem after update. What i need to do? Many thanks.
View 5 Replies
View Related
Feb 28, 2008
Hi All,
I would like to know, how the datetime will be stored in the sqlserver datetime column.
Because some time i am giving the date in dd/mm/yyyy and sometime mm/dd/yyyy.
while give the date in mm/dd/yyyy works fine but not in the another case. and also while i execute a query on query analyser it shows the datetime in
yyyy/mm/dd format.
So anyone can please tell me how the dates will be stored in the datetime column of sqlserver database?
Thanks in Advance.
Regards,
Dhanasekaran. G
View 2 Replies
View Related
Sep 14, 2004
I am currently running SQL Server 2000 Standard on my production system, and I am looking to upgrade the system to Windows 2000 Adv. Server. I would also like to upgrade SQL Server 2000 Standard to SQL Server 2000 Enterprise to utilize more than 2GB of memory. Can anyone tell me what is the best way to upgrade the system, and please provide some feedback on your experiences with the upgrade. Thanks in advance.
View 2 Replies
View Related
Jul 20, 2005
We are experiencing a problem with Sql Server 2000 linking to anAccess 97 file. We have two machines that link to this .mdb file, andwe recently upgraded one to newer hardware, SP3a, MDAC 2.8, etc. Thelink on this upgraded machine no longer works, giving this message:Server: Msg 7399, Level 16, State 1, Line 1OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error.[OLE/DB provider returned message: Cannot open a database created witha previous version of your application.]OLE DB error trace [OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0'IDBInitialize::Initialize returned 0x80004005: ].The link on the older machine still works. We decided to tryconverting a copy of the file to Access 2000 to see if the newerpatches/drivers/whatever no longer supported 97. We set up a link onboth machines to this file, and they both work. However, on theupgraded machine, the following error is receievedServer: Msg 7399, Level 16, State 1, Line 1OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error.[OLE/DB provider returned message: System resource exceeded.]OLE DB error trace [OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0'ICommandText::Execute returned 0x80004005: ].when making 1-3 connections to the the linked server, while the oldermachine supports at least 7 simultaneous queries connecting to thelinked server and still hasn't produced that error.Does anyone have any idea if there is a known issue with linking toAccess 97/2000 files under MDAC 2.8, Jet 4.0, etc? Any light anyonecan shine on this subject would be greatly appreciated.
View 1 Replies
View Related
Jul 20, 2005
What is the limitation of memory that SQL Server 2000 Standard can usewhen running on a Windows 2000 Advanced Server platform?
View 1 Replies
View Related
Sep 15, 2006
Hi, I need to know if somebody knows like making the update of Standard SQL 2000 to Enterprise. Greetings.
View 3 Replies
View Related
Mar 15, 2006
Thanks in advance. What is maximum SQL Server database (*.mdf) file size with SQL Server 2000 as part of Microsoft Small Business Server 2000? (Database files were limited to 10 GB in SBS 4.5 with SQLServer 7.0... has this changed?).
View 1 Replies
View Related
May 21, 2005
Can you install Sql Server 2000 Developer Edition with MSDE 2000 release A already installed?
View 2 Replies
View Related
Feb 17, 2004
My objective is to use Enterprise Manager to move (copy) my SQL db from the server to my windows desktop computer.
I downloaded MSDE and am having trouble installing it, no doubt because I do not understand the documentaion (ReadMeMSDE2000A.htm).
When I try to run setup, I get that message that says:
"A strong SA password is required for security reasons. Please use SAPWD switch to supply the same."
Considering my purpose, do I need a "strong" SA password? If not, how do I get around it? If yes, how do I set it up?
I am a Mac user so I have poor windows skills, please make it as painless as possible for me, thanks!
Ron
View 3 Replies
View Related
Feb 16, 2006
venu writes "Hi,
Am very new to MS SQL adminstration
Can anybody help me out how to work on Microsoft SQL Server 2000 Desktop Engine (MSDE 2000) Release A just for the practice.
The activity which am going to workout on MSDE is below.
How to install SQL(on XP)
How the layout will be(like if i insall MSDE what are all Application will be and how they depends on each other)
How to create/delete tables if so, how can we do it either by GUI or CUI
just i need a clarifications reg same
Thank you,
venu"
View 1 Replies
View Related
Jul 23, 2005
Hi,Simple question: A customer has an application using Access 2000frontend and SQL Server 2000 backend. Data connection is over ODBC.There are almost 250 concurrent users and is growing. Have theysqueezed everything out of Access? Should the move to a VB.Net frontendtaken place ages ago?CheersMike
View 4 Replies
View Related
Oct 8, 2007
Hi,
Just upgraded some development desktops to Vista Business. However we need
to still connect to some older remote windows 2000/SQL 2000 servers.
Trying to setup an ODBC system DSN on our Vista Business local desktop we get the
following errors -
-START ERROR WINDOW-
Connection Failed:
SQLState: '01000'
SQL Server Error: 772
[Microsoft][ODBC SQL Server Driver][TCP/IP Sockets]ConnectionOpen
(SECDoClientHandshake()0.
Connection failed:
SQLState: '08001'
SQL Server Error: 18
[Microsoft][ODBC SQL Server Driver][TCP/IP Sockets]SSL Security Error
-END ERROR WINDOW-
Any help greatly appreciated as this is stopping us from making
database/table connections etc. We've checked the firewall setup and all is well there.
PS - we can still connect fine using XP or windows 2000 desktops and their
local DSNs.
View 8 Replies
View Related
May 27, 2008
Parameter
Access 2000/XP
SQL Server 7.0
SQL Server 2000
MSDE 2000
Number of instances per server
n/a
n/a
16
16
Number of databases per instance / server
n/a
32,767
32,767
32,767
Number of objects per database
32,768
2,147,483,647
2,147,483,647
2,147,483,647
Number of users per database
n/a
16,379
16,379
16,379
Number of roles per database
n/a
16,367
16,367
16,367
Overall size of database (excluding logs)
2 GB
1,048,516 TB
1,048,516 TB
2 GB
Number of columns per table
255
1024
1024
1024
Number of rows per table
limited by storage
limited by storage
limited by storage
limited by storage
Number of bytes per row
(Excluding TEXT/MEMO/IMAGE/OLE)
2 KB
8 KB
8 KB
8 KB
Number of columns per query
255
4,096
4,096
4,096
Number of tables per query
32
256
256
256
Size of procedure / query
64 KB
250 MB
250 MB
250 MB
Number of input params per procedure / query
199
1,024
2,100
2,100
Size of SQL statement / batch
64 KB
64 KB
64 KB
64 KB
Depth of subquery nesting
50
32
32
32
Number of indexes per table
32
250 (1 clustered)
250 (1 clustered)
250 (1 clustered)
Number of columns per index
10
16
16
16
Number of characters per object name
64
128
128
128
Number of concurrent user connections
255
32,767
32,767
5
View 1 Replies
View Related
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
Jul 23, 2005
I've created a small company database where the tables reside in a SQLServer database. I'm using Access 2000 forms for a front end.I've got a System DSN set-up to SQL Server and am using links withinAccess 2000 to get to the SQL Server tables.My forms worked fine until I made a few minor changes to the databaseschema on SQL Server (e.g. added a foreign key, or added a column).After that, all the links break - I click on a table link and get anerror msg like "invalid object name."Deleting the links after a schema change and re-adding the links seemedto fix the problem. The forms I'd already created seemed to work fineafter re-creating the links.But then I got more advanced with my forms. I have it set up so thatfor certain entry fields, the combobox gets populated with values froma table (the description appears in the drop-down and the correspondingprimary key value gets populated in the table). I created a number offorms using this technique, entered data, and everything worked fine.Made a small schema change and it broke everything -- not the actualtable links, but the functionality for the drop-downs. My values nolonger appeared, and this was true for forms that accessed tables whoseschemas did not change.This is driving me nuts. Is there any way to keep my forms frombreaking each time I make a small schema change?Thanks.- Dana
View 5 Replies
View Related
Jul 20, 2005
Hello,I received the error message below when i'm trying to install SQLServer 2000 standard edition into a Windows 2000 Professionaleworkstation.Error :Microsoft SQL server 2000 Standard Edition server components is notsupported on this operating system. Only client components will beavailable for installation.Any request modification ?Best regards,Thanks
View 1 Replies
View Related
Sep 7, 2007
I've just started getting this EXCEPTION_ACCESS_VIOLATION (0xc0000005) on machines using Windows 2000 sp4 connecting to SQLServer. This is crashing JVMs (multiple Sun versions and BEA also) in the Java VM frame (outside our code). This has just started recently - perhaps with the last set of patches? Has anyone else seen this or know what I could do to get more information? Could this be related to updates to named pipes?
Thanks!
-Brian Temple
View 5 Replies
View Related
Oct 18, 2004
Hi,
I worked on a project in ASP.NET using SQL server 2000 as the back end. Its a conversion application that I rewrote in ASP.NET using C#. I need to import the old data in Access db into SQL server 2000 and I have very little knowledge about doing it. The data in not a direct one -one transformation. There are considerable changes to the Database design and data types. Any help and suggestions wud be really helpful. Also, any article links wud be great.
Thanks
View 1 Replies
View Related
Mar 13, 2001
We have a SQL Server 7.0 system in NT 4.0 environment. We upgraded our users to Access 2000 and started to work with this. Now we installed a new
server which is Windows 2000 based and the domain is different from
the SQL servers domain. We then installed Access 2000 on Windows 2000
to use with terminal server. But I noticed that there was a problem
with the program. I then looked at the program which was written on Access 2000 and saw that the tables and views can't be seen. The program runs but
I can't see the views and tables. Another thing is access disconects from SQL Server when I want to see the tables. So what can be the problem.
In one part there is an Access 2000 on Windows 2000 server. On the other part SQL Server 7.0 on Windows NT 4.0. And Access can't see the tables in SQL server.
View 1 Replies
View Related
May 9, 2002
I have a public mailbox that gets information mailed to it (in a pre-determined format).
Is there a way for that info to be put into a table in SQL Server without any user interaction (something running on the exchange server)?
I hope I've given enough info.
Thanks for any and all help!
Ron
View 1 Replies
View Related
May 13, 2006
I am trying to install microsoft sql server 2000 enterprise edition on a windows 2000 advance server. I keep getting error message
A previous program installation created pending file operations on the installation machine. You must restart the computer before running . I have restarted machine and no change.
What does error message mean and what is solution?
View 2 Replies
View Related
Nov 22, 2004
I have installed the SQL Server 2000 developer that came with Office XP Developer. I now have a copy of SQL Server 2000 Standard. What will happen if I try to install the standard version? Will I loss any of my current database logins or settings, etc...?
Thank you for any help,
View 1 Replies
View Related