Wednesday, March 28, 2012
how to insert characters in existing field
I have a sql table with a field name model. In the model column, i have
model number that start with FX%.
I want to add WM before FX%. After FX can be anything, characters or
numbers. The model data type is varchar.
How can i do it. I tried using the syntax below but not successful.
update test2 set model = 'WM%' where model = 'FX%'
Can anyone help?
Tiffany,
It sounds like what you want is
update test2 set
model = 'WM' + model
where model = 'FX%'
This will paste WM on the beginning of all the FX... model names.
Steve Kass
Drew University
Tiffany wrote:
>Hi,
>I have a sql table with a field name model. In the model column, i have
>model number that start with FX%.
>I want to add WM before FX%. After FX can be anything, characters or
>numbers. The model data type is varchar.
>How can i do it. I tried using the syntax below but not successful.
>update test2 set model = 'WM%' where model = 'FX%'
>Can anyone help?
>
|||Steve!
I have a similar problem where I want to replace the domain part in a column
with e-mail addresses. Like aaa@.xxx.se with aaa@.yyy.se. I tried using the
tip you gave Tiffany but nothing happens.
Any clues?
Regards,
Bosse
"Steve Kass" wrote:
> Tiffany,
> It sounds like what you want is
> update test2 set
> model = 'WM' + model
> where model = 'FX%'
> This will paste WM on the beginning of all the FX... model names.
> Steve Kass
> Drew University
> Tiffany wrote:
>
|||Xref: TK2MSFTNGP08.phx.gbl microsoft.public.sqlserver.mseq:8241
On Wed, 16 Feb 2005 07:09:06 -0800, Bosse wrote:
>Steve!
>I have a similar problem where I want to replace the domain part in a column
>with e-mail addresses. Like aaa@.xxx.se with aaa@.yyy.se. I tried using the
>tip you gave Tiffany but nothing happens.
>Any clues?
>Regards,
>Bosse
Hi Bosse,
Steve's message to Tiffany was about how to put some extra characters in
front of existing string data. To replace a part of existing string data,
you use the REPLACE function instead.
UPDATE MyTable
SET Email = REPLACE (Email, '@.xxx.se', '@.yyy.se')
WHERE Email LIKE '%@.xxx.se'
Note the extra @. and .se inserted in the replace, to make sure that an
address like aaxxxt@.xxx.se is not accidentaly changed to aayyyt@.yyy.se.
Best, Hugo
(Remove _NO_ and _SPAM_ to get my e-mail address)
sql
Monday, March 19, 2012
How to import report from report server
Is there any way to import existing report from report server (Sql 2005)
into visual studio report designer?.
Thanks in advance.This is not very discoverable. In Report Manager click on the report,
properties tab, edit link. It will ask for a directory. Give it a directory
on your PC (for instance c:\temp). The in the designer right click on the
reports folder for your project, add, existing item.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Radovan Dobriæ" <radovan@.servis24.hr> wrote in message
news:O3CB07mXIHA.5448@.TK2MSFTNGP04.phx.gbl...
> Hi,
> Is there any way to import existing report from report server (Sql 2005)
> into visual studio report designer?.
> Thanks in advance.
>|||Thanks a lot.
I was allways looking in VS for import option,
Radovan
"Bruce L-C [MVP]" <bruce_lcNOSPAM@.hotmail.com> wrote in message
news:OXzqYdpXIHA.4868@.TK2MSFTNGP03.phx.gbl...
> This is not very discoverable. In Report Manager click on the report,
> properties tab, edit link. It will ask for a directory. Give it a
> directory on your PC (for instance c:\temp). The in the designer right
> click on the reports folder for your project, add, existing item.
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "Radovan Dobriæ" <radovan@.servis24.hr> wrote in message
> news:O3CB07mXIHA.5448@.TK2MSFTNGP04.phx.gbl...
>> Hi,
>> Is there any way to import existing report from report server (Sql 2005)
>> into visual studio report designer?.
>> Thanks in advance.
>
Monday, March 12, 2012
How to Import from flat file and update DateTime column?
I have a a flat file that consists of 2 Columns of data that need to overwrite an existing Table that has 3 Columns of data. The Import fails because the 3rd column on the table is a Date stamp column with the Data Type of "smalldatetime" and does not allow Null data. If I were to delete this 3rd column from the table the import works great but I lose the DateTime column. How can I use the Import Wizard to import the first 2 columns from a text file and update the 3rd column with the date and time? The wizard does not seem to let me update a column unless the data for this column comes from the flat file. Please assist, thanx.
Which wizard are you talking about? The import / export data wizard? If so this wizard is for appending new rows or deleting existing rows. I do not believe that it is really meant for updating rows (i.e. overwriting). You would want to create an SSIS package and use the OLE DB Command instead of the OLE DB Source to overwrite a row.
|||If you are looking to import data, you can use the wizard to build the package, then save it and open it in Business Intelligence Developer Studio. If you then open the data flow, you can add a Derived Column task, add a new column to it, and use the GETDATE() function to return the current date.
|||If he did what you suggest wouldn't he still just be importing new records instead of overwriting the existing records?|||
I believe the import/export wizard gives you the ability of providing a query for the import. Perhaps you can write a where you have a 3rd columns with the getdate(if using sql server) or sysdate(for Oracle) or any other DB function that retrieves the current date.
|||From his description, I wasn't positive that he wanted to "update" existing records as much as he was looking to truncate and reload the table. Using the wizard (and setting the create destination table options) will drop and recreate the table before loading it. However, I might have his needs wrong. Maybe he'll respond and let us know if either approach was successful.|||
I'm sure the OP will realise that when the going gets tough, the tough-SSIS-community-contributors get going.
Sorry.
How to import Excel files
Thanksimport it into a temp table, validate it, import to main table.
How to import data in sql server 2000 from an excel(.xls) file
into an existing table.
should i use some stored procedures or elseYou can use DTS in SQL Server (Right click on the database in Enterprise Manager, then Import) or even attach to the Excel file in Access and then use the upsizing wizard.|||Thnx fo rthe reply i tried this one its fine but i want ot do something more than that
i have a .xls file at my pc and i have to updat ethe database online
for this i know i have to write a web application first
where i put the path of the .xls file but what next how should i write the query which will get the data from .xls file into sql server
please reply asap
regards
softpioneer|||i need to get the xl file in the vb code .Also tell me how to get the hyper link's actual path
i need to get the path of the hyper links too
pls hel asap
regards
softpioneer|||Hi,
Have you got any solution for importing excel data to sql server using vb.net?|||I have seen access imported into SQL via C# and I bet the principles are the same.
Try this link.
http://www.eggheadcafe.com/forums/ForumPost.asp?ID=24776&INTID=6