Sql6.5 Functions
Jan 15, 1999Hello All,
Does anyone know if stored functions can be written for sql similar to stored procedures? And if theey
can, what language?
Thanks
Hello All,
Does anyone know if stored functions can be written for sql similar to stored procedures? And if theey
can, what language?
Thanks
The database devices was showing a negative number size, so i expanded the database which has cleared this problem, however, now when users try to input a form(each form is allocated a unique reference number) for this database the reference number has reset and is starting off at 1 instead of following on from the previous form number before this problem occurred.
View 1 Replies View RelatedHello
when I installed SQL6.5 on a server with Win2000 I received a message saying that SQL6.5 could "not be installed on this version of Windows."
Can someone please tell me what the story is here.
Regards
De Waal
I created a DTS task to transfer data from a SQL7.0 table to a SQL6.5 table. This trasfer is really slow.
The transfer the other way is amazingly fast.
Any ideas ??
Thank you in advance.
Can my Access 97 db's connect to both a SQL 6.5 and 7.0 without a problem.
has anybody tried this?
Hi all :
Does the upgrade wizard in 7.0 help me upgrade ALL the database objects in SQL 6.5 (including stored procedures, triggers) to 7.0? Has anyone encountered any problems?
Rnathan
I am attempting to connect to my SQL 6.5 Server through IPX. We currently have a WindowsNT network setup with a Novell Server v3.12 running as a file and login server. When I setup IPX/SPX as a network protocal to use, and then set it in the client configuration , I get a specific error.
"Cannot Connect To SQL Server : Login Failed"
Maybe I am missing a step in my setup somewhere. Has anyone encountered this with using IPX? It connects perfectly using named pipes, but only see this error when I try to use IPX. All help is appreciated. Thank You.
Michael Mroz
Libera, Inc.
Jamestown, NY
Can SQL6.5 and SQL7.0 live on the same NT4.0 server?
View 2 Replies View RelatedI just started as a junior dba and I'm monitoring a SQL6.5 database and I need some help with a certain issue, as to what I should be looking for.
Recently, the program we use to retrieve data from the database has been freezing up on everyone. What I did was just kill some user's processes from Enterprise Manager which seems to work. But we never had this problem before. And since everyone has been closing their programs prematurely, the error log contains many errors like this:
Error: 1608, Severity: 21, State: 2
A network error was encountered while sending data to the front end.
Error: 17824, Severity: 10, State: 0
Unable to write to ListenOn Connection pipesqlquery.....
We have a dedicated server for this database and there's about 20 requests to the database at any given time.
If anybody can tell me what to do, I would greatly appreciate it. Thank you.
Does anyone know of any issues that need to be considered when installing NT sp4.
Since doing so we are getting unexpected database behaviour
thanks in advance
Can you restore a SQL6.5 backup to a Sql2000sp3 ?
View 7 Replies View RelatedI was playing around with the new SQL 2005 CLR functionality andremembered this discussion that I had with Erland Sommarskog concerningperformance of scalar UDFs some time ago (See "Calling sp_oa* infunction" in this newsgroup). In that discussion, Erland made thefollowing comment about UDFs in SQL 2005:[color=blue][color=green]>>The good news is that in SQL 2005, Microsoft has addressed several of[/color][/color]these issues, and the cost of a UDF is not as severe there. In fact fora complex expression, a UDF in written a CLR language may be fasterthanthe corresponding expression using built-in T-SQL functions.<<I thought the I would put this to the test using some of the same SQLas before, but adding a simple scalar CLR UDF into the mix. The testinvolved querying a simple table with about 300,000 rows. Thescenarios are as follows:(A) Use a simple CASE function to calculate a column(B) Use a simple CASE function to calculate a column and as a criterionin the WHERE clause(C) Use a scalar UDF to calculate a column(D) Use a scalar UDF to calculate a column and as a criterion in theWHERE clause(E) Use a scalar CLR UDF to calculate a column(F) Use a scalar CLR UDF to calculate a column and as a criterion inthe WHERE clauseA sample of the results is as follows (time in milliseconds):(295310 row(s) affected)A: 1563(150003 row(s) affected)B: 906(295310 row(s) affected)C: 2703(150003 row(s) affected)D: 2533(295310 row(s) affected)E: 2060(150003 row(s) affected)F: 2190The scalar CLR UDF function was significantly faster than the classicscalar UDF, even for this very simple function. Perhaps a more complexfunction would have shown even a greater difference. Based on this, Imust conclude that Erland was right. Of course, it's still faster tostick with basic built-in functions like CASE.In another test, I decided to run some queries to compare built-inaggregates vs. a couple of simple CLR aggregates as follows:(G) Calculate averages by group using the built-in AVG aggregate(H) Calculate averages by group using a CLR aggregate that similatesthe built-in AVG aggregate(I) Calculate a "trimmed" average by group (average excluding highestand lowest values) using built-in aggregates(J) Calculate a "trimmed" average by group using a CLR aggregatespecially designed for this purposeA sample of the results is as follows (time in milliseconds):(59 row(s) affected)G: 313(59 row(s) affected)H: 890(59 row(s) affected)I: 216(59 row(s) affected)J: 846It seems that the CLR aggregates came with a significant performancepenalty over the built-in aggregates. Perhaps they would pay off if Iwere attempting a very complex type of aggregation. However, at thispoint I'm going to shy away from using these unless I can't find a wayto do the calculation with standard SQL.In a way, I'm happy that basic SQL still seems to be the fastest way toget things done. With the addition of the new CLR functionality, Isuspect that MS may be giving us developers enough rope to comfortablyhang ourselves if we're not careful.Bill E.Hollywood, FL------------------------------------------------------------------------- table TestAssignment, about 300,000 rowsCREATE TABLE [dbo].[TestAssignment]([TestAssignmentID] [int] NOT NULL,[ProductID] [int] NULL,[PercentPassed] [int] NULL,CONSTRAINT [PK_TestAssignment] PRIMARY KEY CLUSTERED([TestAssignmentID] ASC)--Scalar UDF in SQLCREATE FUNCTION [dbo].[fnIsEven](@intValue int)RETURNS bitASBEGINDeclare @bitReturnValue bitIf @intValue % 2 = 0Set @bitReturnValue=1ElseSet @bitReturnValue=0RETURN @bitReturnValueEND--Scalar CLR UDF/*using System;using System.Data;using System.Data.SqlClient;using System.Data.SqlTypes;using Microsoft.SqlServer.Server;public partial class UserDefinedFunctions{[Microsoft.SqlServer.Server.SqlFunction(IsDetermini stic=true,IsPrecise=true)]public static SqlBoolean IsEven(SqlInt32 value){if(value % 2 == 0){return true;}else{return false;}}};*/--Test #1--Scenario A - Query with calculated column--SELECT TestAssignmentID,CASE WHEN TestAssignmentID % 2=0 THEN 1 ELSE 0 END ASCalcColumnFROM TestAssignment--Scenario B - Query with calculated column as criterion--SELECT TestAssignmentID,CASE WHEN TestAssignmentID % 2=0 THEN 1 ELSE 0 END ASCalcColumnFROM TestAssignmentWHERE CASE WHEN TestAssignmentID % 2=0 THEN 1 ELSE 0 END=1--Scenario C - Query using scalar UDF--SELECT TestAssignmentID,dbo.fnIsEven(TestAssignmentID) AS CalcColumnFROM TestAssignment--Scenario D - Query using scalar UDF as crierion--SELECT TestAssignmentID,dbo.fnIsEven(TestAssignmentID) AS CalcColumnFROM TestAssignmentWHERE dbo.fnIsEven(TestAssignmentID)=1--Scenario E - Query using CLR scalar UDF--SELECT TestAssignmentID,dbo.fnIsEven_CLR(TestAssignmentID) AS CalcColumnFROM TestAssignment--Scenario F - Query using CLR scalar UDF as crierion--SELECT TestAssignmentID,dbo.fnIsEven_CLR(TestAssignmentID) AS CalcColumnFROM TestAssignmentWHERE dbo.fnIsEven(TestAssignmentID)=1--CLR Aggregate functions/*using System;using System.Data;using System.Data.SqlClient;using System.Data.SqlTypes;using Microsoft.SqlServer.Server;[Serializable][Microsoft.SqlServer.Server.SqlUserDefinedAggregate (Format.Native)]public struct Avg{public void Init(){this.numValues = 0;this.totalValue = 0;}public void Accumulate(SqlDouble Value){if (!Value.IsNull){this.numValues++;this.totalValue += Value;}}public void Merge(Avg Group){if (Group.numValues > 0){this.numValues += Group.numValues;this.totalValue += Group.totalValue;}}public SqlDouble Terminate(){if (numValues == 0){return SqlDouble.Null;}else{return (this.totalValue / this.numValues);}}// private accumulatorsprivate int numValues;private SqlDouble totalValue;}[Serializable][Microsoft.SqlServer.Server.SqlUserDefinedAggregate (Format.Native)]public struct TrimmedAvg{public void Init(){this.numValues = 0;this.totalValue = 0;this.minValue = SqlDouble.MaxValue;this.maxValue = SqlDouble.MinValue;}public void Accumulate(SqlDouble Value){if (!Value.IsNull){this.numValues++;this.totalValue += Value;if (Value < this.minValue)this.minValue = Value;if (Value > this.maxValue)this.maxValue = Value;}}public void Merge(TrimmedAvg Group){if (Group.numValues > 0){this.numValues += Group.numValues;this.totalValue += Group.totalValue;if (Group.minValue < this.minValue)this.minValue = Group.minValue;if (Group.maxValue > this.maxValue)this.maxValue = Group.maxValue;}}public SqlDouble Terminate(){if (this.numValues < 3)return SqlDouble.Null;else{this.numValues -= 2;this.totalValue -= this.minValue;this.totalValue -= this.maxValue;return (this.totalValue / this.numValues);}}// private accumulatorsprivate int numValues;private SqlDouble totalValue;private SqlDouble minValue;private SqlDouble maxValue;}*/--Test #2--Scenario G - Average Query using built-in aggregate--SELECT ProductID, Avg(Cast(PercentPassed AS float))FROM TestAssignmentGROUP BY ProductIDORDER BY ProductID--Scenario H - Average Query using CLR aggregate--SELECT ProductID, dbo.Avg_CLR(Cast(PercentPassed AS float)) AS AverageFROM TestAssignmentGROUP BY ProductIDORDER BY ProductID--Scenario I - Trimmed Average Query using built in aggregates/setoperations--SELECT A.ProductID,CaseWhen B.CountValues<3 Then NullElse Cast(A.Total-B.MaxValue-B.MinValue ASfloat)/Cast(B.CountValues-2 As float)End AS AverageFROM(SELECT ProductID, Sum(PercentPassed) AS TotalFROM TestAssignmentGROUP BY ProductID) ALEFT JOIN(SELECT ProductID,Max(PercentPassed) AS MaxValue,Min(PercentPassed) AS MinValue,Count(*) AS CountValuesFROM TestAssignmentWHERE PercentPassed Is Not NullGROUP BY ProductID) BON A.ProductID=B.ProductIDORDER BY A.ProductID--Scenario J - Trimmed Average Query using CLR aggregate--SELECT ProductID, dbo.TrimmedAvg_CLR(Cast(PercentPassed AS real)) ASAverageFROM TestAssignmentGROUP BY ProductIDORDER BY ProductID
View 9 Replies View RelatedHi all
I would like to know - we are currently running SQL6.0 on NT4 servers. We have 2 x 3rd party programs that runs on the servers, making use of the databases. We don't forsee any changes in the near future.
Question: will it be wise to upgrade to SQL7 anyways, or can we keep the status quo as is ???
Rgds
De Waal
I installed SQL 7 on a new computer and imported DB from another SQL 6.5.
Tables were imported but index and SPs were not.
I had to script those objects and run it on SQL 7.
Any shortcut to import all objects directly?
Again I was importing not upgrading.
Hi all,
I receive the following error message every time I run this script:
INSERT INTO archive_temp (mrn, folder, name)
SELECT a.mrn, a.encounter, a.name
FROM his..active a, cabinet..cabinet c
WHERE imnet like 'images3%'
ORDER BY a.mrn, a.encounter
GO
After 10 minutes I get this ERROR MESSG: Can't allocate space for object
'-1443' in database 'tempdb' b/c the 'system' segment is full. If you
ran out of space in Syslogs, dump the transaction log. Otherwise use
'Alter database" or sp_extendsegment to increase the size of segment.
So far, i've updated the tempdb log segment from 100 mb to 500 mb
shared with data. I don't understand why I am still getting this error.
When I look at Performance Monitor, the log for tempdb is not peaked at
all!
can anyone help?
Thanks
Chris
I need to transfer databases from one server to the other.
(They are identical sort order/char set/...) but as I did
all passwords were set to NULL....How can I use the
generated scripts to transfer without losing them ?
(Have about 300 users...) Thank you for your help !!
I Completely new to SQL, can anyone give me a URL to find this information.?
Thanks
Can it be done?
View 2 Replies View RelatedHi!
I just have one short question.
Is there a way to change the sort order in SQL 6.5 short of re-installing
the whole database?
If there is, how do I go about it?
TIA
Johan
i've a sql server 6 and sql server 7 located in 2 different domain.
how could i migrate the database from my sql 6 to sql 7?
I`m planning on installing sql7 beta on my desktop. Currently I have sql6.5 client tools installed on my desktop for performing DBA tasks against our test and prod. sql6.5 servers. Does anyone know if installing sql7 will conflict with my sql6.5 client tools or cause any other problems?
Thanks
In SQL 6.5, you could Transfer (through a menu item in Enterprise Mgr) all or parts of a database to another server. It was the perfect 'copy' mechanism. What happened to it?
Thanks,
Judith
Hi
Is it possible to add jobs into the SQL schedule by means of a SQL script. We have 1000 remote servers to update and don't really want to do it manually.
Any help appreciated.
Ian
I have heard that there are potential problems if you put service pack for NT on your server, in that it conflicts with SQL 6.5. Does anyone know of
any such problems with either running 6.5 under these conditions or installing 6.5 if the service pack is already on the server.
Thanks
hi
I want to ask the method to calculate the memory in the configuration in SQL6.5.
If I have 256MB memory installed in the server, how many memory needed in the configuration of SQL6.5.
Has any every had a problem with the probe login / SQL Perfmon processes not clearing out and maxing out users
connections? Microsoft has recommended I rename the sqlctr60.dll to sqlctr60.old. This causes my application
event log to fill up after about 10 min because it is trying to make a connection. They say this is a problem
running on a compaq server. I am running NT 4.0 sp 4, SQL6.5 sp5a. Any ideas?
Thanks
Tammy Maxfield
I'm thinking to upgrade SQL6.5 DB to SQL 2000 but do not know
all client access with SQL 6.5 utility will work ???
(The application is a vendor canned package using SQL 7.0 DB
but client can access with 6.5 ---Not using ODBC)
Any experts can help ?
Thank you in advance !!
Lewis
I am having the following error when running the SQL upgrade wizard trying to upgrade SQL 6.5 to SQL 2000. Does anyone here know what is the problem ?
Version Switch has aborted because you do not have "Full Control" permission to one of the HKEY_LOCAL_MACHINESoftwareMicrosoftMSSQLServ* registry keys. Please use regedit32.exe to correct this problem and try again.
I have already checked the registry and I do have full control permission on HKEY_LOCAL_MACHINESoftwareMicrosoftMSSQLServ*. Please help.
Hi,
Does anybody know if SQL7 server in running in 6.5 compat mode allow
row-level locking ?????
Thanks
Mahesh
I want create trigger in sql7 insert or update in data base sql6.5
Quiero crear un trigger en sql7 que haga un Insert o update en una base de datos de sql6.5, se puede y como?
Hi:
After I am install SQL7.0 clent tools in my WINDOWS95,
The SQL7.0 database can access very well,
but I am access SQL6.5 database object(tables) then the select data is bad,
why ? help me please.
I was wondering if the only way to import MSaccess files into sql6.5 is to dump the MSaccess file into a text file and then recreate the structure in SQL6.5 and then use the bcp command to copy the data into the new structure.
Is there an easier way?
thanks in advance.
Rich
LoPingKill
loping@inlink.com
Had to rebuild SQL server and restored SMS databases ok. But the following msgs have appeared - any clues. All help appreciated.
99/08/16 16:38:30.75 ods Error : 17824, Severity: 10, State: 0
99/08/16 16:38:30.75 ods Unable to write to ListenOn connection '.pipesqlquery', loginname 'sa', hostname ''.
99/08/16 16:38:30.75 ods OS Error : 232, The pipe is being closed.
99/08/16 16:38:30.77 spid16 Error : 1608, Severity: 21, State: 2
99/08/16 16:38:30.77 spid16 A network error was encountered while sending results to the front end. Check the SQL Server errorlog for more information.