Thursday, March 29, 2012
adjust x,y position of crystal report data field from VB
as you know, to adjust x,y position of any data field on Crystal report,
we just open CR and manually put and adjust the datafield...
But how if our VB application want to change this setting too ?
how to pass the x,y parameter of specific data field to crystal report, so crystal report will adjust automatically before it displays. ??
Thank you,If you use RDC to display or print the report, you can do it by changing the properties of the object.
Report1.Object1.Property1 = Value1
MyRpt.fldDate.Left = 1500
MyRpt.fldDate.Top = 250
Adjust Parameter Dropdown control Size/Length
Is there a way to adjust Parameter Dropdown control Size/Length of a report so that it would no longer display a scrollbar?
Thanks,
JosephSorry, this is not a customizable property.
-Danielsql
Adjust Parameter Dropdown control Size/Length
Is there a way to adjust Parameter Dropdown control Size/Length of a report so that it would no longer display a scrollbar?
Thanks,
JosephSorry, this is not a customizable property.
-Daniel
Thursday, March 22, 2012
Adding Unique data
I have a table like
Invno Amount
55 100
55 200
56 50
57 150
57 300
57 50
I need to query to make it as
55 - 300
56 - 50
57 - 500
Please help me...
Thanks for your replies in advance.
Regards,
Selvarathinam.SELECT InvNo, SUM(Amount)
FROM Table
GROUP BY InvNo
Selvarathinam wrote:
> Dear Folks,
> I have a table like
> Invno Amount
> 55 100
> 55 200
> 56 50
> 57 150
> 57 300
> 57 50
> I need to query to make it as
> 55 - 300
> 56 - 50
> 57 - 500
> Please help me...
> Thanks for your replies in advance.
> Regards,
> Selvarathinam.|||Select invno, sum(amount) group by invno
"Selvarathinam" <s.selvarathinam@.gmail.com> wrote in message
news:1149799832.127814.236410@.y43g2000cwc.googlegroups.com...
> Dear Folks,
> I have a table like
> Invno Amount
> 55 100
> 55 200
> 56 50
> 57 150
> 57 300
> 57 50
> I need to query to make it as
> 55 - 300
> 56 - 50
> 57 - 500
> Please help me...
> Thanks for your replies in advance.
> Regards,
> Selvarathinam.
>|||Thanks a ton...
itz working
Tracy McKibben wrote:
> SELECT InvNo, SUM(Amount)
> FROM Table
> GROUP BY InvNo
>
> Selvarathinam wrote:
Monday, March 19, 2012
Adding Rows Together in SQL (SQL Server 2000)
We are trying to achieve the following. Please advice
select a.Firstname,a.Lastname, b.Dev_address,b.dev_description
from tbl1 a, tbl2 b
where b.data_id = a.id
and b.data_id=314
group by a.lastname,a.firstname,b.dev_address,b.dev_description
aaaa bbb 4234234 Pager
aaaa bbb 2342342 Work
aaaa bbb 23434 Home
aaaa bbb 23434 Cell Phone
kkk ccc 234234 Home
kkk ccc 23434 Cell
We want the result should be as follows:
aaaa bbb 4234234 Pager 2342342 Work 23434 Hom
e 23434 Cell Phone
kkk ccc 234234 Home 23434 Cell
Any ideas would be apprecaited.. we are using SQL Server 2000
ThanksHOW TO: Rotate a Table in SQL Server
http://support.microsoft.com/defaul...574&Product=sql
AMB
"Info Request" wrote:
> Dear friends,
> We are trying to achieve the following. Please advice
>
> select a.Firstname,a.Lastname, b.Dev_address,b.dev_description
> from tbl1 a, tbl2 b
> where b.data_id = a.id
> and b.data_id=314
> group by a.lastname,a.firstname,b.dev_address,b.dev_description
>
> aaaa bbb 4234234 Pager
> aaaa bbb 2342342 Work
> aaaa bbb 23434 Home
> aaaa bbb 23434 Cell Phone
> kkk ccc 234234 Home
> kkk ccc 23434 Cell
> We want the result should be as follows:
> aaaa bbb 4234234 Pager 2342342 Work 23434 Hom
e 23434 Cell Phone
> kkk ccc 234234 Home 23434 Cell
> Any ideas would be apprecaited.. we are using SQL Server 2000
> Thanks
>|||Thanks a lot. This works great.|||Rotation works perfect as long as we have one work phone number, if we
have more than one work phone number then it breaks with "Subquery
returned more than 1 value" error message.
Any ideas?
Sunday, March 11, 2012
Adding Rows Together in SQL (SQL Server 2000)
We are trying to achieve the following. Please advice
select a.Firstname,a.Lastname, b.Dev_address,b.dev_description
from tbl1 a, tbl2 b
where b.data_id = a.id
and b.data_id=314
group by a.lastname,a.firstname,b.dev_address,b.dev_descrip tion
aaaabbb4234234Pager
aaaabbb2342342Work
aaaabbb23434Home
aaaabbb23434Cell Phone
kkkccc234234Home
kkkccc23434Cell
We want the result should be as follows:
aaaa bbb4234234Pager2342342Work23434Home23434Cell Phone
kkk ccc234234Home23434Cell
Any ideas would be apprecaited.. we are using SQL Server 2000
Thanks
HOW TO: Rotate a Table in SQL Server
http://support.microsoft.com/default...74&Product=sql
AMB
"Info Request" wrote:
> Dear friends,
> We are trying to achieve the following. Please advice
>
> select a.Firstname,a.Lastname, b.Dev_address,b.dev_description
> from tbl1 a, tbl2 b
> where b.data_id = a.id
> and b.data_id=314
> group by a.lastname,a.firstname,b.dev_address,b.dev_descrip tion
>
> aaaabbb4234234Pager
> aaaabbb2342342Work
> aaaabbb23434Home
> aaaabbb23434Cell Phone
> kkkccc234234Home
> kkkccc23434Cell
> We want the result should be as follows:
> aaaa bbb4234234Pager2342342Work23434Home23434Cell Phone
> kkk ccc234234Home23434Cell
> Any ideas would be apprecaited.. we are using SQL Server 2000
> Thanks
>
|||Thanks a lot. This works great.
|||Rotation works perfect as long as we have one work phone number, if we
have more than one work phone number then it breaks with "Subquery
returned more than 1 value" error message.
Any ideas?
Thursday, March 8, 2012
Adding new field in a table which being used for replication
I'm trying to add a new field in a table and in my desired
position (OrdinalPosition), but I can not and I get the
following error message. As this table is involved in
replication I get this error message:
('tblTransPayments' table
- Unable to modify table.
ODBC error: [Microsoft][ODBC SQL Server Driver][SQL Server]
Cannot drop the table 'dbo.tblTransPayments' because it is
being used for replication.)
It should be noticed that I have lots of data in this
table and I'm not going to drop the table.
I can easily add my new field at the end of the column's
list but not as 21th column which I want to.
Thanks in advance.
If you really need the new column at a specific position, you'll have to drop the subscription, drop the publication, add the column then recreate the publication and subscription and initialize. You might want to do a nosync initialization to avoid the c
ost of the snapshot, but in this case you'll have to add the column onto the subscriber(s) table manually and if you are doing transactional replication, you'll need to create the scripts and apply them manually.
(No doubt you've seen this in other threads, but referring to columns by position rather than by name is generally seen as being a restrictive practice.)
HTH,
Paul Ibison
|||Hi -
Please check SQL BOL for "sp_repladdcolumn" and "sp_repldropcolumn".
Thanks
-Surajit
"Mattew" <anonymous@.discussions.microsoft.com> wrote in message
news:19d4101c44d7b$6507c260$a101280a@.phx.gbl...
> Hi dear friends,
> I'm trying to add a new field in a table and in my desired
> position (OrdinalPosition), but I can not and I get the
> following error message. As this table is involved in
> replication I get this error message:
> ('tblTransPayments' table
> - Unable to modify table.
> ODBC error: [Microsoft][ODBC SQL Server Driver][SQL Server]
> Cannot drop the table 'dbo.tblTransPayments' because it is
> being used for replication.)
> It should be noticed that I have lots of data in this
> table and I'm not going to drop the table.
> I can easily add my new field at the end of the column's
> list but not as 21th column which I want to.
> Thanks in advance.
|||Surajit,
this won't give the ability to specify the position, and Matthew doesn't
want the column created at the end.
Regards,
Paul Ibison
Tuesday, March 6, 2012
Adding new field in a table which being used for replication
I'm trying to add a new field in a table and in my desired
position (OrdinalPosition), but I can not and I get the
following error message. As this table is involved in
replication I get this error message:
('tblTransPayments' table
- Unable to modify table.
ODBC error: [Microsoft][ODBC SQL Server Driver][SQL Server]
Cannot drop the table 'dbo.tblTransPayments' because it is
being used for replication.)
It should be noticed that I have lots of data in this
table and I'm not going to drop the table.
I can easily add my new field at the end of the column's
list but not as 21th column which I want to.
Thanks in advance.If you really need the new column at a specific position, you'll have to dro
p the subscription, drop the publication, add the column then recreate the p
ublication and subscription and initialize. You might want to do a nosync in
itialization to avoid the c
ost of the snapshot, but in this case you'll have to add the column onto the
subscriber(s) table manually and if you are doing transactional replication
, you'll need to create the scripts and apply them manually.
(No doubt you've seen this in other threads, but referring to columns by pos
ition rather than by name is generally seen as being a restrictive practice.
)
HTH,
Paul Ibison|||Hi -
Please check SQL BOL for "sp_repladdcolumn" and "sp_repldropcolumn".
Thanks
-Surajit
"Mattew" <anonymous@.discussions.microsoft.com> wrote in message
news:19d4101c44d7b$6507c260$a101280a@.phx
.gbl...
> Hi dear friends,
> I'm trying to add a new field in a table and in my desired
> position (OrdinalPosition), but I can not and I get the
> following error message. As this table is involved in
> replication I get this error message:
> ('tblTransPayments' table
> - Unable to modify table.
> ODBC error: [Microsoft][ODBC SQL Server Driver][SQL Server]
> Cannot drop the table 'dbo.tblTransPayments' because it is
> being used for replication.)
> It should be noticed that I have lots of data in this
> table and I'm not going to drop the table.
> I can easily add my new field at the end of the column's
> list but not as 21th column which I want to.
> Thanks in advance.|||Surajit,
this won't give the ability to specify the position, and Matthew doesn't
want the column created at the end.
Regards,
Paul Ibison
Adding new field in a table which being used for replication
I'm trying to add a new field in a table and in my desired
position (OrdinalPosition), but I can not and I get the
following error message. As this table is involved in
replication I get this error message:
('tblTransPayments' table
- Unable to modify table.
ODBC error: [Microsoft][ODBC SQL Server Driver][SQL Server]
Cannot drop the table 'dbo.tblTransPayments' because it is
being used for replication.)
It should be noticed that I have lots of data in this
table and I'm not going to drop the table.
I can easily add my new field at the end of the column's
list but not as 21th column which I want to.
Thanks in advance.Hi -
Please check SQL BOL for "sp_repladdcolumn" and "sp_repldropcolumn".
Thanks
-Surajit
"Mattew" <anonymous@.discussions.microsoft.com> wrote in message
news:19d4101c44d7b$6507c260$a101280a@.phx.gbl...
> Hi dear friends,
> I'm trying to add a new field in a table and in my desired
> position (OrdinalPosition), but I can not and I get the
> following error message. As this table is involved in
> replication I get this error message:
> ('tblTransPayments' table
> - Unable to modify table.
> ODBC error: [Microsoft][ODBC SQL Server Driver][SQL Server]
> Cannot drop the table 'dbo.tblTransPayments' because it is
> being used for replication.)
> It should be noticed that I have lots of data in this
> table and I'm not going to drop the table.
> I can easily add my new field at the end of the column's
> list but not as 21th column which I want to.
> Thanks in advance.|||Surajit,
this won't give the ability to specify the position, and Matthew doesn't
want the column created at the end.
Regards,
Paul Ibison
Friday, February 24, 2012
Adding Fields to a large table
I implemented a datawarehouse for a midsized retail company on SQL Server
2005. One of their facttables is a daily stock snapshot with about 50
millions of records.
Business now want to create a new report. This report requires several
calculated values. The requirement says this values should be stored in the
warehouse.
Here is my question: When I add 3 more decimal fields (18,9) to this stock
table - how does this affect the size of the record/table when they have NULL
values or a value?
Thanks in advance for your help,
Regards,
Marc
Marc,
They will take up 9 bytes each regardless of whether or not they are null.
-- Bill
"Marc" <Roger_Rombooth@.community.nospam> wrote in message
news:CB83237B-BDE4-467F-8C4B-AD9C88D972B5@.microsoft.com...
> Dear all
> I implemented a datawarehouse for a midsized retail company on SQL Server
> 2005. One of their facttables is a daily stock snapshot with about 50
> millions of records.
> Business now want to create a new report. This report requires several
> calculated values. The requirement says this values should be stored in
> the
> warehouse.
> Here is my question: When I add 3 more decimal fields (18,9) to this stock
> table - how does this affect the size of the record/table when they have
> NULL
> values or a value?
> Thanks in advance for your help,
> Regards,
> Marc
>
|||Hello Marc,
As Bill mentioned, fixed length data will take up the bytes no matter it is
Null or not. Also, in SQL Server 2000, a NULL bitmap is always present,
even if no NULLs are allowed in any column. You may want to refer to the
following link for more details:
Poking about with DBCC PAGE (Part 1 of ?)
https://blogs.msdn.com/sqlserverstorageengine/archive/2006/08/09/692806.aspx
If you have any further questions or comments, please feel free to let's
know. Thank you!
Best Regards,
Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications
<http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx>.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
<http://msdn.microsoft.com/subscriptions/support/default.aspx>.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
|||Thanks Bill and Peter!
Best Regards,
Marc
Adding Fields to a large table
I implemented a datawarehouse for a midsized retail company on SQL Server
2005. One of their facttables is a daily stock snapshot with about 50
millions of records.
Business now want to create a new report. This report requires several
calculated values. The requirement says this values should be stored in the
warehouse.
Here is my question: When I add 3 more decimal fields (18,9) to this stock
table - how does this affect the size of the record/table when they have NUL
L
values or a value?
Thanks in advance for your help,
Regards,
MarcMarc,
They will take up 9 bytes each regardless of whether or not they are null.
-- Bill
"Marc" <Roger_Rombooth@.community.nospam> wrote in message
news:CB83237B-BDE4-467F-8C4B-AD9C88D972B5@.microsoft.com...
> Dear all
> I implemented a datawarehouse for a midsized retail company on SQL Server
> 2005. One of their facttables is a daily stock snapshot with about 50
> millions of records.
> Business now want to create a new report. This report requires several
> calculated values. The requirement says this values should be stored in
> the
> warehouse.
> Here is my question: When I add 3 more decimal fields (18,9) to this stock
> table - how does this affect the size of the record/table when they have
> NULL
> values or a value?
> Thanks in advance for your help,
> Regards,
> Marc
>|||Hello Marc,
As Bill mentioned, fixed length data will take up the bytes no matter it is
Null or not. Also, in SQL Server 2000, a NULL bitmap is always present,
even if no NULLs are allowed in any column. You may want to refer to the
following link for more details:
Poking about with DBCC PAGE (Part 1 of ?)
https://blogs.msdn.com/sqlserversto.../09/692806.aspx
If you have any further questions or comments, please feel free to let's
know. Thank you!
Best Regards,
Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Community Support
========================================
==========
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscript...ault.aspx#notif
ications
<http://msdn.microsoft.com/subscript...ps/default.aspx>.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
<http://msdn.microsoft.com/subscript...rt/default.aspx>.
========================================
==========
This posting is provided "AS IS" with no warranties, and confers no rights.|||Thanks Bill and Peter!
Best Regards,
Marc
Thursday, February 16, 2012
Adding commets into every field
How do I such thing? I've got a table with 140 columns and I should need to
introduce a comment. Is there any programatically way for that?
I know that ORACLE uses COMMENT ON <FIELD>...
Thanks for any help,
EnricCheck out sp_addextendedproperty and fn_listextendedproperty
in BOL.|||Thanks Mark... Any example?
oh my god
"markc600@.hotmail.com" wrote:
> Check out sp_addextendedproperty and fn_listextendedproperty
> in BOL.
>|||create table dbo.sometable(col1 int, col2 int)
-- Add comments per column here
exec sp_addextendedproperty 'MS_Description', 'comments for col1',
'user', dbo, 'table', sometable, 'column', col1
exec sp_addextendedproperty 'MS_Description', 'comments for col2',
'user', dbo, 'table', sometable, 'column', col2
-- These comments will show up in Enterprise Manager as well
select *
from ::fn_listextendedproperty ('MS_Description', 'User','dbo','table',
'sometable', 'column', default)
exec sp_dropextendedproperty 'MS_Description',
'user', dbo, 'table', sometable, 'column', col1
exec sp_dropextendedproperty 'MS_Description',
'user', dbo, 'table', sometable, 'column', col2|||Thanks again for that.
Regards,
"markc600@.hotmail.com" wrote:
> create table dbo.sometable(col1 int, col2 int)
> -- Add comments per column here
> exec sp_addextendedproperty 'MS_Description', 'comments for col1',
> 'user', dbo, 'table', sometable, 'column', col1
> exec sp_addextendedproperty 'MS_Description', 'comments for col2',
> 'user', dbo, 'table', sometable, 'column', col2
>
> -- These comments will show up in Enterprise Manager as well
> select *
> from ::fn_listextendedproperty ('MS_Description', 'User','dbo','table',
> 'sometable', 'column', default)
>
> exec sp_dropextendedproperty 'MS_Description',
> 'user', dbo, 'table', sometable, 'column', col1
> exec sp_dropextendedproperty 'MS_Description',
> 'user', dbo, 'table', sometable, 'column', col2
>
Monday, February 13, 2012
Adding Columns Dynamically
Dear All,
I have a requirement, in which i have to add columns dynamically depending the records of a master table in sql server 2000.
Pl, do help me
If you mean a query, than there is no way to do that beside dynamic SQL. if you want to use dynamic SQL, make sure you first read the article of Erland to fully understand what you are doing:http://www.sommarskog.se/dynamic_sql.html
HTH, Jens SUessmeyer.
http://www.sqlserver2005.de
|||
A.K.A Cross Tab query
Research SELECT CASE WHEN THEN END AS []
Adamus
Adding Column To A Table At a Specific Position
Is there a way in T-Sql where I can add a column in a specific order to an
existing table. For instance, if I have the following table
1. EmpID
2.Fname
3. Mname
4. Lname
5. Add1
6.Add2
I want to insert a Column PHNo before column 5. Is there a possibility in
T-SQL for this.
Hope to hear from you soon.
TIA.
Saleem
Muhammad Saleem Usmani
9-Sassi Town House
Abdullah Haroon Road
Karachi
PH: 92-21-521-2042-3
FAX: 92-21-521-2046
CELL: 0300-822-0105
support-karachi@.autosoftdynamics.com
usmani@.autosoftdynamics.com
I choose Polesoft Lockspam to fight spam, and you?
http://www.polesoft.com/refer.htmlOn Thu, 4 Nov 2004 15:25:12 +0500, Muhammad Saleem Usmani wrote:
>I want to insert a Column PHNo before column 5. Is there a possibility in
>T-SQL for this.
Hi Muhammad,
No, the only way you can achieve this is by dropping and recreating the
table.
Why would you want this? A table in a relational database is UNordered by
definition; you should assign no meaning to the cardinal positions of
columns, nor should you use code that relies on column order.
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)|||Hi
No. The only way would be to re-create the table with the new structure and
copy the data over.
If you need to have a specific order for a select, you should specifcy the
columns in the select statement.
Regards
Mike
"Muhammad Saleem Usmani" wrote:
> Dear All
> Is there a way in T-Sql where I can add a column in a specific order to an
> existing table. For instance, if I have the following table
> 1. EmpID
> 2.Fname
> 3. Mname
> 4. Lname
> 5. Add1
> 6.Add2
> I want to insert a Column PHNo before column 5. Is there a possibility in
> T-SQL for this.
> Hope to hear from you soon.
> TIA.
> Saleem
>
> --
> Muhammad Saleem Usmani
> 9-Sassi Town House
> Abdullah Haroon Road
> Karachi
> PH: 92-21-521-2042-3
> FAX: 92-21-521-2046
> CELL: 0300-822-0105
> support-karachi@.autosoftdynamics.com
> usmani@.autosoftdynamics.com
>
> I choose Polesoft Lockspam to fight spam, and you?
> http://www.polesoft.com/refer.html
>
>|||I agree with the others... When I first started doing SQL I was all into the
physical ordering of the columns, because my background was COBOL, and it
was important there...But trying to keep up with this will be a nightmare...
It would be better to begin to enforce with the programmers, never to select
* , always use column names. Always use the column list in an insert
statement ie
insert into mytab ( col1, colu2) values ( 1,2)
this frees you up from the logical ordering of columns...
Good luck to you!
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Muhammad Saleem Usmani" <support-karachi@.autosoftdynamics.com> wrote in
message news:%23VUd$glwEHA.3908@.TK2MSFTNGP12.phx.gbl...
> Dear All
> Is there a way in T-Sql where I can add a column in a specific order to an
> existing table. For instance, if I have the following table
> 1. EmpID
> 2.Fname
> 3. Mname
> 4. Lname
> 5. Add1
> 6.Add2
> I want to insert a Column PHNo before column 5. Is there a possibility in
> T-SQL for this.
> Hope to hear from you soon.
> TIA.
> Saleem
>
> --
> Muhammad Saleem Usmani
> 9-Sassi Town House
> Abdullah Haroon Road
> Karachi
> PH: 92-21-521-2042-3
> FAX: 92-21-521-2046
> CELL: 0300-822-0105
> support-karachi@.autosoftdynamics.com
> usmani@.autosoftdynamics.com
>
> I choose Polesoft Lockspam to fight spam, and you?
> http://www.polesoft.com/refer.html
>|||No. Just in EM.
"Muhammad Saleem Usmani" wrote:
> Dear All
> Is there a way in T-Sql where I can add a column in a specific order to an
> existing table. For instance, if I have the following table
> 1. EmpID
> 2.Fname
> 3. Mname
> 4. Lname
> 5. Add1
> 6.Add2
> I want to insert a Column PHNo before column 5. Is there a possibility in
> T-SQL for this.
> Hope to hear from you soon.
> TIA.
> Saleem
>
> --
> Muhammad Saleem Usmani
> 9-Sassi Town House
> Abdullah Haroon Road
> Karachi
> PH: 92-21-521-2042-3
> FAX: 92-21-521-2046
> CELL: 0300-822-0105
> support-karachi@.autosoftdynamics.com
> usmani@.autosoftdynamics.com
>
> I choose Polesoft Lockspam to fight spam, and you?
> http://www.polesoft.com/refer.html
>
>
Adding Column To A Table At a Specific Position
Is there a way in T-Sql where I can add a column in a specific order to an
existing table. For instance, if I have the following table
1. EmpID
2.Fname
3. Mname
4. Lname
5. Add1
6.Add2
I want to insert a Column PHNo before column 5. Is there a possibility in
T-SQL for this.
Hope to hear from you soon.
TIA.
Saleem
Muhammad Saleem Usmani
9-Sassi Town House
Abdullah Haroon Road
Karachi
PH: 92-21-521-2042-3
FAX: 92-21-521-2046
CELL: 0300-822-0105
support-karachi@.autosoftdynamics.com
usmani@.autosoftdynamics.com
I choose Polesoft Lockspam to fight spam, and you?
http://www.polesoft.com/refer.html
On Thu, 4 Nov 2004 15:25:12 +0500, Muhammad Saleem Usmani wrote:
>I want to insert a Column PHNo before column 5. Is there a possibility in
>T-SQL for this.
Hi Muhammad,
No, the only way you can achieve this is by dropping and recreating the
table.
Why would you want this? A table in a relational database is UNordered by
definition; you should assign no meaning to the cardinal positions of
columns, nor should you use code that relies on column order.
Best, Hugo
(Remove _NO_ and _SPAM_ to get my e-mail address)
|||Hi
No. The only way would be to re-create the table with the new structure and
copy the data over.
If you need to have a specific order for a select, you should specifcy the
columns in the select statement.
Regards
Mike
"Muhammad Saleem Usmani" wrote:
> Dear All
> Is there a way in T-Sql where I can add a column in a specific order to an
> existing table. For instance, if I have the following table
> 1. EmpID
> 2.Fname
> 3. Mname
> 4. Lname
> 5. Add1
> 6.Add2
> I want to insert a Column PHNo before column 5. Is there a possibility in
> T-SQL for this.
> Hope to hear from you soon.
> TIA.
> Saleem
>
> --
> Muhammad Saleem Usmani
> 9-Sassi Town House
> Abdullah Haroon Road
> Karachi
> PH: 92-21-521-2042-3
> FAX: 92-21-521-2046
> CELL: 0300-822-0105
> support-karachi@.autosoftdynamics.com
> usmani@.autosoftdynamics.com
>
> I choose Polesoft Lockspam to fight spam, and you?
> http://www.polesoft.com/refer.html
>
>
|||I agree with the others... When I first started doing SQL I was all into the
physical ordering of the columns, because my background was COBOL, and it
was important there...But trying to keep up with this will be a nightmare...
It would be better to begin to enforce with the programmers, never to select
* , always use column names. Always use the column list in an insert
statement ie
insert into mytab ( col1, colu2) values ( 1,2)
this frees you up from the logical ordering of columns...
Good luck to you!
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Muhammad Saleem Usmani" <support-karachi@.autosoftdynamics.com> wrote in
message news:%23VUd$glwEHA.3908@.TK2MSFTNGP12.phx.gbl...
> Dear All
> Is there a way in T-Sql where I can add a column in a specific order to an
> existing table. For instance, if I have the following table
> 1. EmpID
> 2.Fname
> 3. Mname
> 4. Lname
> 5. Add1
> 6.Add2
> I want to insert a Column PHNo before column 5. Is there a possibility in
> T-SQL for this.
> Hope to hear from you soon.
> TIA.
> Saleem
>
> --
> Muhammad Saleem Usmani
> 9-Sassi Town House
> Abdullah Haroon Road
> Karachi
> PH: 92-21-521-2042-3
> FAX: 92-21-521-2046
> CELL: 0300-822-0105
> support-karachi@.autosoftdynamics.com
> usmani@.autosoftdynamics.com
>
> I choose Polesoft Lockspam to fight spam, and you?
> http://www.polesoft.com/refer.html
>
|||No. Just in EM.
"Muhammad Saleem Usmani" wrote:
> Dear All
> Is there a way in T-Sql where I can add a column in a specific order to an
> existing table. For instance, if I have the following table
> 1. EmpID
> 2.Fname
> 3. Mname
> 4. Lname
> 5. Add1
> 6.Add2
> I want to insert a Column PHNo before column 5. Is there a possibility in
> T-SQL for this.
> Hope to hear from you soon.
> TIA.
> Saleem
>
> --
> Muhammad Saleem Usmani
> 9-Sassi Town House
> Abdullah Haroon Road
> Karachi
> PH: 92-21-521-2042-3
> FAX: 92-21-521-2046
> CELL: 0300-822-0105
> support-karachi@.autosoftdynamics.com
> usmani@.autosoftdynamics.com
>
> I choose Polesoft Lockspam to fight spam, and you?
> http://www.polesoft.com/refer.html
>
>
Adding Column To A Table At a Specific Position
Is there a way in T-Sql where I can add a column in a specific order to an
existing table. For instance, if I have the following table
1. EmpID
2.Fname
3. Mname
4. Lname
5. Add1
6.Add2
I want to insert a Column PHNo before column 5. Is there a possibility in
T-SQL for this.
Hope to hear from you soon.
TIA.
Saleem
--
Muhammad Saleem Usmani
9-Sassi Town House
Abdullah Haroon Road
Karachi
PH: 92-21-521-2042-3
FAX: 92-21-521-2046
CELL: 0300-822-0105
support-karachi@.autosoftdynamics.com
usmani@.autosoftdynamics.com
I choose Polesoft Lockspam to fight spam, and you?
http://www.polesoft.com/refer.htmlOn Thu, 4 Nov 2004 15:25:12 +0500, Muhammad Saleem Usmani wrote:
>I want to insert a Column PHNo before column 5. Is there a possibility in
>T-SQL for this.
Hi Muhammad,
No, the only way you can achieve this is by dropping and recreating the
table.
Why would you want this? A table in a relational database is UNordered by
definition; you should assign no meaning to the cardinal positions of
columns, nor should you use code that relies on column order.
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)|||Hi
No. The only way would be to re-create the table with the new structure and
copy the data over.
If you need to have a specific order for a select, you should specifcy the
columns in the select statement.
Regards
Mike
"Muhammad Saleem Usmani" wrote:
> Dear All
> Is there a way in T-Sql where I can add a column in a specific order to an
> existing table. For instance, if I have the following table
> 1. EmpID
> 2.Fname
> 3. Mname
> 4. Lname
> 5. Add1
> 6.Add2
> I want to insert a Column PHNo before column 5. Is there a possibility in
> T-SQL for this.
> Hope to hear from you soon.
> TIA.
> Saleem
>
> --
> Muhammad Saleem Usmani
> 9-Sassi Town House
> Abdullah Haroon Road
> Karachi
> PH: 92-21-521-2042-3
> FAX: 92-21-521-2046
> CELL: 0300-822-0105
> support-karachi@.autosoftdynamics.com
> usmani@.autosoftdynamics.com
>
> I choose Polesoft Lockspam to fight spam, and you?
> http://www.polesoft.com/refer.html
>
>|||I agree with the others... When I first started doing SQL I was all into the
physical ordering of the columns, because my background was COBOL, and it
was important there...But trying to keep up with this will be a nightmare...
It would be better to begin to enforce with the programmers, never to select
* , always use column names. Always use the column list in an insert
statement ie
insert into mytab ( col1, colu2) values ( 1,2)
this frees you up from the logical ordering of columns...
Good luck to you!
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Muhammad Saleem Usmani" <support-karachi@.autosoftdynamics.com> wrote in
message news:%23VUd$glwEHA.3908@.TK2MSFTNGP12.phx.gbl...
> Dear All
> Is there a way in T-Sql where I can add a column in a specific order to an
> existing table. For instance, if I have the following table
> 1. EmpID
> 2.Fname
> 3. Mname
> 4. Lname
> 5. Add1
> 6.Add2
> I want to insert a Column PHNo before column 5. Is there a possibility in
> T-SQL for this.
> Hope to hear from you soon.
> TIA.
> Saleem
>
> --
> Muhammad Saleem Usmani
> 9-Sassi Town House
> Abdullah Haroon Road
> Karachi
> PH: 92-21-521-2042-3
> FAX: 92-21-521-2046
> CELL: 0300-822-0105
> support-karachi@.autosoftdynamics.com
> usmani@.autosoftdynamics.com
>
> I choose Polesoft Lockspam to fight spam, and you?
> http://www.polesoft.com/refer.html
>|||No. Just in EM.
"Muhammad Saleem Usmani" wrote:
> Dear All
> Is there a way in T-Sql where I can add a column in a specific order to an
> existing table. For instance, if I have the following table
> 1. EmpID
> 2.Fname
> 3. Mname
> 4. Lname
> 5. Add1
> 6.Add2
> I want to insert a Column PHNo before column 5. Is there a possibility in
> T-SQL for this.
> Hope to hear from you soon.
> TIA.
> Saleem
>
> --
> Muhammad Saleem Usmani
> 9-Sassi Town House
> Abdullah Haroon Road
> Karachi
> PH: 92-21-521-2042-3
> FAX: 92-21-521-2046
> CELL: 0300-822-0105
> support-karachi@.autosoftdynamics.com
> usmani@.autosoftdynamics.com
>
> I choose Polesoft Lockspam to fight spam, and you?
> http://www.polesoft.com/refer.html
>
>
Adding column in table in repliation
I want to add a column to the table which is in the
replication please suggest how i can achive the same.
I am using Merge Replication.
Best regards
Sharad
Sharad,
have a look in BOL for sp_repladdcolumn - this is the procedure you'll need.
Regards,
Paul Ibison
|||This script will require reinitialization - better to use sp_repladdcolumn.
Regards,
Paul Ibison
Sunday, February 12, 2012
Adding an SQL Server database to a Websolution
Dear Forum
I really hope someone can help me with the following - it's eating me up.
I'm creating a website in VS2005 and want to add an SQL Server database to the Solution, og I've created a subfolder to the App_Data folder called Database. Now when I click Add New Item and choose SQL database in the Add New Item dialog box I get the following error message
Connections to SQL Server files (*.mdf) require SQL Server Express to function properly. Please verify installation of the component or download from the URL: http://go.microsoft.com/fwlink/?LinkId49251
Now at some point in the past I installed Visual Basic, Visual Web developer and SQL Server express edition, but when I got hold of VS2005 Professional Edition I carefully made sure that all Express version of any VS software was uninstalled beforehand. So now I have only VS2005 Professional Edition and SQL Server 2005 Developer Edition (32 bit) installed on my computer.
I have checked all the environment settings, and can't find a single thing that should point to SQL Server Express Edition.
I would really appriciate if you could give me a helping hand before I loose my sanity.
Thanks a hole bunch.
Tina
My guess is that is because the purpose of placing mdf files in the app_data folder is to attach them to a SQL Server instance and out of the box you cannot attach mdf files to SQL Server except for the Express edition but it is possible to attach mdf files to any edition of SQL Server but it is not recommended to enable this feature on Servers.
There is an article on the MSDN Library I know of that explains how to enable this feature but I cannot seem to find it, as I recall it, you had to start the mssqlserver with the -express argument, but I am not sure about this.
|||Also I have the same problem and I have resolve it installing sql express 2005 (your link dont work correctly)
you can download sql 2005 form the following link
http://go.microsoft.com/fwlink/?LinkId=49251
Microsoft SQL Server 2005 Express Edition
http://www.microsoft.com/downloads/details.aspx?familyid=220549b5-0b07-4448-8848-dcc397514b41&displaylang=en
|||If I am not mistaken the developer edition of SQL Server 2005 does not support hosting a database.
You can download SQL Server 2005 express and create an instance of a database using that application.
Once the database has been created inside SQL Server 2005 (IF Developer works all the more power to you). You can then establish a connection within Visual Studio 2005 to that database in order to use in your projects.
Hope this helps.
Chris McNear
Adding an SQL Server database to a Websolution
Dear Forum
I really hope someone can help me with the following - it's eating me up.
I'm creating a website in VS2005 and want to add an SQL Server database to the Solution, og I've created a subfolder to the App_Data folder called Database. Now when I click Add New Item and choose SQL database in the Add New Item dialog box I get the following error message
Connections to SQL Server files (*.mdf) require SQL Server Express to function properly. Please verify installation of the component or download from the URL: http://go.microsoft.com/fwlink/?LinkId49251
Now at some point in the past I installed Visual Basic, Visual Web developer and SQL Server express edition, but when I got hold of VS2005 Professional Edition I carefully made sure that all Express version of any VS software was uninstalled beforehand. So now I have only VS2005 Professional Edition and SQL Server 2005 Developer Edition (32 bit) installed on my computer.
I have checked all the environment settings, and can't find a single thing that should point to SQL Server Express Edition.
I would really appriciate if you could give me a helping hand before I loose my sanity.
Thanks a hole bunch.
Tina
My guess is that is because the purpose of placing mdf files in the app_data folder is to attach them to a SQL Server instance and out of the box you cannot attach mdf files to SQL Server except for the Express edition but it is possible to attach mdf files to any edition of SQL Server but it is not recommended to enable this feature on Servers.
There is an article on the MSDN Library I know of that explains how to enable this feature but I cannot seem to find it, as I recall it, you had to start the mssqlserver with the -express argument, but I am not sure about this.
|||Also I have the same problem and I have resolve it installing sql express 2005 (your link dont work correctly)
you can download sql 2005 form the following link
http://go.microsoft.com/fwlink/?LinkId=49251
Microsoft SQL Server 2005 Express Edition
http://www.microsoft.com/downloads/details.aspx?familyid=220549b5-0b07-4448-8848-dcc397514b41&displaylang=en
|||If I am not mistaken the developer edition of SQL Server 2005 does not support hosting a database.
You can download SQL Server 2005 express and create an instance of a database using that application.
Once the database has been created inside SQL Server 2005 (IF Developer works all the more power to you). You can then establish a connection within Visual Studio 2005 to that database in order to use in your projects.
Hope this helps.
Chris McNear