| Author |
Topic  |
|
|
allan8964
Posting Yak Master
202 Posts |
Posted - 09/24/2012 : 13:23:51
|
Hi there,
I have a table which has a field 'Code'. Code has text of 'http:// ...' Now I want to replace http:// to https:// and I tried to use
Update table1 Set Code = Replace(Code, 'http', 'https')
I got error from this. Then what should I do for this?
Thanks in advance. |
|
|
visakh16
Very Important crosS Applying yaK Herder
India
47960 Posts |
Posted - 09/24/2012 : 13:26:38
|
the statement looks fine. what was the error you got?
to make it more specific you can tweak it like
Update table1 Set Code = Replace(Code, 'http://', 'https://')
------------------------------------------------------------------------------------------------------ SQL Server MVP http://visakhm.blogspot.com/
|
 |
|
|
allan8964
Posting Yak Master
202 Posts |
Posted - 09/24/2012 : 13:31:05
|
Thanks visakh16 for quick reply! Error is 'Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.' |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
India
47960 Posts |
Posted - 09/24/2012 : 13:37:08
|
nope the error has no relation to statement you posted!
post us full query. the error is due to some other query involved in the batch
------------------------------------------------------------------------------------------------------ SQL Server MVP http://visakhm.blogspot.com/
|
 |
|
|
allan8964
Posting Yak Master
202 Posts |
Posted - 09/24/2012 : 13:44:29
|
I exported table1 to table2 and updaye table2 it worked. I checked table1 script found difference from tabtle2 is as follows:
CONSTRAINT [PK_Site] PRIMARY KEY CLUSTERED ( [SiteId] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY]
any of this blocked the operation? Thanks. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
India
47960 Posts |
Posted - 09/24/2012 : 15:31:40
|
sorry whatever you're telling doesnt make any sense
the above error has nothing to do with blocking
------------------------------------------------------------------------------------------------------ SQL Server MVP http://visakhm.blogspot.com/
|
 |
|
| |
Topic  |
|