|
You are attempting to do this in the wrong place. A database is for storing and manipulating data. The state of the column is a UI issue not a database issue.
Change the properties of your list control to make it read only.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
hi
i know that, but i the column properties in the database to be unmodified,
in another database the property is exist, but in sql server i can't reach the property.
thanks
|
|
|
|
|
zead wrote: i know that
And yet you insist that SQL server supply this UI functionality!
zead wrote: in another database the property is exist
What is the other database?
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
hi
like pervasive database
|
|
|
|
|
Sorry I had not heard of pervasive. If they supply the functionality you need then use that database, expecting another vendor to match esoteric (and wrong) requirements is not reasonable.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi guys
I detached my database, working for months. after one week I decide to attach it agian. but, I ot the following error:
<br />
<br />
TITLE: Microsoft SQL Server Management Studio<br />
------------------------------<br />
<br />
Failed to retrieve data for this request. (Microsoft.SqlServer.Management.Sdk.Sfc)<br />
<br />
For help, click: http:
<br />
------------------------------<br />
ADDITIONAL INFORMATION:<br />
<br />
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)<br />
<br />
------------------------------<br />
<br />
CREATE FILE encountered operating system error 5(Access is denied.) while attempting to open or create the physical file 'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\Hostel.mdf'. (Microsoft SQL Server, Error: 5123)<br />
<br />
For help, click: http:
<br />
------------------------------<br />
BUTTONS:<br />
<br />
OK<br />
------------------------------<br />
<br />
Please help,
I went through many forums on the website but hasn't help me yet.
|
|
|
|
|
I sort out y problem.Righr click and then run as Administrator
|
|
|
|
|
somebody please help me....
i'm using vb.net 2008 and SQL Server 2008...
the case is :
--------------------------------------------------
if i have data in one column like :
ASD654-100-CCCEEE4444-200-
what query can be used to get "CCCEEE4444" ????
|
|
|
|
|
SELECT SUBSTRING('ASD654-100-CCCEEE4444-200-',12,10)
Instead of string value give column name.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.aktualiteti.com
|
|
|
|
|
it will not work.
coz i'll never know the starts index and the length of string.
coz the data is randomize.
example :
i want to get "ASD654" and "CCCEEE4444" from the data :
"ASD654-100-CCCEEE4444-200-"
or to get "QWEQWEQ" and "JJJLLL" and "PPPBBMMNN" from :
"QWEQWEQ-2000-JJJLLL-20-PPPBBMMNN-600-"
any idea?
is there any query for looping? 
|
|
|
|
|
Well, you have to use - as split char, by writting your own function then you can get result as you need.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.aktualiteti.com
|
|
|
|
|
how to split char "-" in SQL ?
is there a function for looping in SQL ?
teach me please...
i'm begging...
pleaseee..... 
|
|
|
|
|
Use SUBSTRING function
SELECT SUBSTRING([ColumnName],12,10) FROM [Table]
|
|
|
|
|
but i'll never know the starts index and the length of string.
coz the data is randomize.
example :
i want to get "ASD654" and "CCCEEE4444" from the data :
"ASD654-100-CCCEEE4444-200-"
or to get "QWEQWEQ" and "JJJLLL" and "PPPBBMMNN" from :
"QWEQWEQ-2000-JJJLLL-20-PPPBBMMNN-600-"
any idea? 
|
|
|
|
|
For that you should write UDF, depends upon the random data you should define the things & write script for that.
|
|
|
|
|
i agree with blueboy where i have to use "-" as split char.
but the problem is i don't know how to split char using SQL Query.
and i think i need function for looping using SQL Query too.
can u help me pleaseee?
i'm begging.... 
|
|
|
|
|
|
wow... that code was very hard to understand..
i'm still a newbie here.
but thanks alot friend. it helps and i'll try... 
|
|
|
|
|
siang_wu_id wrote: that code was very hard to understand
May be, for big works probably we need to write massive code(at least bunch of code).
siang_wu_id wrote: i'm still a newbie here.
but thanks alot friend. it helps and i'll try...
It's really great.
|
|
|
|
|
Hi,
I suggest you create a split function
CREATE FUNCTION [dbo].[Split]
(
@delimited nvarchar(max),
@delimiter nvarchar(100))
RETURNS @t TABLE
(
id int identity(1,1),
val nvarchar(max))AS
BEGIN
declare @xml xml
set @xml = N'<root><r>' + replace(@delimited,@delimiter,'</r><r>') + '</r></root>'
insert into @t(val)
select
r.value('.','varchar(15)') as item
from @xml.nodes('//root/r') as records(r)
RETURN
END
Then cross apply to return your desired column. eg.
declare @tmp table (value varchar(100))
insert into @tmp values ('ASD654-100-CCCEEE4444-200-')
insert into @tmp values ('QWEQWEQ-2000-JJJLLL-20-PPPBBMMNN-600-')
select val
from @tmp
cross apply dbo.split(value,'-')
where id = 3
Ryan
|
|
|
|
|
Hi All,
I'm very new to SQL Server 2008, and need a bit of help manipulating numbers.
I've got a int column holding numbers up to 11 digits. I need to do the following manipulation and use it in a SQL query. Basically, the first digit is transfered to the 3rd position on the right side.
12345678
23456178
or
1234
2134
The values are variable, there are even records with only a value of 1.
Thanks in advance.
|
|
|
|
|
ac011 wrote: Basically, the first digit is transfered to the 3rd position on the right side.
- Cast the column to a
VARCHAR
- Reararrange the characters using the string-functions described here[^]
I are Troll
|
|
|
|
|
Hi,
How about...
<br />
declare @value varchar(11)<br />
set @value = cast(12345678 as varchar)<br />
select cast(substring(stuff(@value, len(@value)-1, 0, substring(@value,1,1)), 2, len(@value)) as int)<br />
Ryan
|
|
|
|
|
|
Hello
See SQL
update wp_postmeta set option_value = replace(option_value, ‘nkhba.net\wordpress’, ‘alamhamasat.net’);
In the field option_value of wp_postmeta the following text
a:6:{s:5:"width";i:350;s:6:"height";i:280;s:14:"hwstring_small";s:23:"height='96' width='120'";s:4:"file";s:90:"D:\hshome\c259998\nkhba.net\wordpress/wp-content/uploads/2009/10/ououousoouououusoouso.jpg";s:5:"sizes";a:2:{s:9:"thumbnail";a:3:{s:4:"file";s:33:"ououousoouououusoouso-150x150.jpg";s:5:"width";i:150;s:6:"height";i:150;}s:6:"medium";a:3:{s:4:"file";s:33:"ououousoouououusoouso-300x240.jpg";s:5:"width";i:300;s:6:"height";i:240;}}s:10:"image_meta";a:10:{s:8:"aperture";i ;s:6:"credit";s :"";s:6:"camera";s :"";s:7:"caption";s :"";s:17:"created_timestamp";i ;s:9:"copyright";s :"";s:12:"focal_length";i ;s:3:"iso";i ;s:13:"shutter_speed";i ;s:5:"title";s :"";}}<
When I run that query above, it should affect the bold string (nkhba.net\wordpress) in the text above and change it to ("alamhamasat.net") corresponding to the query
But MySql responds me that (0) rows were affected.
please help
|
|
|
|