Convert VBA Code To SQL Sp
Apr 10, 2008
I'd like to convert this vba code from access to run in sql 2000 and I'm a newbie to vba and am not sure how to do this. can I get the same functionality from an sp?
' Global SYSTEM Variables...
Global GBL_SystemName As String
Global GBL_CommonPath As String
Global GBL_WorkPath As String
Global GBL_DataUpdatePath As String
Global GBL_ArchivePath As String
Global GBL_LiveMarsPath As String
Global GBL_MARS_DSN_Name As String
Global GBL_MARS_DB_Server As String
Global GBL_MARS_DB_Name As String
Global GBL_RawData_DSN_Name As String
Global GBL_RawData_DB_Server As String
Global GBL_RawData_DB_Name As String
' Global CLIENT Variables...
Global GBL_ClientName As String
Global GBL_ClientAbbrev As String
Global GBL_MedisunEligibilityAge As Long
Global GBL_DoctorsManualEntryFlag As String
Global GBL_LastUpdateDate As Date
Global GBL_LastInvoiceGTEDate As Date
Global GBL_LastInvoiceLTEDate As Date
Global GBL_NewInvoiceGTEDate As Date
Global GBL_NewInvoiceLTEDate As Date
Public Function Get_Globals(G_name As String)
Select Case UCase(G_name)
Case UCase("SystemName")
Get_Globals = GBL_SystemName
Case UCase("ClientName")
Get_Globals = GBL_ClientName
Case UCase("ClientAbbrev")
Get_Globals = GBL_ClientAbbrev
Case UCase("MedisunEligibilityAge")
Get_Globals = GBL_MedisunEligibilityAge
Case UCase("LastUpdateDate")
Get_Globals = GBL_LastUpdateDate
Case UCase("LastInvoiceGTEDate")
Get_Globals = GBL_LastInvoiceGTEDate
Case UCase("LastInvoiceLTEDate")
Get_Globals = GBL_LastInvoiceLTEDate
Case UCase("NewInvoiceGTEDate")
Get_Globals = GBL_NewInvoiceGTEDate
Case UCase("NewInvoiceLTEDate")
Get_Globals = GBL_NewInvoiceLTEDate
Case UCase("WorkPath")
Get_Globals = GBL_WorkPath
Case UCase("DataUpdatePath")
Get_Globals = GBL_DataUpdatePath
Case UCase("ArchivePath")
Get_Globals = GBL_ArchivePath
Case UCase("LiveMarsPath")
Get_Globals = GBL_LiveMarsPath
Case UCase("CommonPath")
Get_Globals = GBL_CommonPath
Case UCase("MARS_DSN_Name")
Get_Globals = GBL_MARS_DSN_Name
Case UCase("MARS_DB_Server")
Get_Globals = GBL_MARS_DB_Server
Case UCase("MARS_DB_Name")
Get_Globals = GBL_MARS_DB_Name
Case UCase("RawData_DSN_Name")
Get_Globals = GBL_RawData_DSN_Name
Case UCase("RawData_DB_Server")
Get_Globals = GBL_RawData_DB_Server
Case UCase("RawData_DB_Name")
Get_Globals = GBL_RawData_DB_Name
Case UCase("DoctorsManualEntryFlag")
Get_Globals = GBL_DoctorsManualEntryFlag
End Select
End Function
Public Sub GetProperties(strPropertyTblName As String, Optional strClientCode As String)
' Create database connection and recordset...
Set con = Application.CurrentProject.Connection
Set rs = CreateObject("ADODB.Recordset")
strSQL = "select * from tln_" & strPropertyTblName & "Properties"
If UCase(Trim(strPropertyTblName)) = "CLIENT" Then
strSQL = strSQL & " where CPClientCode = '" & strClientCode & "'"
End If
rs.Open strSQL, con, 1 ' 1 = adOpenKeyset
If Not rs.EOF Then
Do While Not rs.EOF
Select Case UCase(Trim(rs("PropertyName")))
Case UCase("MARS_DSN_Name")
GBL_MARS_DSN_Name = rs("PropertyValue")
Case UCase("MARS_DB_Server")
GBL_MARS_DB_Server = rs("PropertyValue")
Case UCase("MARS_DB_Name")
GBL_MARS_DB_Name = rs("PropertyValue")
Case UCase("RawData_DSN_Name")
GBL_RawData_DSN_Name = rs("PropertyValue")
Case UCase("RawData_DB_Server")
GBL_RawData_DB_Server = rs("PropertyValue")
Case UCase("RawData_DB_Name")
GBL_RawData_DB_Name = rs("PropertyValue")
Case UCase("SystemName")
GBL_SystemName = rs("PropertyValue")
Case UCase("ClientName")
GBL_ClientName = rs("PropertyValue")
Case UCase("ClientAbbrev")
GBL_ClientAbbrev = rs("PropertyValue")
Case UCase("MedisunEligibilityAge")
GBL_MedisunEligibilityAge = rs("PropertyValue")
Case UCase("WorkPath")
GBL_WorkPath = rs("PropertyValue")
If Right(Trim(GBL_WorkPath), 1) <> "" Then
GBL_WorkPath = GBL_WorkPath & ""
End If
Case UCase("DataUpdatePath")
GBL_DataUpdatePath = rs("PropertyValue")
If Right(Trim(GBL_DataUpdatePath), 1) <> "" Then
GBL_DataUpdatePath = GBL_DataUpdatePath & ""
End If
Case UCase("ArchivePath")
GBL_ArchivePath = rs("PropertyValue")
If Right(Trim(GBL_ArchivePath), 1) <> "" Then
GBL_ArchivePath = GBL_ArchivePath & ""
End If
Case UCase("LiveMarsPath")
GBL_LiveMarsPath = rs("PropertyValue")
If Right(Trim(GBL_LiveMarsPath), 1) <> "" Then
GBL_LiveMarsPath = GBL_LiveMarsPath & ""
End If
Case UCase("CommonPath")
GBL_CommonPath = rs("PropertyValue")
If Right(Trim(GBL_CommonPath), 1) <> "" Then
GBL_CommonPath = GBL_CommonPath & ""
End If
Case UCase("DoctorsManualEntryFlag")
GBL_DoctorsManualEntryFlag = UCase(rs("PropertyValue"))
If Trim(GBL_DoctorsManualEntryFlag) = "" Then
GBL_DoctorsManualEntryFlag = "Y"
End If
Case Else
' Invalid property... do nothing...
End Select
rs.MoveNext
Loop
End If
rs.Close
Set rs = Nothing
Set con = Nothing
End Sub
View 13 Replies
ADVERTISEMENT
Jun 24, 2008
Hello does anyone know how to convert this access code to sql. Also is there a program out there that will do it for you.
IIf([Ceridian]![UnionIndicator]="U" And [YearsService]>=3,[HealthBenefits]![medplan.Bi-WeeklyURBio-Rad]*26,[HealthBenefits]![medplan.Bi-WeeklyBio-Rad]*26) AS MedicalCostER, IIf([Ceridian]![UnionIndicator]="U" And [YearsService]>=3,[medplan]![Bi-WeeklyUREE]*26,[medplan]![Bi-WeeklyEE]*26) AS MEdicalCostEE
View 1 Replies
View Related
Jul 5, 2007
Hi, all
I've seach the threads before. a lot of discussion about C# to VSA.
So could anyone with experience on conversion from C# to SSIS/VSA give me a suggestion?
I 've C# code application which complete some ETL process. Now I need to convert all the ETL process to SSIS pacakge. the function of part of C# code is to get the result from stored procedure and then write the result to excel file, not row by row.
the C# code call Microsoft.Office.Interop.Excel as a object to write excel file.
But in VSA, I can't add Microsoft.Office.Interop.Excel as a reference so I can convert C# to VB.net regarding writing excel file.
So any solution about that?
any help will be appreciated.........
View 5 Replies
View Related
Dec 23, 2004
Dear All,
Lately i have started to convert my sql code to stored procedures, however i am still a bit new on this matter.
I have the following Sql Statement which I wish to convert to a stored procedure:-
SELECT MAX(" & id & ") As maxID FROM " & table
where id and table are parameters that I am passing to this sql from a function which is called getMaxID
for example, in the vb.net code i call it as follows:-
getMaxID("personID", "persons")
Can anyone tell me how to convert it to a Stored Proc please
Thanks for your help and time
Johann
View 2 Replies
View Related
Jan 14, 2008
How do I convert for example, a value comming from C# app "TextboxGBDataDeleted" to int column GBdatadeleted? I have a RangeValidator on this textbox to accept only numbers. I don't want to write C# code. I woul prefer to do this is SQL. Thank you.
My SQL update statement:
INSERT INTO KPITbl
(Lead, WRM, PTDB, PAR, PM, RequestingLOB, LOB, StartLocation, FinishLocation, Description, ProjectType, ServerName, ServerType, DCOorSTANDALONE, Responsible,
Status, RAG, StartDates, EndDates, TreeOrDomainImpacted, NumOfSites, NumOfUsers, GBdatamoved, GBdatadeleted, NumOfSrvrsAdded,
NumOfSrvrsDecommed, NumOfAppsDeployed, EUTEngineeringConsult, Comments, TimeSpend, Complexity, ECM, LastUpdated)
VALUES (@Lead,@WRM,@PTDB,@PAR,@PM,@RequestingLOB,@LOB,@StartLocation,@FinishLocation,@Description,@ProjectType,@ServerName,@ServerType,@DCOorSTANDALONE,@Responsible,@Status,@RAG,@StartDates,@EndDates,@TreeOrDomainImpacted,@NumOfSites,@NumOfUsers,@GBdatamoved,@GBdatadeleted,@NumOfSrvrsAdded,@NumOfSrvrsDecommed,@NumOfAppsDeployed,@EUTEngineeringConsult,@Comments,@TimeSpend,@Complexity,@ECM,(getdate() ) )
~~~~~~~~~~~~~~~~~~~~~~MY TABLE~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CREATE TABLE [dbo].[KPITbl](
[TaskID] [int] IDENTITY(1,1) NOT NULL,
[Lead] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[WRM] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[PTDB] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[PAR] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[PM] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[RequestingLOB] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[LOB] [nvarchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[StartLocation] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[FinishLocation] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Description] [nvarchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ProjectType] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ServerName] [nvarchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ServerType] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Responsible] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Status] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[RAG] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[StartDates] [smalldatetime] NULL,
[EndDates] [smalldatetime] NULL,
[TreeorDomainImpacted] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[NumOfSites] [int] NULL,
[NumOfUsers] [int] NULL,
[GBdatamoved] [int] NULL,
[GBdatadeleted] [int] NULL,
[NumOfSrvrsAdded] [int] NULL,
[NumOfSrvrsDecommed] [int] NULL,
[NumOfAppsDeployed] [int] NULL,
[EUTEngineeringConsult] [nvarchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Comments] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[TimeSpend] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Complexity] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[LastUpdated] [smalldatetime] NULL,
[DCOorSTANDALONE] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ECM] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[StatusCompletedDate] [smalldatetime] NULL,
[StatusCancelledDate] [smalldatetime] NULL,
CONSTRAINT [PK_Sheet1a] PRIMARY KEY CLUSTERED
(
[TaskID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
View 4 Replies
View Related
Dec 21, 2000
i had worked on oracle 8i and i am planning to work on sql server 2000,i am requested by a company to help in converting there pl/sql code of oracle 8.0 to something equivalent which works on sql server 7.0 as they want to have similar code on both..i had not worked on sql server 7.0 ,but as pl/sql code works only on oracle stuff..so could kindly anyone guide me in this as to whether there is any product which coverts pl/code (the existing pl/code runs into thousands of line) automatically..i will be very grateful if anyone can enlighten me with such a product(software) or script.. along with its information and site address..any resources and any guidance as to how to go about about this conversion will be very invaluable..hope to hear soon from you guys...early response....will be appreciated..
with regards,
vijay.
sql server 7.0 on winnt
pl/sql code on oracle 8.0
View 2 Replies
View Related
Aug 8, 2006
Hello,
How do I convert VBSCRIPT code in a DTS package which is used for data validation to SQL 2005 SSIS?
Thanks,
Michael
View 2 Replies
View Related
Jul 29, 2015
This is a string i am getting from sql server.
00000006637120150522187449637100 Â 34 Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â
10-000000003444378351108502007 Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â
 01016800002413                                  Â
10-000000091541378538466562009 Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â
 01016800002420                                  Â
                   Â
[Code] .....
View 9 Replies
View Related
Oct 26, 2007
I am having a problem while converting datetime to varchar with code 106. Here is the code and result I get:
TSQL Code:
SELECT CONVERT(VARCHAR(100), GETDATE(), 106)
Result:
"26 10 2007"
My expected result:
"26 Oct 2007" or "26 October 2007"
Have you encountered this problem before? Is it related to the SQL server setting? Please help and thank you in advance.
View 6 Replies
View Related
Jan 17, 2008
Hi all,
I spent about an hour searching the forums and the web but could not find a solution. Bob Bojanic, if you are around can you answer?
I have a DB that stores WW data for company names in a varchar
I don't have control over this DB, other than to pull data from it
I have an SSIS package that grabs WW data in a single pull using a system account
I have an Execute SQL task that runs a sproc to stage the data
I have a Data Flow Task that then copies the data to another server (where I need it)
The destination columns are nvarchar. The source columns are varchar.
Some countries (such as Korea and China) end up with ASCII gibberish (because of code page issues).
I have a solution that involves pulling the data, BCP the pulled data to a text file, then re-import with the correct code page, and delete the gibberish. BUT, I'd like to do this as part of the pull if possible (without any data duplication).
I've tried modifying the CodePage properties for both the Staging step (Execute SQL task running a sproc) and the Source & Dest columns for the Data Flow Task with no luck. Can anyone assist? Thanks much!
Brian
View 9 Replies
View Related
Aug 15, 2006
Dear Experts,Ok, I hate to ask such a seemingly dumb question, but I'vealready spent far too much time on this. More that Iwould care to admit.In Sql server, how do I simply change a character into a number??????In Oracle, it is:select to_number(20.55)from dualTO_NUMBER(20.55)----------------20.55And we are on with our lives.In sql server, using the Northwinds database:SELECTr.regionid,STR(r.regionid,7,2) as a_string,CONVERT(numeric, STR(r.regionid,7,2)) as a_number,cast ( STR(r.regionid) as int ) as cast_to_numberFROM REGION R1 1.00112 2.00223 3.00334 4.0044SELECTr.regionid,STR(r.regionid,7,2) as a_string,CONVERT(numeric, STR(r.regionid,7,2) ) as a_number,cast (STR(r.regionid,7,2) as numeric ) as cast_to_numberFROM REGION R1 1.00112 2.00223 3.00334 4.0044Str converts from number to string in one motion.Isn't there a simple function in Sql Server to convertfrom string to number?What is the secret?Thanks
View 4 Replies
View Related
Jul 27, 2006
Hi all--I'm trying to convert a function which I inherited from a SQL Server 2000 DTS package to something usable in an SSIS package in SQL Server 2005. Given the original code here:
Function Main()
on error resume next
dim cn, i, rs, sSQL
Set cn = CreateObject("ADODB.Connection")
cn.Open "Provider=sqloledb;Server=<server_name>;Database=<db_name>;User ID=<sysadmin_user>;Password=<password>"
set rs = CreateObject("ADODB.Recordset")
set rs = DTSGlobalVariables("SQLstring").value
for i = 1 to rs.RecordCount
sSQL = rs.Fields(0).value
cn.Execute sSQL, , 128 'adExecuteNoRecords option for faster execution
rs.MoveNext
Next
Main = DTSTaskExecResult_Success
End Function
This code was originally programmed in the SQL Server ActiveX Task type in a DTS package designed to take an open-ended number of SQL statements generated by another task as input, then execute each SQL statement sequentially. Upon this code's success, move on to the next step. (Of course, there was no additional documentation with this code. :-)
Based on other postings, I attempted to push this code into a Visual Studio BI 2005 Script Task with the following change:
public Sub Main()
...
Dts.TaskResult = Dts.Results.Success
End Class
I get the following error when I attempt to compile this:
Error 30209: Option Strict On requires all variable declarations to have an 'As' clause.
I am new to Visual Basic, so I'm on a learning curve here. From what I know of this script:
- The variables here violate the new Option Strict On requirement in VS 2005 to declare what type of object your variable is supposed to use.
- I need to explicitly declare each object, unless I turn off the Option Strict On (which didn't seem recommended, based on what I read).
Given this statement:
dim cn, i, rs, sSQL
I'm looking at "i" as type Integer; rs and sSQL are open-ended arrays, but can't quite figure out how to read the code here:
Set cn = CreateObject("ADODB.Connection")
cn.Open "Provider=sqloledb;Server=<server_name>;Database=<db_name>;User ID=<sysadmin_user>;Password=<password>"
set rs = CreateObject("ADODB.Recordset")
This code seems to create an instance of a COM component, then pass provider information and create the recordset being passed in by the previous task, but am not sure whether this syntax is correct for VS 2005 or what data type declaration to make here. Any ideas/help on how to rewrite this code would be greatly appreciated!
View 7 Replies
View Related
Mar 28, 2007
Dear Friends,
I am having 2 Tables.
Table 1: AddressBook
Fields --> User Name, Address, CountryCode
Table 2: Country
Fields --> Country Code, Country Name
Step 1 : I have created a Cube with these two tables using SSAS.
Step 2 : I have created a report in SSRS showing Address list.
The Column in the report are User Name, Address, Country Name
But I have no idea, how to convert this Country Code to Country name.
I am generating the report using the Layout tab. ( Data | Layout | Preview ) Report1.rdl [Design]
Anyone help me to solve this issue. Because, in our project most of the transaction tables have Code and Code description in master table. I need to convert all code into corresponding description in all my reports.
Thanks in advance.
Regards
Ramakrishnan
Singapore
28 March 2007
View 4 Replies
View Related
Feb 24, 2008
Hello,
I'm using ASP.Net to update a table which include a lot of fields may be around 30 fields, I used stored procedure to update these fields. Unfortunatily I had to use a FormView to handle some TextBoxes and RadioButtonLists which are about 30 web controls.
I 've built and tested my stored procedure, and it worked successfully thru the SQL Builder.The problem I faced that I have to define the variable in the stored procedure and define it again the code behind againALTER PROCEDURE dbo.UpdateItems
(
@eName nvarchar, @ePRN nvarchar, @cID nvarchar, @eCC nvarchar,@sDate nvarchar,@eLOC nvarchar, @eTEL nvarchar, @ePhone nvarchar,
@eMobile nvarchar, @q1 bit, @inMDDmn nvarchar, @inMDDyr nvarchar, @inMDDRetIns nvarchar,
@outMDDmn nvarchar, @outMDDyr nvarchar, @outMDDRetIns nvarchar, @insNo nvarchar,@q2 bit, @qper2 nvarchar, @qplc2 nvarchar, @q3 bit, @qper3 nvarchar, @qplc3 nvarchar,
@q4 bit, @qper4 nvarchar, @pic1 nvarchar, @pic2 nvarchar, @pic3 nvarchar, @esigdt nvarchar, @CCHName nvarchar, @CCHTitle nvarchar, @CCHsigdt nvarchar, @username nvarchar,
@levent nvarchar, @eventdate nvarchar, @eventtime nvarchar
)
AS
UPDATE iTrnsSET eName = @eName, cID = @cID, eCC = @eCC, sDate = @sDate, eLOC = @eLOC, eTel = @eTEL, ePhone = @ePhone, eMobile = @eMobile,
q1 = @q1, inMDDmn = @inMDDmn, inMDDyr = @inMDDyr, inMDDRetIns = @inMDDRetIns, outMDDmn = @outMDDmn,
outMDDyr = @outMDDyr, outMDDRetIns = @outMDDRetIns, insNo = @insNo, q2 = @q2, qper2 = @qper2, qplc2 = @qplc2, q3 = @q3, qper3 = @qper3,
qplc3 = @qplc3, q4 = @q4, qper4 = @qper4, pic1 = @pic1, pic2 = @pic2, pic3 = @pic3, esigdt = @esigdt, CCHName = @CCHName,
CCHTitle = @CCHTitle, CCHsigdt = @CCHsigdt, username = @username, levent = @levent, eventdate = @eventdate, eventtime = @eventtime
WHERE (ePRN = @ePRN)
and the code behind which i have to write will be something like thiscmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@eName", ((TextBox)FormView1.FindControl("TextBox1")).Text);cmd.Parameters.AddWithValue("@ePRN", ((TextBox)FormView1.FindControl("TextBox2")).Text);
cmd.Parameters.AddWithValue("@cID", ((TextBox)FormView1.FindControl("TextBox3")).Text);cmd.Parameters.AddWithValue("@eCC", ((TextBox)FormView1.FindControl("TextBox4")).Text);
((TextBox)FormView1.FindControl("TextBox7")).Text = ((TextBox)FormView1.FindControl("TextBox7")).Text + ((TextBox)FormView1.FindControl("TextBox6")).Text + ((TextBox)FormView1.FindControl("TextBox5")).Text;cmd.Parameters.AddWithValue("@sDate", ((TextBox)FormView1.FindControl("TextBox7")).Text);
cmd.Parameters.AddWithValue("@eLOC", ((TextBox)FormView1.FindControl("TextBox8")).Text);cmd.Parameters.AddWithValue("@eTel", ((TextBox)FormView1.FindControl("TextBox9")).Text);
cmd.Parameters.AddWithValue("@ePhone", ((TextBox)FormView1.FindControl("TextBox10")).Text);
cmd.Parameters.AddWithValue("@eMobile", ((TextBox)FormView1.FindControl("TextBox11")).Text);
So is there any way to do it better than this way ??
Thank you
View 2 Replies
View Related
Oct 16, 2007
Hi all,
Could someone tell me if custom code function can capture the event caused by a user? For example, onclick event on the rendered report?
Also, can custom code function alter the parameters of the report, or refresh the report?
Thanks.
View 2 Replies
View Related
Jan 25, 2007
Hi,I need some help here. I have a SELECT sql statement that will query the table. How do I get the return value from the sql statement to be assigned to a label. Any article talk about this? Thanks geniuses.
View 2 Replies
View Related
Apr 19, 2006
Hi:
My service broker is working with 2 different instances in local server.But could not able to get working on 2 different servers because of Conversation ID cannot be associated with an active conversation error which I have posted.
After I receive the message successfully...in the end I get this message sent...
<Error xmlns="http://schemas.microsoft.com/SQL/ServiceBroker/Error">
<Code>-8462</Code>
<Description>The remote conversation endpoint is either in a state where no more messages can be exchanged, or it has been dropped.</Description>
</Error>
Why am i gettting this error after the conversation.
Thanks,
Pramod
View 7 Replies
View Related
Jan 28, 2008
Hi All,
Recently in an SSIS package I am getting the following error for a particular Data flow task.
Error: 2008-01-25 12:01:48.58
Code: 0xC0202009
Source: Import Datasynapse Data User Events Source [3017]
Description: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x8000FFFF.
End Error
Error: 2008-01-25 12:01:48.73
Code: 0xC004701A
Source: Import Datasynapse Data DTS.Pipeline
Description: component "User Events Source" (3017) failed the pre-execute phase and returned error code 0xC0202009.
End Error
Our guess is when the data size of User Events table is more it throws this error. If we try to transfer small subset of data it succeeds. What could be reason for this error?
Since this is very urgent, immediate response would be very much appreciated.
Thanks & Regards,
Prakash Srinivasan
View 4 Replies
View Related
Sep 26, 2007
select convert(varchar(16), getdate(), 101)+LEFT(REPLACE(convert(varchar, getdate(), 108), ':', ''),4)
From above query I get
mmddyyyyhhmm
but it' s yyyy and hour can not be separated
04/12/200702:05
How can I separated the year and hour ?
Thanks
Daniel
View 2 Replies
View Related
Jul 29, 2007
hi all,
I'm using visual web developer and created a project with a mdf data file. how can I convert this file to MS ACCESS mdb file?
Thanks
View 3 Replies
View Related
Oct 3, 2007
hi friends i am using vwd 2005 i created a project now i want to upload it on the server, but i want which database i used in the database convert it into .bak file for upload it on the server how i convert it, i don't have MS SQL SERVER 2005 or any except vwd 2005.
View 1 Replies
View Related
Nov 1, 2007
how to convert msaccess 2003 data to sqlserver 2005
View 1 Replies
View Related
Jan 29, 2008
Hi all,
How to convert varchar value to int in SQL Server2000?
For example i'm having the varchar value '1,2,3,4'
i want to convert this to 1,2,3,4 that is i want to remove single quote (') at the start and end of the varchar value,
how to do this?
Thanks!
View 5 Replies
View Related
Mar 6, 2008
Hello! I need help to change this to @@Identity..Thanks! protected void Button2_Click(object sender, EventArgs e) {
SqlConnection con = new
SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["ThesisConnectionString"].ToString()); con.Open(); SqlCommand com1 = new SqlCommand(); com1.Connection = con; com1.CommandText = "Insert into TransactionHeader values ('" + DateTime.Now + "', '" + DropDownList1.SelectedValue + "', '" + TextBox1.Text + "', '" + TextBox4.Text + "', '" + TextBox9.Text + "', '" + TextBox11.Text + "', '" + TextBox12.Text + "');select scope_identity() as returnidentity"; string xyz = Convert.ToString(com1.ExecuteScalar()); DataTable dt = (DataTable)Session["shoppingCart"]; for (int i = 0; i <= dt.Rows.Count - 1; i++) { String WasteType = dt.Rows[i][0].ToString(); double Volume = double.Parse(dt.Rows[i][1].ToString()); double Fees = double.Parse(dt.Rows[i][2].ToString()); double total = Volume * Fees; SqlCommand com = new SqlCommand(); com.Connection = con; com.CommandText = "Insert into TransactionDetail values ('" + xyz + "', '" + WasteType + "', '" + Volume + "', '" + total + "')"; com.ExecuteNonQuery(); ClientScript.RegisterStartupScript(GetType(), "save", "alert('Record Saved');", true); } }
View 2 Replies
View Related
May 24, 2004
How can I convert a date to MMDDYY with Convert()?
View 3 Replies
View Related
Jun 18, 2004
Hi, I am new to Sql.
My question is how to convert nvarchar like this "Wed Jun 16 19:14:23 2004 GMT" to standard datetime format?
Thanks!
View 2 Replies
View Related
Nov 15, 2001
Hi,
Can anyone tell me, how can I get the date format in YYYYMMDDHHMISS format.
For Ex: select convert(char(12),getdate(),112) gives me the result as
'20011115'. Now, how can I get the the result something like '20011115110020'?
View 3 Replies
View Related
May 24, 2001
If I do a query from SQL 7.0 and get the result "10" which is a hex value (0x0A), how do I convert this using something like convert or cast to show "a"
Is there anywhere that I can look for help? I can get it to show 0x0A using cast, but that is not what I want. I want a hex number without 0X0 in front of A. The A I can convert using something like Lower(A)
Thank you.
View 1 Replies
View Related
Oct 11, 2001
Hi, I am trying to convert 2 columns from varchar(255) to datetime, the format of the data in the columns is '02/02/2001', and 1 column from varchar(255) to money, the format of the data in this column is '12,340.00'.
When I run : select convert(datetime, Col004), convert(datetime, Col005), convert(money, Col007) from table1
I get a result upto 59,996 rows then get the error:
Syntax error converting datetime from character string.
Any help would be appreciated, I have to convert 4 tables with, 722834, 1113978, 115489 and 121983 rows respectivly.
View 3 Replies
View Related
Jun 2, 1999
Is there a way to install MS SQL 6.5 twice on the same server? I would like to install SQL into the following dorectories D:MSSQL and D:MSSQL2. Any help would be appreciated.
View 5 Replies
View Related
Sep 24, 2004
can anybody convert this to T-SQl :
Select decode(trunc((d_vst_btcdte - nvl(n_per_birth,d_vst_btcdte))/10000,0),0,'no DOB',
14,'14-16',15,'14-16',16,'14-16',
17,'17-20',18,'17-20',19,'17-20',20,'17-20',
21,'21-25',22,'21-25',23,'21-25',24,'21-25',25,'21-25',
26,'26-30',27,'26-30',28,'26-30',29,'26-30',30,'26-30',
31,'31-35',32,'31-35',33,'31-35',34,'31-35',35,'31-35',
36,'36-40',37,'36-40',38,'36-40',39,'36-40',40,'36-40',
41,'41-45',42,'41-45',43,'41-45',44,'41-45',45,'41-45',
46,'46-50',47,'46-50',48,'46-50',49,'46-50',50,'46-50',
51,'51-55',52,'51-55',53,'51-55',54,'51-55',55,'51-55',
56,'56-60',57,'56-60',58,'56-60',59,'56-60',60,'56-60',
61,'61-65',62,'61-65',63,'61-65',64,'61-65',65,'61-65',
66,'66-70',67,'66-70',68,'66-70',69,'66-70',70,'66-70',
'71+') AGE
View 1 Replies
View Related
Oct 12, 2004
Can anybody convert to T-SQL;
select distinct to_char(sysdate,'FMDAY, MONTH DD, YYYY HH:FMMIAM') TODAY
, d_aaa_insthdg CNTRHD
, decode(trunc((d_vst_btcdte - nvl(n_per_birth,d_vst_btcdte))/10000,0),0,'no DOB',
14,'14-16',15,'14-16',16,'14-16',
17,'17-20',18,'17-20',19,'17-20',20,'17-20',
21,'21-25',22,'21-25',23,'21-25',24,'21-25',25,'21-25',
26,'26-30',27,'26-30',28,'26-30',29,'26-30',30,'26-30',
31,'31-35',32,'31-35',33,'31-35',34,'31-35',35,'31-35',
36,'36-40',37,'36-40',38,'36-40',39,'36-40',40,'36-40',
41,'41-45',42,'41-45',43,'41-45',44,'41-45',45,'41-45',
46,'46-50',47,'46-50',48,'46-50',49,'46-50',50,'46-50',
51,'51-55',52,'51-55',53,'51-55',54,'51-55',55,'51-55',
56,'56-60',57,'56-60',58,'56-60',59,'56-60',60,'56-60',
61,'61-65',62,'61-65',63,'61-65',64,'61-65',65,'61-65',
66,'66-70',67,'66-70',68,'66-70',69,'66-70',70,'66-70',
'71+') AGE
, sum(decode(d_vst_dontyp,'WB',1,0)) DRAW1
, sum(decode(d_vst_dontyp,'xx',1,1)) TOTAL0
View 1 Replies
View Related
Feb 20, 2008
dear all,
i have an XML that i want to create a database for it, so depending on this XML i need to create the right tables to store the information in tables and then call these info from the database instead of from XML.
it is a big XML but here is just one part, the other parts are the same:
<?xml version="1.0" encoding="UTF-8" ?>
- <RENTETARIEVEN date="04-12-2007 00:00">
- <GELDVERSTREKKER mvcode="AA" naam="ABN AMRO">
- <HYPVORM mvcode="aflosvrij">
- <PRODUCT mvcode="2000" mvproductcode="197" naam="Aflossingsvrije hypotheek" renteaangepast="4-10-2007">
- <VARIABEL>
<NHG>5.4</NHG>
<EW ew="75">5.6</EW>
<EW ew="90">5.9</EW>
<EW ew="100">5.9</EW>
<EW ew="125">5.9</EW>
</VARIABEL>
+ <VAST periode="1">
+ <VAST periode="2">
+ <VAST periode="3">
+ <VAST periode="5">
+ <VAST periode="6">
+ <VAST periode="7">
+ <VAST periode="10">
+ <VAST periode="12">
+ <VAST periode="15">
+ <VAST periode="20">
+ <VAST periode="25">
+ <VAST periode="30">
+ <PRODUCT mvcode="XX" mvproductcode="9045" naam="Internet hypotheek" overbrugging="6.6" renteaangepast="3-12-2007">
+ <HYPVORM mvcode="annuiteit">
+ <PRODUCT mvcode="1000" mvproductcode="286" naam="Annuïteitenhypotheek" renteaangepast="4-10-2007">
- <VARIABEL>
<NHG>5.4</NHG>
<EW ew="75">5.6</EW>
<EW ew="90">5.9</EW>
<EW ew="100">5.9</EW>
<EW ew="125">5.9</EW>
</VARIABEL>
- <VAST periode="1">
<NHG>5.3</NHG>
<EW ew="75">5.5</EW>
<EW ew="90">5.6</EW>
<EW ew="100">5.6</EW>
<EW ew="125">5.8</EW>
</VAST>
- <VAST periode="2">
<NHG>5.3</NHG>
<EW ew="75">5.5</EW>
<EW ew="90">5.6</EW>
<EW ew="100">5.6</EW>
<EW ew="125">5.8</EW>
</VAST>
- <VAST periode="3">
<NHG>5.3</NHG>
<EW ew="75">5.5</EW>
<EW ew="90">5.6</EW>
<EW ew="100">5.6</EW>
<EW ew="125">5.8</EW>
</VAST>
- <VAST periode="5">
<NHG>5.3</NHG>
<EW ew="75">5.5</EW>
<EW ew="90">5.6</EW>
<EW ew="100">5.6</EW>
<EW ew="125">5.8</EW>
</VAST>
- <VAST periode="6">
<NHG>5.3</NHG>
<EW ew="75">5.5</EW>
<EW ew="90">5.6</EW>
<EW ew="100">5.6</EW>
<EW ew="125">5.8</EW>
</VAST>
- <VAST periode="7">
<NHG>5.4</NHG>
<EW ew="75">5.6</EW>
<EW ew="90">5.7</EW>
<EW ew="100">5.7</EW>
<EW ew="125">5.9</EW>
</VAST>
- <VAST periode="10">
<NHG>5.4</NHG>
<EW ew="75">5.6</EW>
<EW ew="90">5.7</EW>
<EW ew="100">5.7</EW>
<EW ew="125">5.9</EW>
</VAST>
- <VAST periode="12">
<NHG>5.5</NHG>
<EW ew="75">5.7</EW>
<EW ew="90">5.8</EW>
<EW ew="100">5.8</EW>
<EW ew="125">6</EW>
</VAST>
- <VAST periode="15">
<NHG>5.6</NHG>
<EW ew="75">5.8</EW>
<EW ew="90">5.9</EW>
<EW ew="100">5.9</EW>
<EW ew="125">6.1</EW>
</VAST>
- <VAST periode="20">
<NHG>5.7</NHG>
<EW ew="75">5.9</EW>
<EW ew="90">6</EW>
<EW ew="100">6</EW>
<EW ew="125">6.2</EW>
</VAST>
- <VAST periode="25">
<NHG>5.7</NHG>
<EW ew="75">5.9</EW>
<EW ew="90">6</EW>
<EW ew="100">6</EW>
<EW ew="125">6.2</EW>
</VAST>
- <VAST periode="30">
<NHG>5.8</NHG>
<EW ew="75">6</EW>
<EW ew="90">6.1</EW>
<EW ew="100">6.1</EW>
<EW ew="125">6.3</EW>
</VAST>
</PRODUCT>
</HYPVORM>
- <HYPVORM mvcode="beleggers">
+ <PRODUCT mvcode="XX" mvproductcode="9050" naam="Internet hypotheek" overbrugging="6.6" renteaangepast="3-12-2007">
+ <VARIABEL>
+ <HYPVORM mvcode="hybride">
+ <PRODUCT mvcode="4000" mvproductcode="2316" naam="Meegroeihypotheek" renteaangepast="4-10-2007">
+ <HYPVORM mvcode="lineair">
- <PRODUCT mvcode="6000" mvproductcode="2509" naam="Lineaire hypotheek" renteaangepast="4-10-2007">
+ <VARIABEL>
+ <HYPVORM mvcode="spaar">
- <PRODUCT mvcode="7000" mvproductcode="3110" naam="Meegroeihypotheek" renteaangepast="4-10-2007">
+ <PRODUCT mvcode="7109" mvproductcode="7687" naam="Spaargroeihypotheek" renteaangepast="4-10-2007">
+ <HYPVORM mvcode="tradleven">
+ <PRODUCT mvcode="5000" mvproductcode="3214" naam="Levensverzekeringhypotheek" renteaangepast="4-10-2007">
+ <HYPVORM mvcode="unitlink">
+ <PRODUCT mvcode="8000" mvproductcode="1486" naam="Meegroeihypotheek" renteaangepast="4-10-2007">
</PRODUCT>
</HYPVORM>
</GELDVERSTREKKER>
i already started creating some tables but i need to know some good practice to o this. any help will be very appriciated
thanks
View 3 Replies
View Related