Monday, March 26, 2012
Replace string inside value
i have a textbox which i fill with a value from a database and i wanna
know how you can change certain strings withing the filled value...
example:
This is the expression for the textbox:
=First(Fields!MyFieldName.Value, "Parametri")
=Replace(Fields!MyFieldName.Value.ToString(), "date", "current date")
So, the thing is, i've filled my textbox with a value from a database,
which is in my case, the value is a simple sentence...which has a word
'date' in it...so my question is how can i search that value
(sentence) and find the word "date" and replace it with something, for
example, today's date..?
That means if my textbox value is "bla bla bla date bla bla bla", i
wanna be able to change the word "date" to today's date or any other
word...so that in the report preview instead of "date" it says today's
date...
THANX!On Jun 28, 4:23 am, ApeX <mmo...@.gmail.com> wrote:
> Hi all, i have a question, i'm making a report in visual studio, where
> i have a textbox which i fill with a value from a database and i wanna
> know how you can change certain strings withing the filled value...
> example:
> This is the expression for the textbox:
> =First(Fields!MyFieldName.Value, "Parametri")
> =Replace(Fields!MyFieldName.Value.ToString(), "date", "current date")
> So, the thing is, i've filled my textbox with a value from a database,
> which is in my case, the value is a simple sentence...which has a word
> 'date' in it...so my question is how can i search that value
> (sentence) and find the word "date" and replace it with something, for
> example, today's date..?
> That means if my textbox value is "bla bla bla date bla bla bla", i
> wanna be able to change the word "date" to today's date or any other
> word...so that in the report preview instead of "date" it says today's
> date...
> THANX!
What you have is pretty close to correct. You should be able to use
something like this:
=Replace(CStr(Fields!MyFieldName.Value), "date", "current date") -or-
if you want the actual date time, you could use:
=Replace(CStr(Fields!MyFieldName.Value), "date", CStr(Now()))
Hope this helps.
Regards,
Enrique Martinez
Sr. Software Consultant
Wednesday, March 21, 2012
Replace existing table
Hi. I am new to SQL Server so please excuse me if my question is stupid or asked in the wrong place.
I am replicating a number of Visual FoxPro tables in SQL Server. The tables are updated daily. I have got several of them replicated fine through using BULK INSERT to load the existing data and INSERT/UPDATE/DELETE to replicate the daily updates.
However, one of the Visual FoxPro tables is re-created from scratch each day. I could do the same in SQL Server but I would like users to have uninterrupted access to it (i.e. I do not want a query to fail while I am deleting and then re-upsizing the table).
One method that occurs to me would be to upsize the table under a different temporary name and then BEGIN TRANSACTION, delete the old table, rename the new table to the old table and then COMMIT TRANSACTION. Would this work? And is there a better way of doing this?
Many thanks
Dom
I know the users have to go to lunch daily..., so announce a lunch break at 1 pm for all the people and do what to do; if your users don't want to leave do it after they go home.
Sure ,before take a full backup if you have time.
|||Thanks ggciubuc, but I'm afraid thats not an option. The update needs to be done as early as possible (but no earlier than 8am) so it cannot wait until the users have gone home, but it will not be at a consistent time of day because the start time depends on the time taken to complete a number of prior processes.|||Make a Integration Services package , put it in a job that runs before 8 a.m (eg. 6 a.m); the package can contain:
1.a task that delete the SQL table
2. a task that re-create the SQL table
3. a task with bulk insert
with workflow you can prioritize the processes|||Thanks Gigi - I have not come across Integration Services before, I will check it out.
However, as stated above, it cannot run earlier than 8am (typically it will run at some point around 10am but some days it may not be until 1pm or later) and I would like to avoid disrupting users if possible.
|||I recommend to use your proposed solution (with minor change) for this task & (it may be done on the SSIS Package or DTS package), but your approach seems to be good enough to fit for your requirement.
1. Create a table on different temp name (not temp table -- #)
2. Do the manipulation on created table
3. On single transaction, Delete the existing row, insert from created table, drop the created table.
|||Many thanks Manivannan, I'll give it a go. Deleting all of the the existing rows and then inserting the new records makes much more sense, I guess.
Could I even use a BULK INSERT to append the records (does BULK INSERT work inside a transaction?) and avoid creating the temporary table altogether?
|||You can use the BULK INSERT on explicit(user) transaction. It can be roll backed also. J
Replace Access with a .NET front end and SQL Backend solution.
replace the FE with .net and the BE on SQL.
This will be done using Visual Studio 2005. Once the FE is converted to .net
and the BE is SQL they all will be accessed through our intranet (sharepoint).
I work in Ms Access and intermediate at VBA and just learing SQL through the
ENTERPRISE MANAGER SCREEN.
I am just now looking at what Visual Studio 2005 is, but can some one tell me
how this will all connect?
What is the typical route for this process?
Ms access to SQL - upsizing wizard or SQL importing???
Ms Access FE to .net - summarize how this is done in visual studio (user face
rebuilt) then placed on sharepoint?
Can anyone sum this up?
--
Message posted via http://www.sqlmonster.comAnns via SQLMonster.com (u22580@.uwe) writes:
Quote:
Originally Posted by
I work in Ms Access and intermediate at VBA and just learing SQL through
the ENTERPRISE MANAGER SCREEN.
Enterprise Manager is a tool that exists only in SQL 2000, and I assume
- and hope! - that you will implement your new solution on SQL 2005. The
tool in SQL 2005 is SQL Server Management Studio which replaces both
Enterprise Manager and Query Analyzer. As long as you work with SQL 2000,
QA should be your main tool, because it is from this tool you most easily
can run queries. EM may look a little like Access, so you may feel com-
fortable with that. However, SQL Server is very different from Access,
so best is to use a tool that forces you to unlearn a lot things.
Quote:
Originally Posted by
I am just now looking at what Visual Studio 2005 is, but can some one
tell me how this will all connect?
>
What is the typical route for this process?
>
>
Ms access to SQL - upsizing wizard or SQL importing???
Yes, there is an upsizing wizard. And the word that I have from people
who have worked extensively with both Access and SQL Server is that you
should stay away from it. Access and SQL Server are very different and
build on different mindset. You should more or less redesign your
application for SQL Server and .Net. This may seem like a lot more work
that you had expected, but it is likely to pay off in the long run with
lower maintenance costs, if you do it right from the start.
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||SQL 2005 - SQL Server Managment Studio, thank you, when I said I was
currently learning I am learning unfortunately on 2000 b/c that is the study
material I bought and cannot afford to upgrade right now.
You are right with the SQL 2000 Enterprise edition, it is so user friendly
and that edition is all I know and still learning at best with that.
Yes, my company will be doing this on 2005 but for now, my learning is on
2000.
You see I work in a another department besides IT and between that job/baby
and small buisness, I am trying to get my DBA (2000) certification, I would
like the upgrade (2005) but do not have the funds to upgrade.
I have an opportunity to help with this conversion process and learn in
between, but I am trying to get a better grasp of this before sinking.
Does the 2005 Managment Studio look alot like Enterprise manager?
Answer:
Ms Access to SQL - I am assuming your answer would then be exporting/dts tool
from SQL to pull over all these db's?
Answer:
Erland, tell me once the db's are pull over to SQL, now I have Visual Studio
2005 software open - what steps are taken in this software to rebuilt the
user faces and then how is it then put on SHAREPOINT????
ANSWER:
Erland Sommarskog wrote:
Quote:
Originally Posted by
Quote:
Originally Posted by
>I work in Ms Access and intermediate at VBA and just learing SQL through
>the ENTERPRISE MANAGER SCREEN.
>
>Enterprise Manager is a tool that exists only in SQL 2000, and I assume
>- and hope! - that you will implement your new solution on SQL 2005. The
>tool in SQL 2005 is SQL Server Management Studio which replaces both
>Enterprise Manager and Query Analyzer. As long as you work with SQL 2000,
>QA should be your main tool, because it is from this tool you most easily
>can run queries. EM may look a little like Access, so you may feel com-
>fortable with that. However, SQL Server is very different from Access,
>so best is to use a tool that forces you to unlearn a lot things.
>
Quote:
Originally Posted by
>I am just now looking at what Visual Studio 2005 is, but can some one
>tell me how this will all connect?
>>
>What is the typical route for this process?
>>
>Ms access to SQL - upsizing wizard or SQL importing???
>
>Yes, there is an upsizing wizard. And the word that I have from people
>who have worked extensively with both Access and SQL Server is that you
>should stay away from it. Access and SQL Server are very different and
>build on different mindset. You should more or less redesign your
>application for SQL Server and .Net. This may seem like a lot more work
>that you had expected, but it is likely to pay off in the long run with
>lower maintenance costs, if you do it right from the start.
>
--
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forum...eneral/200607/1|||Anns via SQLMonster.com (u22580@.uwe) writes:
Quote:
Originally Posted by
SQL 2005 - SQL Server Managment Studio, thank you, when I said I was
currently learning I am learning unfortunately on 2000 b/c that is the
study material I bought and cannot afford to upgrade right now.
You can download the Evaluation Edition of SQL 2005 from
http://www.microsoft.com/downloads/...FA7F-C094-49A2-
A050-2D07993566EC&displaylang=en.
Even if your study material only covers SQL 2000, I still think you
should work with SQL 2005.
Quote:
Originally Posted by
You are right with the SQL 2000 Enterprise edition, it is so user friendly
and that edition is all I know and still learning at best with that.
Enterprise Manager != Enterprise Edition. Enterprise Manager is available
in all editions of SQL 2000, except for the desktop version MSDE. The
difference between the editions lies in what features that are available,
and what purpose the edition is licensed for.
Quote:
Originally Posted by
Does the 2005 Managment Studio look alot like Enterprise manager?
It's not completely different, but there are also considerable differences.
In the end, you will only do yourself a disservice by learning a tool
that you will not work with.
But Enterprise Manager and SQL Server Management Studio are just the
tools. These are not what you should focus your learning on. You should
learn how to create databases, tables and indexes, and how to write
queries. You may think that you know SQL from Access, but as I said,
there are considerable differences. In general, SQL Server offers much
more powerful constructs, but there also features from Access that
are completely missing. A classic example is dynamic crosstabs.
Quote:
Originally Posted by
Ms Access to SQL - I am assuming your answer would then be exporting/dts
tool from SQL to pull over all these db's?
Maybe. As I said, I think you should consider a major redesign, at
least in places where you have some quirks in Access, or in places
where SQL Server offers better solutions. Then again, even if you go
for a new schema, it may of course be a good idea bring over the
Access databases to SQL Server, so that you can work with them locally.
And for that end SQL Server Integration Services (which is the successor
to DTS in SQL 2005) may be a good choice. (I've never worked with
neither DTS nor SSIS, so I don't really know.)
Quote:
Originally Posted by
Erland, tell me once the db's are pull over to SQL, now I have Visual
Studio 2005 software open - what steps are taken in this software to
rebuilt the user faces and then how is it then put on
SHAREPOINT????
Since you are migrating from Access to .Net, I would assume that you
more or less rewrite the front-end code entirely, but you should ask in a
..Net forum about that.
Sharepoint? I know there is a product with that name, but I have very
little idea what it's good for. So I cannot answer that question.
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||A great walk thru / how to on the MS Access to SQL Server 2005 was
blogged. I tried it and made my life much easier.
http://cfpayne.wordpress.com/2006/0...ql-server-2005/
Precia
Anns via SQLMonster.com wrote:
Quote:
Originally Posted by
My company currently has about 20-25 Ms Access Database that they want to
replace the FE with .net and the BE on SQL.
>
>
This will be done using Visual Studio 2005. Once the FE is converted to .net
and the BE is SQL they all will be accessed through our intranet (sharepoint).
>
>
I work in Ms Access and intermediate at VBA and just learing SQL through the
ENTERPRISE MANAGER SCREEN.
I am just now looking at what Visual Studio 2005 is, but can some one tell me
how this will all connect?
>
What is the typical route for this process?
>
>
Ms access to SQL - upsizing wizard or SQL importing???
>
>
>
Ms Access FE to .net - summarize how this is done in visual studio (user face
rebuilt) then placed on sharepoint?
>
>
Can anyone sum this up?
>
--
Message posted via http://www.sqlmonster.com