Help For T-SQL Code Generator For DataMart

Jul 18, 2006

I replicated a table from DW to DM

but i filtered the table by month.

 

now i have several  tables with the same schema on the datamart

the table has five keys. what i want to do is to write a

sqlwizard code that will automatically write an update statement from the replicated

table. What the wizard will do is read the fields of the DM table then identify the keys and

generate the source code for update.

 

lets name the proc sqlwiz

exec sqlwiz (DMtable1,dwtable1)

the sp should return the desired update statement like this

                  update dmtable1  set    DM.nonkeyfield1= dw.nonkeyfield1,


                                          DM.nonkeyfield2= dw.nonkeyfield2,

                                         DM.nonkeyfield3= dw.nonkeyfield3

                                          from dwtable1 dw where

                                         dm.keyfield1=dw.keyfield1 and

                                         dm.keyfield2=dw.keyfield2

 

pls use any of the northwind table with composite pk.

my DM is sql2k5. 

 

the sp can also be used for generating update codes for vb.net

 

thanks,

joey

 

 

 

 

 

 

 

 

 

 

 

 

 

View 1 Replies


ADVERTISEMENT

CRUD Stored Procedure Code/Scripts Generator For SQL SERVER 2005

Apr 19, 2007

I need a simple anf functionally CRUD Stored Procedure Code/Scripts Generator.
Anyone have a solution?
Thanks in Advance.

View 4 Replies View Related

Data Warehouses Vs DataMart

Apr 30, 2002

I'm working in an area where we have multiple data warehouses which feed into a single datamart. I'm trying to find the most common 'definition' of a data warehouse and a datamart.

Thanks in advance!

View 2 Replies View Related

Results From Cube And Underlying Datamart Are Not Matching - Urgent Please

Apr 14, 2004

When I check the totals for various dimensions in the database which is used for my cube, I get the correct results (I have tallied them with the results from my OLTP)...


But when I browse my cube (using the same parameters, or should i say dimension combination) i get different results as compared to what I mentioned earlier :confused:

Please guide/help.

View 2 Replies View Related

C# Generator

May 16, 2002

The VB code was ok if you wanted it to be basic but when I was using it and trying to get it to work into my project it was quite painful. So in retrospect I have gone back to C# ... so I can have operator overloading plus smaller code anyhow ... will post here new routine ... working on one that will convert a stored procedure to a function as well...
...
I still have the old code if anyone is interested, but like I said ... it's not very robust and getting it there in VB.NET just was a bigger pain than I need at the moment ...

Edited by - onamuji on 05/23/2002 13:05:52

View 2 Replies View Related

SQL Generator

Jul 20, 2006

Hi,This may be a little OT, but I don't know exactly where else to postit. I am writing a little parser that generates valid SQL using"English like" text. I want to use this to allow non-technical users tobe able to quickly write their own queries, to search through adatabase that stores information about the sales of differentcompanies. I can provide more information for anyone who wants to help.Currently, the syntax is :Select ALL PRODUCT_FILTER from COMPANY where funcname(params) conditon.... and ITEM_DATE date_conditionWhere:product_filter specifies the product type to be included in the searchcompany specifies the company whose data is to be searchedfuncname is an aggregate functioncondition specifies the criteria for the aggregate function (i.e. aHAVING clause)date_condition specifies the criteria for the dates to be used in thesearchNote: there can be more than 1 aggregate functionA typical query then may look like this:Select all 'toys' from 'Walmart' where average_sales(100) 100000 andavaerage_cost(100,10) <= 1 and item_date between "01-Jan-00" and"01-Jan-06"I would like to know what the underlying SQL statement will look like,so that I can use this knowlege to build a generic parser that createsSQL statements from the "English like" text, using the syntax Idescribed above.

View 1 Replies View Related

Rdl Generator

Sep 19, 2007

HI all
im new to sql reporting services, im in need of a rdl (report definition language)generator
are there any resouirces out there on the net ?
if so , can u suggest some links for the same?
thanks in advance !

View 10 Replies View Related

Report Generator

Sep 1, 2004

Hello, I am new to MS SQL. I primarily used MySql, but my employer has MS SQL so i am trying to learn this. I kind of assumed that this was going to be similar to MSACCESS. My question is this. In access its easy to make forms and generate reports. Is there an "add-on" that makes it just as easy in MS SQL?

I see Crystal reports mentioned, but don't think my company would spend more money on this project.

Any help/Advice is greatly appreciated.

thanks

View 2 Replies View Related

C# Generator Script...

Nov 26, 2003

I used to have the script mentioned in this post:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=15980&SearchTerms=c#

I can't seem to find it and the link is no longer valid. Does anyone happen to have a copy of this script? I'd like to check it out again (finally starting to do regular C# programming here at work).

Thanks!

Kyle Heon
PixelMEDIA, Inc.
Senior Application Programmer, MCP
kheon@pixelmedia.com

View 6 Replies View Related

Sequence Generator

Jun 19, 2006

Hello,Since SQL Server has no sequence generator, I wrote my own. (I claimno ownership of it as it is closely modeled after earlier discussionson this topic.) I have included the sql statements below.While it works independently on its own, It seems to lock in multi-userenvironments or in nested-transactions. It s funny really: I have mymain transaction, but the sequence generator below forces anothertransaction, which I do not really care for. I cannot remove the extratransaction from the sequence generator because I would like to discardany values it retrieved, regardless of whether the main transactionsucceeded or failed.Any suggestions?--------------------------------------------------------------------------------create table my_sequence (name varchar(10), seq int identity (1, 1))godeclare @next intbegin transactionupdate my_sequence set seq = seq + 1 where name = 'abc';select @next = seq from my_sequence where name = 'abc';commit transaction---------------------------------------------------------

View 6 Replies View Related

Automatic Query Generator

Apr 6, 2007

In my final project, the biggest time consuming issue was writing a query, when there are 15 fields on the average than it is certainly not easy to write an SQL statement and run it (through code)

So I want to know, is there any automatic query generator ?
that could work like:
1) We enter all control names 1 by 1
2) we enter postfix text ( like .Trim(), .ToString() ) etc
3) Result should be automatically generated query

Is there any software/program for that ???

Infact it is very easy to develop myself, but I dont want to waste the time if such tool (most probably) already exists

View 1 Replies View Related

Random Number Generator

Feb 23, 2005

i have an application that uses a table for login access, for security reason i need to get a random numbers in this table daily. table consist of just two columns, userid and password. This table will be printed out on the web for users to get valid username and pw daily.
I m thinking about a job or dts package that will run once daily with a sql script to generate random number (referable 5 digit-letters and numbers), delete the table and re-create the table with same set column names and insert the random values in username and pw column.
Will appreciate help on this

Thanks

View 1 Replies View Related

Query/Workload Generator

Jul 23, 2005

Hello,- Is any body aware of a random workload/query generator such as theTPC-H query generator (QGEN) ? I am looking for a query generator thattakes a schema as an input, and produces several queries.I need it mainly for performance evaluation. the generator I am lookingfor should produce SELECT queries, including joins, and not only INSERTINTO, DELETE, UPDATE queries such as the "SqlQueryGenerator" athttp://www.tucows.com/preview/297930ThanksRegards,Abdur-Rahman

View 2 Replies View Related

Stored Procedure Generator

Nov 8, 2007

I have only been into SQL Server for a few months, and written severalstored procedures. Is there a good software product available that willgenerate the SQL code for a stored procedure based on a visual interface?Any help is appreciated.

View 1 Replies View Related

Random Number Generator

Sep 28, 2007

In a Name table, I need to generate unique 6 digit random numbers in a field called UniqueID for all records that have the ID field populated.
I will need to run this script periodically. It is critical that any prevoiusly assigned UniqueIDs do not change and only fields that have an empty UniqueID field are updated. I need to preserve the historical mapping of the existing IDs to the ongoing assignment of UniqueIDs.

Regards,

Polar Bear

View 3 Replies View Related

Automatic Sql Script Generator For Replications

Jan 21, 2005

Hi,

I need a solution ( if this is possible) to automatically generate create scripts for my replications on our live server and put that into a file.
I dont have permission to scrip that from the Enterprise Managger, but the support have and can make a job in the live server for this.
So that would be enough for me to put a job to the live server what puts the scripts to a file.
I want to use the same replications in my test environmnet, and they are always changing and I dont want to wait for the support.

I have an idea, but I still dont try it:
If I run a trace, when i push the generate sql script button, maybe I can get the code for the generating the create script.
:confused:

Is there a simple solution for this problem, or I have to get it from the trace ?
Thanx!

Tsabi

View 2 Replies View Related

SqlSpec - Database Documentation Generator

Aug 28, 2006

Just a quick note to let you all know about a shareware app I have written called SqlSpec. It generates docs for any SQL Server 2000 or 2005 database, together with dependency diagrams, and lots more. It has very good reviews from the people who have tried it out so far.

If you are looking for a very good and reasonably priced doc generator for you databases, why not take a look?

You can find out more here: www.elsasoft.org (http://www.elsasoft.org/default.htm?referrer=jezemine).

Thanks!

View 1 Replies View Related

Need Script Generator For DBCC Indexdefrag

Jul 28, 2004

Friends

I want to run DBCC INDEXDEFRAG(Db_name, Tab, Idx) for many of the databases . Number is huge and it is near impossible to go to each server and do a manual run. Can someone provide me a scrip to generate the above syntex for all the tables in a db?

Thanks

View 7 Replies View Related

Truth Table Generator For Any Base!

Jul 25, 2007

This little handy algorithm provides a truth table for any range of numbers between 0 and 65535 of any base between 2 and 36!
As a twist, you can either return the digits concatenated or as separate columns.CREATE PROCEDURE dbo.uspTruthTable
(
@FromNumber SMALLINT = 0,
@ToNumber INT = 255,
@Step INT = 1,
@Base TINYINT = 2,
@Concat BIT = 0
)
AS

SET NOCOUNT ON

DECLARE @Temp INT,
@SQL VARCHAR(8000),
@b VARCHAR(12),
@d VARCHAR(2),
@Diff INT,
@Digits CHAR(36)

IF @FromNumber > @ToNumber
SELECT@Temp = @FromNumber,
@FromNumber = @ToNumber,
@ToNumber = @Temp

IF @FromNumber < 0
BEGIN
RAISERROR('The parameter FromNumber %d is less than 0 (base 10).', 16, 1, @FromNumber)
RETURN
END

IF @ToNumber > 65535
BEGIN
RAISERROR('The parameter ToNumber %d is greater than 65535 (base 10).', 16, 1, @ToNumber)
RETURN
END

IF @Base < 2
BEGIN
RAISERROR('The parameter Base %d is less than 2 (base 10).', 16, 1, @Base)
RETURN
END

IF @Base > 36
BEGIN
RAISERROR('The parameter Base %d is greater than 36 (base 10).', 16, 1, @Base)
RETURN
END

SELECT@SQL = '',
@Temp = FLOOR(LOG(@ToNumber) / LOG(@Base)),
@Diff = @ToNumber - @FromNumber + 1,
@Digits = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'

WHILE @Temp >=0
SELECT@b = CONVERT(VARCHAR, @Base),
@d = CONVERT(VARCHAR, @Temp),
@SQL = @SQL +CASE
WHEN @Concat = 1 THEN '+SUBSTRING(''' + @Digits + ''',1 + Number/POWER(' + @b + ',' + @d + ') % ' + @b + ', 1)'
ELSE ',SUBSTRING(''' + @Digits + ''',1 + Number/POWER(' + @b + ',' + @d + ') % ' + @b + ', 1) AS Digit' + @d
END,
@Temp = @Temp - 1

CREATE TABLE#Numbers
(
Number INT PRIMARY KEY
)

INSERT#Numbers
(
Number
)
VALUES(
@FromNumber
)

WHILE @Step <= @Diff
BEGIN
INSERT#Numbers
SELECT@Step + Number
FROM#Numbers
WHERENumber <= @ToNumber - @Step

SET@Step = @Step * 2
END

IF @Concat = 1
SET @SQL = 'SELECT Number, ''''' + @SQL + ' AS Digits FROM #Numbers ORDER BY Number'
ELSE
SET @SQL = 'SELECT Number' + @SQL + ' FROM #Numbers ORDER BY Number'

EXEC (@SQL)

DROP TABLE #NumbersYou can use the algorithm like these examplesEXEC dbo.uspTruthTable
EXEC dbo.uspTruthTable 0, 255, 1, 8
EXEC dbo.uspTruthTable DEFAULT, 15, 1, 2
E 12°55'05.76"
N 56°04'39.42"

View 2 Replies View Related

Optimal Configuration For Report Generator

Jul 23, 2005

I am working with a report generator that is based on SQL Server 2000 anduses ASP as the UI. Basically we have a set of reports that end users canexecute through a web browser. In general the model works fine, but we arerunning into some scaling issues.What I'm trying to determine is, what is the optimal configuration for thissystem. It is currently a 2.4G Pentium with a large RAID and 1G of RAM. Wehave been using the "fixed" memory configuration, allocating 864M to SQL.This is on a Windows 2003 server box.This works fine when a "small" query or two is executed, but the performancesuffers terribly when several users try to run reports in parallel. A singlequery might take 10 minutes to run if nothing else is happening on the box,but if additional users log on an run reports, it's almost impossible topredict when the queries will finish.I am also looking at the effect of database size on performance, runningtests against a database with 1 month, 3 months, and say 12 months of data,running the same query against 2 databases in parallel. With the originalconfiguration, the results were all over the place, with the 12 monthdatabase outperforming the smaller dbs, while other times there was littledifference. It seems that once the system starts paging, and paging heavily,it's over; the system never "recovers" and queries that previously ran in afew minutes now take hours.I added 3 G more memory to the system, and modified boot.ini to include the/3GB switch. Now when I run the same tests, the results are much moreconsistent, as the system rarely ever has to swap. Then again I've neverseen it go past 1.7G in Task manager, making me think that any more than say2.5G of memory is a waste?Things we are trying to determine are:- in the SQL Server memory configuration, is Fixed better than Dynamic? Wehave read that Dynamic is not good at returning memory to the OS once it'sbeen allocated- What else can we do to optimize the performance for this application? Itseems to me if the indexes are properly designed, the database sizeshouldn't have that much impact on performance, but this appears to be trueonly to a point. In comparing the execution plans between say a 12 month anda 3 month database, the plans are sometimes dramatically different. I assumethis is due to the optimizer deciding that going directly to the base tablesand not using an index will result in better performance, when in reality,this doesn't always appear to be true.- Are there other SQL Server switches I should be tweaking? Is there somenumber of simultaneous queries that this configuration should be limited to?- What about other versions of SQL Server (e.g. Enterprise, Data Center,etc) would these buy us anything?Thanks for any advice,-Gary

View 2 Replies View Related

Data Generator For Sql Server 2005.

Mar 9, 2007

Hi !!

I am given the task to make an application in C# of filling the database ( made in sql server 2005) so that we can afterwards use those records for mining etc.. I dont have the slightest clue of how to go about making the data generator. Any ideas???

Thanks .

View 1 Replies View Related

User Defined Number Generator

May 10, 2006

Hello all!

I have a windows forms app and I'm trying to add functionality that would allow the user to enter a number into a textbox control on a setup form and then that number would autoincrement by one each time a new record on another form is inserted into the DB .

I've searched high and low and can't seem to find much information on how I can put this together. I'm sure I'll need a "numbers" table in the DB that stores the numbers and is joined with the parent table where the records are being inserted into. After that, I'm pretty much lost on how to generate the numbers in the "Numbers" table.

If anyone could assist or point me in the right direction of a resource, I would really appreciate it!!

Thanks,

Tony

View 7 Replies View Related

How To Create A Sequence Generator Number In SSIS

Mar 28, 2006

Hi,

I got 5000 rows in source and when i am sending the data to destination it has to create a sequence generator number for each row.

Can any one help me which transformation do i need to take for doing this in SSIS.













View 10 Replies View Related

Find Logic Flaw, Order Number Generator

Mar 15, 2000

This procedure has been returning duplicate numbers. (Tested with scripts that called this proc and put value in a table.)

How can it return duplicates? Does the transaction Begin/Commit not guarantee transactional consistency?


CREATE PROCEDURE sp_UpdateOrderNumber @customer int AS
DECLARE @NewOrderId int,
@nSQLError int,
@nRowCount int
BEGIN TRAN
UPDATE CUSTOMERS
SET ORDER_NUMBER=ORDER_NUMBER + 1
WHERE COMPANY_ID=@customer
SELECT@nSQLError = @@error,
@nRowCount = @@rowcount
If @nSQLError != 0 OR @nRowCount != 1 /* Check for Errors */
Begin
Rollback Tran
Return -999
End
SELECTORDER_NUMBER
FROMCUSTOMERS
WHERECOMPANY_ID=@customer
SELECT@nSQLError = @@error,
@nRowCount = @@rowcount
If @nSQLError != 0 OR @nRowCount != 1 /* Check for Errors */
Begin
Rollback Tran
Return -998
End
COMMIT TRAN

View 1 Replies View Related

Why Script Generator In 2005 Mgmt Studio So Slow? (was Somebody Please Tell Me...)

Dec 7, 2007

...why the script generator in 2005 Management Studio is SO FREAKING SLOW!?

2000's EM would script out all the objects in a databases in 15 seconds. The new GUI is taking three-to-five seconds per object on my 1000 object database.

Man, the Management Studio interface is so lame.

View 7 Replies View Related

Existing Storeed Procedure And Wizard Report Generator

May 9, 2008

I have an existing (working) SP that when I try to drop into the reoirt wizard gives me errors. The procedure runs in SQL management Studio, works in an existing rdl, even returns data in the repor wizard but also returns errors and therefore I can't continue. My work around is to drop it into an existing rdl; then I lose the Report Wizard features of generating a slick, quick repport.

View 1 Replies View Related

Integration Services :: SCD Task And Sequence Generator Dependency

Aug 13, 2012

We have Sequence generator (Next Value) enabled for surrogate keys (SQL Server 2012). When we use the new SCD task, we get the following error:

[Insert Destination [42]] Error: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 11.0"  Hresult: 0x80004005  Description: "NEXT VALUE FOR function cannot be used if ROWCOUNT option has been set, or the query contains TOP or OFFSET. ".

Is there any know issue that these two features [SCD task and Next Value] cannot be used together?

View 14 Replies View Related

Integration Services :: Auto Number Generator In SSIS

Aug 11, 2015

In SSIS, I created a flow and within that flow i need to create an automatic number generator. The flow is simple: Ole db source part, a multicast part and a flat file destination and a ole db destination. In the Ole db source there is no field that is the starting point for this generator. This automatic nr should start with 10000 and each time a row is found it should be increased by 1.

First question: is it possible to create a column in SSIS flow which is the starting point for the generator (in this case 10000) or should it be created in the source table?

Second question: where in SSIS and with what component can i create such a generator??

View 5 Replies View Related

SSRS Report Generator Hangs If There Are Around 10000 Pages That Needs To Be Converted To A PDF

Sep 25, 2007



Hi,
I am using SSRS to generate a 4 page statement... So i have a plan whose no. of Participants is 3271 rows... so While we try to export them to a PDF we will have around 13084 pages... but we cannot export so many pages at one time (it craps out). so right now we are breaking it up by start part and stop part and creating a pdf..

Is there a way that SSRS can handle so many pages at one go without any problems... if so how ??

Regards
Karen

View 18 Replies View Related

SSRS Report Generator Hangs On Execution In BIDS And Report Manager

Apr 29, 2008

Hi,

I'm encounter lately some weird behaviour of SSRS in BIDS as well as after deploying on Reporting Server.
I'm running basic classical SQL SSRS Reports with Oracle DB connection. My reports have header and footer pagination and well defined report layer configuration. All the reports are simple based on one table and some basic parameters passed to query.

In query builder from BIDS from data tab, the query is running fine without any other execution delays. Also the query is runnign fine in PL/Dev environment.
When I switch in "Preview" mode the report hangs in execution and just showing "Report is being generated" without any resuts. After a while is generating an execution error (after 20 min).

The behaviour is the same after deployment on Report Server .
I now...here it comes...the problem is intermitent...some times the report is working...but most of the times it hangs on execution.
I checked the report from top to bottom and nothing's wrong from design perspective.

On other reports I don't have this problem and I don't understand where to start to investigate.

Any suggestions...I'm stuck here.

Thanks

View 1 Replies View Related

Help With Converting Code: VB Code In SQL Server 2000-&&>Visual Studio BI 2005

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

How To Show Description In Report Instead Of Code (Desc For Code Is In Master Table)

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

Many Lines Of Code In Stored Procedure && Code Behind

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







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