I issue this command in QA:
CREATE FUNCTION encrypt_pair (@data VARCHAR(14) , @key char(30) )
RETURNS VARCHAR (60) AS
BEGIN
DECLARE @encryptedvars VARCHAR(60)
EXEC master..xp_aes_encrypt @data,@key,@encryptedvars OUTPUT
RETURN @encryptedvars
END
If I run it again, I get an error that it already exists (duh).
Next I run:
select student_id, student_ssn,
encrypt_pair(student_ssn,'000000000000000000000000 00000000') from
student_ssn
and I get the error:
Server: Msg 195, Level 15, State 10, Line 1
'encrypt_pair' is not a recognized function name.
I don't get whats wrong!
Thanks
Rob
Hello, I'm working on a function that will return the results in a SELECT statement. But it's not being called properly, and I can't understand why it isn't working. If anyone can help me out I'd greatly appreciate it. Here's the function code:1 FUNCTION [dbo].[UDFproduct_Search]2 ( 3 @search_string varchar(255)4 )5 RETURNS TABLE 6 AS7 RETURN 8 (9 SELECT product_id10 FROM product11 WHERE product_item_number LIKE '%' + @search_string + '%' OR12 product_part_number LIKE '%' + @search_string + '%' OR13 product_name LIKE '%' + @search_string + '%' OR14 product_commodity LIKE '%' + @search_string + '%'15 ) This SELECT statement returns the expected value:SELECT * FROM UDFproduct_Search('CABINET') This SELECT statement returns the expected value:1 SELECT * FROM where_used WHERE product_id 2 IN(SELECT product_id FROM product3 WHERE product_item_number LIKE '%' + 'CABINET' + '%' OR4 product_part_number LIKE '%' + 'CABINET' + '%' OR5 product_name LIKE '%' + 'CABINET' + '%' OR6 product_commodity LIKE '%' + 'CABINET' + '%') This SELECT statement returns errors:SELECT * FROM where_used WHERE product_id IN(UDFproduct_Search('CABINET') Error:'UDFproduct_Search' is not a recognized built-in function name. I've tried adding dbo to the function call, and in various locations, but I still get the error. Hope someone can point something out I missed. Thanks.
I'm trying to create new SSIS package and i'm using one of the control flow Item is "ActiveX Script Task". Following is script.
When i execute the task it errors out that "Function not Found". do i need to create this Function first? I'm new to SQL 2005. so any suggestion will be appreciated.
Dim srccsvfile Dim objExcel Dim objWorkbook, objWorksheet
srccsvfile = "\pc17917c$Documents and Settingskdesai1DesktopCRM Daily Supervisor Report.xls"
Set objExcel = CreateObject("Excel.Application") objExcel.Visible = False objExcel.displayalerts = False
Set objWorkbook = objExcel.Workbooks.open(srccsvfile) Set objWorksheet = objWorkbook.WorkSheets("DailyAllCases") objWorksheet.Activate objWorksheet.Delete 'this is removing the worksheet instead of rows objWorkbook.Save 'you must save the change otherwise in trouble
objExcel.Workbooks.Close Set objWorkbook = Nothing objExcel.Quit Set objExcel = Nothing Main = DTSTaskExecResult_Success End Function
We have a SQL Server 2005 Cluster that we are trying to send email from to notify when certain jobs have completed, failed, etc. We are having a bit of a problem getting the email to work and I believe that the failure is at the SMTP server, not at the SQL level.
That being said, I'm trying to create a simple SSIS package that I can use to test connectivity to the SMTP server with and send email. I've added an ActiveX Script Task that calls a COM object that actually sends the email. I keep getting a "Function not found." error when I try to execute the package, and I have no idea why I'm getting that. It says that the errors were found during validation.
I am inserting a row in my SSIS_LOG table when my package executes. Here in this table i have column date_dt which is date data type. Once package executes i am getting error like "No authorized routine named "GETDATE" of type "Function" having compatible arguments was found. sqlstate:42884". Note i am using IBMDB2 data provider.
I've got a package which reads a text file into a table and updates another. I set up configurations so that I could import it into the SSIS store on both my dev and live servers. Now, I'm getting this error. I tried removing the configs and am still getting it.
I've been through each step and everything looks okay. Does anyone have any idea (a) what's wrong, (b) how to localise the error or (c) get any additional information? Or do I just have to recreate the package from scratch?
Error at PartnerLinkFlatFileImporter: The connection "" is not found. This error is thrown by Connections collection when the specific connection element is not found.
Error at PartnerLinkFlatFileImporter [Log provider "SSIS log provider for SQL Server"]: The connection manager "" is not found. A component failed to find the connection manager in the Connections collection.
I have this function in access I need to be able to use in ms sql. Having problems trying to get it to work. The function gets rid of the leading zeros if the field being past dosn't have any non number characters.For example:TrimZero("000000001023") > "1023"TrimZero("E1025") > "E1025"TrimZero("000000021021") > "21021"TrimZero("R5545") > "R5545"Here is the function that works in access:Public Function TrimZero(strField As Variant) As String Dim strReturn As String If IsNull(strField) = True Then strReturn = "" Else strReturn = strField Do While Left(strReturn, 1) = "0" strReturn = Mid(strReturn, 2) Loop End If TrimZero = strReturnEnd Function
I need to be able to pass the output of a function to another function as input, where all functions involved are user-defined in-line table-valued functions. I already posted this on Stack Exchange, so here is a link to the relevant code: [URL] ...
I am fairly certain OUTER APPLY is the core answer here; there's *clearly* some way in which does *not* do what I need, or I would not get the null output you see in the link, but it seems clear that there should be a way to fool it into working.
We have a brand new sql 2k server. Its all up to date on service packs(both win2k and SQL).I went in to enterprise manager and added a new db. I can run sprocsand raw sql against the new db just fine from Query Analyzer.When I try to make a dts package that refers to my new db I get thefollowing error:Error desription: deferred prepare could not be completed.Could not locate entry in sysdatabases for database 'mydbname'. Noentry found with that name. Make sure that the name is enteredcorrectly.OK, so I look in sysdatabases and see 'mydbname'. Just in case im anidiot... I actually copied the db name from that table and paste it inmy dts window.My dts package is using an "execute SQL task" to call a stored proc.To be ecxact:USE mydbnameGOEXEC MyProcWhen I click on the parse button, is when I get that error message.I have deleted the db, restarted the server, and recreated the db witha slightly different name. I can replace mydbname with pubs ornorthwind and all is ok. It just doesnt like new db's.Any help would be greatly appreciated.Thanks,Dave
I've found a bug in SQL CE 3.0/3.1. This has been confirmed to be present by other users of this and the microsoft.public newsgroups, both in the Windows CE versions and the desktop x86 versions. I got this response:
Laxmi Narsimha Rao ORUGANTI MSFT wrote:
Can you please provide the simplified repro with full VS Solution you have thru our blog: http://blogs.msdn.com/sqlservercompact/contact.aspx. First contact us and then we will exchange directly thru mail.
And that's where it has ended (after I contacted the team via the blog - no response). Other forum users have suggested that I post here repeatedly until I get a response, so that's what I'm doing. Apologies.
Can anybody know ,how can we add builtin functions(ROW_NUMBER()) of Sql Server 2005 into database library. I get this error when i used into storeprocedure : ROW_NUMBER() function is not recognized in store procedure. i used MS SQL SERVER 2005 , so i think "ROW_FUNCTION()" is not in MS SQL SERVER 2005 database library. I need to add that function into MS SQL SERVER 2005 database library. Can anbody know how we can add that function into MS SQL SERVER 2005 database library?
I want to write function to call another function which name isparameter to first function. Other parameters should be passed tocalled function.If I call it function('f1',10) it should call f1(10). If I call itfunction('f2',5) it should call f2(5).So far i tried something likeCREATE FUNCTION [dbo].[func] (@f varchar(50),@m money)RETURNS varchar(50) ASBEGINreturn(select 'dbo.'+@f+'('+convert(varchar(50),@m)+')')ENDWhen I call it select dbo.formuła('f_test',1000) it returns'select f_test(1000)', but not value of f_test(1000).What's wrong?Mariusz
Been trying to get this one but need a little input. SELECT a.Id,g.LabName...... FROM someTbl a,table g WHERE a.id = @idAND (b.calLab = g.ID OR g.LabName = ???) With the above, if b.calLab = 0 then there is no entry in table g.(I didn't develop the table or would have included NONE) So, how to tell g.LabName to come back as 'None' if b.calLab = 0? Thanks, Zath
hi... i am very new to SQL server.. previously was using MySQL... now i am trying to connect my project to SQL Server.. but i wasnt able to... i keep getting errors
System.Data.Odbc.OdbcException: ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified at System.Data.Odbc.OdbcConnection.Open() at icms.DB.q(String mySTR) in C:icmsDB.vb:line 30
below is my webconfig i am not very sure about the value for the user.. because if it is MySQL i can get it from my control centre.. but what about SQL server ? where should i get my value ?
Dim myCMD As New SqlCommand Public Sub New() Dim db_server = AppSettings("db_server") Dim db = AppSettings("db") Dim db_user = AppSettings("db_user") Dim db_pwd = AppSettings("db_pwd") Dim DBConnection As String = "DRIVER={SQL Server};" & _ '<==== is my driver correct? "SERVER=" & db_server & ";" & _ "DATABASE=" & db & ";" & _ "UID=" & db_user & ";" & _ "PASSWORD=" & db_pwd & ";" & _ "OPTION=3;" myDB.ConnectionString = DBConnection myCMD.Connection = myDB End Sub 'Public Function q(ByVal mySTR As String) As OdbcDataReader 'SQL Query Public Function q(ByVal myStr As String) As SqlDataReader myCMD.CommandText = myStr Try myDB.Open() q = myCMD.ExecuteReader(Data.CommandBehavior.CloseConnection) Catch ex As Exception Err(ex.ToString) End Try
End Function Public Sub c(ByVal mySTR As String) ' COMMAND ONLY Try myCMD.Connection.Open() myCMD.CommandText = mySTR myCMD.ExecuteNonQuery() myCMD.Connection.Close() Catch ex As Exception Err(ex.ToString) End Try End Sub
I have inhereted this application and I am a newbee at asp.net. Fisrt my apologies for posting such a large amount, I just wanted to give you all the information that I possibly can.
I have the follwoing error "Specified SQL server not found".
Server Error in '/ppasa' Application. --------------------------------------------------------------------------------
[Microsoft][ODBC SQL Server Driver][DBMSLPCN]Specified SQL server not found. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException: [Microsoft][ODBC SQL Server Driver][DBMSLPCN]Specified SQL server not found.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[COMException (0x80004005): [Microsoft][ODBC SQL Server Driver][DBMSLPCN]Specified SQL server not found.] ADODB.ConnectionClass.Open(String ConnectionString, String UserID, String Password, Int32 Options) +0 PPASA.PPASA.OpenCloseDB(Boolean Connect) in c:inetpubwwwrootPPASAPPASA.vb:9 PPASA.Login.btnSubmit_Click(Object sender, EventArgs e) in c:inetpubwwwrootPPASALogin.aspx.vb:38 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33 System.Web.UI.Page.ProcessRequestMain() +1277
-------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573
The process of my application works as follows. 1)Login.aspx submits the username and password. It is linked to Login.aspx.vb with the following statement <%@ Page Language="vb" AutoEventWireup="false" Codebehind="Login.aspx.vb" Inherits="PPASA.Login"%> 2)In Login.aspx.vb (below) has a call to PPASA.vb with the following statement Call OpenCloseDB(True).
Public Class Login Inherits System.Web.UI.Page
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer. <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub Protected WithEvents Label1 As System.Web.UI.WebControls.Label Protected WithEvents Image1 As System.Web.UI.WebControls.Image Protected WithEvents Label2 As System.Web.UI.WebControls.Label Protected WithEvents txtUsername As System.Web.UI.WebControls.TextBox Protected WithEvents Label3 As System.Web.UI.WebControls.Label Protected WithEvents txtPassword As System.Web.UI.WebControls.TextBox Protected WithEvents btnSubmit As System.Web.UI.WebControls.Button Protected WithEvents btnClear As System.Web.UI.WebControls.Button
'NOTE: The following placeholder declaration is required by the Web Form Designer. 'Do not delete or move it. Private designerPlaceholderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init 'CODEGEN: This method call is required by the Web Form Designer 'Do not modify it using the code editor. InitializeComponent() End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Put user code to initialize the page here End Sub
Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit.Click Dim rs As ADODB.Recordset
Call OpenCloseDB(True) rs = cnn.Execute("SELECT ID FROM PPASA_User WHERE Name='" & UCase(txtUsername.Text) & "' AND Password='" & txtPassword.Text & "'") If Not rs.BOF And Not rs.EOF Then Call PopulateUserInfo(rs.Fields(0).Value) Server.Transfer("PPASAMain.aspx") Else Call ClearLoginBoxes() End If Call OpenCloseDB(False)
End Sub
Public Sub PopulateUserInfo(ByVal MyID As Integer)
Dim rs As ADODB.Recordset
Call OpenCloseDB(True) rs = cnn.Execute("SELECT ID,Name,Security FROM PPASA_User WHERE ID=" & MyID) If Not rs.BOF And Not rs.EOF Then rs.MoveFirst() 'CurrentUser.ID = rs.Fields(0).Value 'CurrentUser.Name = rs.Fields(1).Value 'CurrentUser.Security = rs.Fields(2).Value Session.Add("ID", rs.Fields(0).Value) Session.Add("Name", rs.Fields(1).Value) Session.Add("Security", rs.Fields(2).Value) Session.Add("DonorID", 0) End If Call OpenCloseDB(False) End Sub
Private Sub ClearLoginBoxes() txtUsername.Text = "" txtPassword.Text = "" End Sub
Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click Call ClearLoginBoxes() End Sub End Class
3)PPASA.vb then creates the connection to the Database. PPASA.vb looks like this.
Module PPASA
Public cnn As New ADODB.Connection
Public Sub OpenCloseDB(ByVal Connect As Boolean)
If Connect = True Then If cnn.State = 0 Then cnn.Open("Description=PPASA;DRIVER=SQL Server;SERVER=THE-ONESERVERA;UID=sa;PWD=123;APP=Microsoft Data Access Components;DATABASE=PPASA") End If Else If Connect = False Then If cnn.State = 1 Then cnn.Close() End If End If End Sub
Public Function CheckSecurity(ByVal Actual As Integer, ByVal Required As Integer) As Boolean If Actual >= Required Then CheckSecurity = True Else CheckSecurity = False End If End Function End Module
4)After I submit Login.aspx the application boms and gives me the "Specified SQL server not found".
Extra Info:
The Sql server is up and running. I have tested it by connecting with 2 test connection files index.asp and index2 .aspx. Here are the files. The files also return results from the pubs db.
index.asp
<% Set conn = Server.CreateObject("ADODB.Connection") strConn="DRIVER={SQL Server};SERVER=THE-ONESERVERA;UID=sa;PWD=123;DATABASE=pubs"
conn.open strConn
sql = "SELECT * from authors" set rs = conn.Execute(sql) if not rs.EOF then while not rs.EOF lastname = rs("au_lname") firstname = rs("au_fname") response.write "LASTNAME :: " & lastname & " \// FIRSTNAME :: " & firstname & "<br>" rs.movenext wend end if conn.Close() Set conn = Nothing %>
and index2.aspx
<%@ Page aspcompat=true %> <% Dim objConn Dim strConn Dim objRs Dim objCmd Dim objField
If Not objRs.EOF then Do While Not objRs.EOF response.write ("VALUES :: ") For Each objField In objRs.Fields Response.Write (" " & objField.value & " \// ") Next response.write ("<br>") objRs.movenext Loop End if
objConn.Close() %>
There are also the following files in the bin directory. Interop.ADOR.dll Interop.MSChart20Lib.dll Interop.Scripting.dll PPASA.dll utCharting.dll
So my question is this, why do I get the error "Specified SQL server not found", when I dont get the error with the test connection files.? Do I have to do anything with the .dll file in the bin directory, like register them or something? How does the Login.aspx.vb file call the PPASA.vb file when I see no reference to PPASA.vb in the Login.aspx.vb file? I would appreciate any help or suggestions. Thanks
I have 2 server 2003 boxes one has sql 2000 and the other has IIS. I can pull up my pages on the iis server but as soon as my app tries to access the sql server I get cannot find server. All my settings are correct in the web.config file. I do not have this problem with the same setup on server 2000 boxes. Also active dir is not set up on the 2000 or 2003 boxes. Can someone please help. thanx weisenbr
I am trying to connect to my SQL Server through my ASP.NET webpages. My problem is that, no matter what I do, it always says that the server is not found. I know the IP address of my server, and this IP address works from other computers within my network, just not mine.
I have no idea what it could be. If anyone knows, any help would be greatly appriciated.
Hi, i have just started working with asp.net and purchased a book which has MSDE with it for database access. Ihave followed all the instructions on how to install MSDE, however when i try to set up a database using Miscrosoft ASP.NET Web Matrix, i get the error message:Unable to connect to the database server.SQL server does not exist or access denied.ConnectionOpen(Connect()).This message occurs when i am creating a new database.does anyone have any ideas why this may be happening?I have MySQL installed on my computer, could this be interfering with the MSDE ?Thanks....
Sometimes when I try to connect to an existing server (sql 7.0) , I get the error message "specified sql server not found-check registration properties" and it refuses to connect to it. Has anyone encountered this before? Do help.
and i get "[Microsoft][ODBC SQL Server Driver][Named Pipes]Specified SQL server not found."
From my older host I have no problems connecting to my server... so I assumed it must be something at my new host, but I'm able to connect to other remote sql servers from my new isp (for example I can connect from my new ISP to the old ISP's SQL server w/o a problem), but for some reason I can't from the new host connect to mine.. is there a setting on mine that needs to change?
newhostwebsvr to oldhostsql works... oldhostwebsvr to mylocalsql works.. newhostwebsvr to mylocalsql doesn't work??
Hi there, I access to server SQL by an application on web,I configured the ODBC box for using TCP/IP and the server use also the TCP/IP. I have this message :
Microsoft OLE DB Provider for ODBC Drivers error '80004005' [Microsoft][ODBC SQL Server Driver][Named Pipes]Specified SQL server not found. /medecin/IdentificationAcces/membre_enregistrer.asp, line 108
Can somebody help me with the following error while deploying my cube:
The attribute key cannot be found : dbo_fact_table, Column: datetime Value 25/10/1901 4:18:00 pm...
The year 1901 is included in the time period of the time dimension. The calendar includes the following dates : 1/1/1753 - 31/12/2007 (Time binding) Why this referential integrity error occurs ??
Please help me because it is urgent and I cannot find a solution..
Can someone please tell me how to fix this following error in SQL 2005 When trying to create a maintenance plan, Method Not Found:'Void Microsoft.SqlServer.Management.DatabaseMaintenance.TaskUIYtils..ctro()' (Mircosoft.SqlServer.MaintenancePlanTasksUI)
I have got an XP machine where I have installed a SQL Server for mytesting.I recently started working on a vb.net project requiring MSDE. Afterexecuting the Setup, made using Install Shield, including theinstallation of an instance of MSDE I can't start the Query Analyzer onmy "normal" SQL server or any instance, I am having a message saying"the specified file can not be found". I have to do a system restore torecover this functionality.Here is a pic http://www.corobori.com/sos/picSQLMSDE.jpgJean-Lucwww.corobori.com
We have just installed SQL 2005 on a brand new server and have installed our software for our business solution. When I attempt to run the program, it says that it cannot find "ntwdblib.dll" Where is this file? Am I missing a file from the install or what?