Monday, March 19, 2012
add to data
I have a database that has a field with phone numbers in.
I want to update the main part of the number to add the area code to
the main number.
I will do a selection on the postcode of the address and then I want to
add the correct area code to the beginning of the number.
Any help please.
SteveHi Steve,
First of all:
http://www.aspfaq.com/etiquette.asp?id=5006
Based on this its hard to give some suggestions but assuming some thing
here is some pseudocode
UPDATE CustomerTable
SET phoneNumber = CAST(RegionCode AS VARCHAR(10)) + CAST(phoneNumber
AS VARCHAR(100))
FROM CustomerTable C
INNER JOIN
RegionPhoeTable R
ON C.ZipCode = R.ZipCode
HTH, jens Suessmeyer.
add to data
I have a database that has a field with phone numbers in.
I want to update the main part of the number to add the area code to
the main number.
I will do a selection on the postcode of the address and then I want to
add the correct area code to the beginning of the number.
Any help please.
Steve
Hi Steve,
First of all:
http://www.aspfaq.com/etiquette.asp?id=5006
Based on this its hard to give some suggestions but assuming some thing
here is some pseudocode
UPDATE CustomerTable
SET phoneNumber = CAST(RegionCode AS VARCHAR(10)) + CAST(phoneNumber
AS VARCHAR(100))
FROM CustomerTable C
INNER JOIN
RegionPhoeTable R
ON C.ZipCode = R.ZipCode
HTH, jens Suessmeyer.
add to data
I have a database that has a field with phone numbers in.
I want to update the main part of the number to add the area code to
the main number.
I will do a selection on the postcode of the address and then I want to
add the correct area code to the beginning of the number.
Any help please.
SteveHi Steve,
First of all:
http://www.aspfaq.com/etiquette.asp?id=5006
Based on this its hard to give some suggestions but assuming some thing
here is some pseudocode
UPDATE CustomerTable
SET phoneNumber = CAST(RegionCode AS VARCHAR(10)) + CAST(phoneNumber
AS VARCHAR(100))
FROM CustomerTable C
INNER JOIN
RegionPhoeTable R
ON C.ZipCode = R.ZipCode
HTH, jens Suessmeyer.
Saturday, February 25, 2012
Add into 2 tables (VS 2005)
Hi, not sure if I've posted at the right area but here goes:
I'm working on a project using Visual Studio 2005 and SQL express server for the database.
Since I'm using VS 05, I use datasources to select, insert, delete, update from my db.
Question is, how do i insert, delete, update from 2 tables using datasource? is it even allowed?
If it's not allowed, are there any solutions other than using the codebehind?
Please help. Thank you.
hi galovesongs,
you can you any of these two solutions
1. on the vs.net
Making use of system.transaction
you can put two of your delete, insert, update inside a transaction
placing two statement in a transaction context
is the best way to go.
pls find a four page article on this link
http://www.devx.com/vb/Door/10608
2. on the database
you can make use of the trigger
i moved the thread here. for better opinions
Thursday, February 16, 2012
Add a table to a merge replicated database WITHOUT forcing a snapshot
I've tried to catch up on all the posts in this area, and I can't really see
where this has been asked. If I have repeated a previous question, I do
apologize.
We are trying to add new tables to an existing merge replication by running
a create table statement on a publication database and then using
sp_addmergearticle with the @.creation_script parameter pointing to the sql
file to run on the subscriber as we are setting the identity fields
manually. When the procedure runs, it detects that the change requires a new
snapshot. We cannot afford the time it takes to create an entirely new
snapshot (could take days) so we are looking for the ways to speed up the
process.
We also tried to create tables directly by entering information into the
system tables but we have had trouble with generating insert, update and
delete triggers to replicate data.
We would like to know whether
1. There is a way to invalidate a snapshot for new tables only?
2. There is another way of creating new tables on a replicated
database.
Any help you could provide would be greatly appreciated! Thanks for your
assistance.
Sincerely,
Marshall
The standard ways to achieve this are:
(a) to create a new publication which contains the new table
(b) or to 'initialize' the table (by creating a complete snapshot)
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||Paul,
I guess that's the problem. Neither of these solutions is possible for us.
We are using Merge Replication in a high availability solution and cannot
afford to have the system down for the amount of time it will take to either
1. Generate a new publication with the additional requisite tables, or
2. Add the tables and generate a new snapshot.
What you have described are indeed the standard ways to accomplish the task,
however, due to our environment we really need to do something faster. We
are trying to create these additional tables in the same publication and
without the overhead of recreating the snapshot, which is totally
unnecessary except for the internal triggers required to keep the tables
synchronized (they are, after all, empty after they are created.) Isn't
there some way we could just create the triggers required for the new tables
and apply those to the subscriber? We're really looking for a solution that
takes less than thirty minutes!
Thanks in advance for any suggestions!
Marshall
|||Creation of new publication with one empty table in it should take much less than 30 minutes... If it's not a problem to have multiple publications, then it is the way to go.
Regards,
Kestutis Adomavicius
Consultant
UAB "Baltic Software Solutions"
"WideOpenWest" <MBCDev> wrote in message news:e6GdnTskHapNZPreRVn-jg@.wideopenwest.com...
Paul,
I guess that's the problem. Neither of these solutions is possible for us.
We are using Merge Replication in a high availability solution and cannot
afford to have the system down for the amount of time it will take to either
1. Generate a new publication with the additional requisite tables, or
2. Add the tables and generate a new snapshot.
What you have described are indeed the standard ways to accomplish the task,
however, due to our environment we really need to do something faster. We
are trying to create these additional tables in the same publication and
without the overhead of recreating the snapshot, which is totally
unnecessary except for the internal triggers required to keep the tables
synchronized (they are, after all, empty after they are created.) Isn't
there some way we could just create the triggers required for the new tables
and apply those to the subscriber? We're really looking for a solution that
takes less than thirty minutes!
Thanks in advance for any suggestions!
Marshall
|||I never thought of doing something like that; it would probably work, but it
is standard procedure for us to add tables when we do software releases.
After some time, we're going to have publication after publication, which is
ugly and probably a significant performance threat (each publication will
need its own agents.)
Is there some way we could use the information generated in the snapshot of
that new publication to add the tables to the original publication? Perhaps
this is not so orthidox, but we really need to find a solution to this
issue.
Another idea that has been suggested is to add several hundred generic,
empty tables to the new publication. Then, every time we need a new table
in a release we add the columns to one of those generic tables and begin
using it. The problem here is that we'd have several hundred generically
named tables! Is it possible to rename a table across a merge replication?
This is ugly also.
Help!
Thanks,
Marshall
"Kestutis Adomavicius" <kicker.lt@.noospaam_tut.by> wrote in message
news:%235KQnK63FHA.2424@.TK2MSFTNGP10.phx.gbl...
Creation of new publication with one empty table in it should take much less
than 30 minutes... If it's not a problem to have multiple publications, then
it is the way to go.
Regards,
Kestutis Adomavicius
Consultant
UAB "Baltic Software Solutions"
"WideOpenWest" <MBCDev> wrote in message
news:e6GdnTskHapNZPreRVn-jg@.wideopenwest.com...
Paul,
I guess that's the problem. Neither of these solutions is possible for us.
We are using Merge Replication in a high availability solution and cannot
afford to have the system down for the amount of time it will take to either
1. Generate a new publication with the additional requisite tables, or
2. Add the tables and generate a new snapshot.
What you have described are indeed the standard ways to accomplish the task,
however, due to our environment we really need to do something faster. We
are trying to create these additional tables in the same publication and
without the overhead of recreating the snapshot, which is totally
unnecessary except for the internal triggers required to keep the tables
synchronized (they are, after all, empty after they are created.) Isn't
there some way we could just create the triggers required for the new tables
and apply those to the subscriber? We're really looking for a solution that
takes less than thirty minutes!
Thanks in advance for any suggestions!
Marshall
Add a function a report
How i can add a function to a report and use to put in a textbox
Like
Public Function Area(radius)
return 3.14*radius*radius
End Function
Thanks
vgta,
from your report click on Report
then choose Report Properties...
From there you will see a CODE tab. Enter your function here.
The expression of your textbox will be Code.functionName
Using your example it would be Code.Area(radius)
Bret