Thursday, March 29, 2012

Basic Question: Setting a varaiable to a datasource.select value

Hi!


I am trying to do something that I would think should be rather simple.

I have a SQLDataSource that has a simple select statement.

I have a String Variable st_temp

I know my SQLDataSource returns only one value, and it's a string.

HOW DO I DO somehitng like st_temp=SQLDataSource.Select;

I am getting nothing but errorrs

Thanks in advance

Dan

What errors are you getting?|||

If you are using just a single value then there is no need for SQLDataSource object. You can directly use SQLCommand.ExecuteScalar() method.

|||

2 things:

1. sorry to be so dense but how do I use SQLCommand.ExecuteScalar() method. in C#?

2. Errors are

":CS0201: Only assignment, call, increment, decrement, and new object expressions can be used as a statement" when I call SDSSelect.Select;

and

":CS0428: Cannot convert method group 'Select' to non-delegate type 'string'. Did you intend to invoke the method?" when I call Label1.Text= SDSSelect.Select;



Thanks again for the help...i shouldda stayed in Java land!|||

Thanks for all the HELP!!!

Dan

Basic question.... on Index....

Why the name clustered is used in the clustered index? What is exactly
clustered here?
Thanks,
Jessy
Hi,
Physical ordering of data inside the data page will be same as the Index key
order.
The pages in the data chain and the records on the pages are ordered on the
value of the clustered index key. All inserts are made at the point the key
value in the inserted row fits in the ordering sequence.
See more details of cluetsred index in books online.
Thanks
Hari
SQL Server MVP
"Jessy Martin" <Jessy_Smith79@.hotmail.com> wrote in message
news:%23Sy2IfsZFHA.3852@.TK2MSFTNGP10.phx.gbl...
> Why the name clustered is used in the clustered index? What is exactly
> clustered here?
> Thanks,
> Jessy
>
|||Clustered means the index keys and the table are clustered in the same page?
Jessy
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:%23xMrpksZFHA.2128@.TK2MSFTNGP14.phx.gbl...
> Hi,
> Physical ordering of data inside the data page will be same as the Index
key
> order.
> The pages in the data chain and the records on the pages are ordered on
the
> value of the clustered index key. All inserts are made at the point the
key
> value in the inserted row fits in the ordering sequence.
> See more details of cluetsred index in books online.
>
> Thanks
> Hari
> SQL Server MVP
>
> "Jessy Martin" <Jessy_Smith79@.hotmail.com> wrote in message
> news:%23Sy2IfsZFHA.3852@.TK2MSFTNGP10.phx.gbl...
>
|||Hi,
No. There are seperate Index and Data pages. read the below article.
http://msdn.microsoft.com/library/de...es_05_5h6b.asp
Thanks
Hari
SQL Server MVP
"Jessy Martin" <Jessy_Smith79@.hotmail.com> wrote in message
news:%23rDFQpsZFHA.2124@.TK2MSFTNGP14.phx.gbl...
> Clustered means the index keys and the table are clustered in the same
> page?
> Jessy
>
> "Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
> news:%23xMrpksZFHA.2128@.TK2MSFTNGP14.phx.gbl...
> key
> the
> key
>
|||"Jessy Martin" <Jessy_Smith79@.hotmail.com> wrote in message
news:#Sy2IfsZFHA.3852@.TK2MSFTNGP10.phx.gbl...
> Why the name clustered is used in the clustered index? What is exactly
> clustered here?
> Thanks,
> Jessy
>
As an example...
A clustered index is sort of like a dictionary. The keys (dictionary words)
are stored in sorted order. If you need to add a new row called Alligator,
then it would be placed in the correct location in the dictionary.
A non-clustered index is more like the index you find at the back of a book.
The index at the back of the book is stored in sorted order, however, it has
page numbers which tell you to go to page xx to find your word. When you
insert a row here, the data will be appended to the end of the table (unless
you have a clustered index on it), and the index at the back of the book
will be updated appropriately.
One thing to note is that when you have a nonclustered index on a table that
has a clustered index, the "page numbers" don't actually point at the pages,
but rather point at the clustered index key (dictionary word from above).
When you do an insert, the nonclustered index has it's row modified and it
then points to the clustered index key and the row is added in the
dictionary order.
HTH
Rick Sawtell
MCT, MCSD, MCDBA
|||Excellent explanation. This is the sort of explanation I was looking
Thank you very much,
Jessy
"Rick Sawtell" <r_sawtell@.hotmail.com> wrote in message
news:OYPXjysZFHA.1456@.TK2MSFTNGP15.phx.gbl...
> "Jessy Martin" <Jessy_Smith79@.hotmail.com> wrote in message
> news:#Sy2IfsZFHA.3852@.TK2MSFTNGP10.phx.gbl...
> As an example...
> A clustered index is sort of like a dictionary. The keys (dictionary
words)
> are stored in sorted order. If you need to add a new row called
Alligator,
> then it would be placed in the correct location in the dictionary.
> A non-clustered index is more like the index you find at the back of a
book.
> The index at the back of the book is stored in sorted order, however, it
has
> page numbers which tell you to go to page xx to find your word. When you
> insert a row here, the data will be appended to the end of the table
(unless
> you have a clustered index on it), and the index at the back of the book
> will be updated appropriately.
> One thing to note is that when you have a nonclustered index on a table
that
> has a clustered index, the "page numbers" don't actually point at the
pages,
> but rather point at the clustered index key (dictionary word from above).
> When you do an insert, the nonclustered index has it's row modified and it
> then points to the clustered index key and the row is added in the
> dictionary order.
> HTH
> Rick Sawtell
> MCT, MCSD, MCDBA
>
>
|||One of the main benefits of clustered indexes is that you can get better
response for range queries or queries with duplicate keys, because the data
is stored on the same or side by side pages. An IO of 1 page will return
multiple rows that satisfy such a query, reducing IO time in a big way.
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
"Jessy Martin" <Jessy_Smith79@.hotmail.com> wrote in message
news:%23Sy2IfsZFHA.3852@.TK2MSFTNGP10.phx.gbl...
> Why the name clustered is used in the clustered index? What is exactly
> clustered here?
> Thanks,
> Jessy
>
|||Hari:
I'm not sure what you mean by this statement. Your statement is true for
non-clustered indexes, but for the clustered index, the index key and the
data are on the same pages and ARE the data pages. The clustered index does
not use Index pages; they are the data pages, at the leaf level.
Sincerely,
Anthony Thomas

"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:%23Tcu7vsZFHA.3120@.TK2MSFTNGP12.phx.gbl...
Hi,
No. There are seperate Index and Data pages. read the below article.
http://msdn.microsoft.com/library/de...es_05_5h6b.asp
Thanks
Hari
SQL Server MVP
"Jessy Martin" <Jessy_Smith79@.hotmail.com> wrote in message
news:%23rDFQpsZFHA.2124@.TK2MSFTNGP14.phx.gbl...
> Clustered means the index keys and the table are clustered in the same
> page?
> Jessy
>
> "Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
> news:%23xMrpksZFHA.2128@.TK2MSFTNGP14.phx.gbl...
> key
> the
> key
>
sql

Basic question.... on Index....

Why the name clustered is used in the clustered index? What is exactly
clustered here?
Thanks,
JessyHi,
Physical ordering of data inside the data page will be same as the Index key
order.
The pages in the data chain and the records on the pages are ordered on the
value of the clustered index key. All inserts are made at the point the key
value in the inserted row fits in the ordering sequence.
See more details of cluetsred index in books online.
Thanks
Hari
SQL Server MVP
"Jessy Martin" <Jessy_Smith79@.hotmail.com> wrote in message
news:%23Sy2IfsZFHA.3852@.TK2MSFTNGP10.phx.gbl...
> Why the name clustered is used in the clustered index? What is exactly
> clustered here?
> Thanks,
> Jessy
>|||Clustered means the index keys and the table are clustered in the same page?
Jessy
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:%23xMrpksZFHA.2128@.TK2MSFTNGP14.phx.gbl...
> Hi,
> Physical ordering of data inside the data page will be same as the Index
key
> order.
> The pages in the data chain and the records on the pages are ordered on
the
> value of the clustered index key. All inserts are made at the point the
key
> value in the inserted row fits in the ordering sequence.
> See more details of cluetsred index in books online.
>
> Thanks
> Hari
> SQL Server MVP
>
> "Jessy Martin" <Jessy_Smith79@.hotmail.com> wrote in message
> news:%23Sy2IfsZFHA.3852@.TK2MSFTNGP10.phx.gbl...
> > Why the name clustered is used in the clustered index? What is exactly
> > clustered here?
> >
> > Thanks,
> >
> > Jessy
> >
> >
>|||Hi,
No. There are seperate Index and Data pages. read the below article.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/createdb/cm_8_des_05_5h6b.asp
Thanks
Hari
SQL Server MVP
"Jessy Martin" <Jessy_Smith79@.hotmail.com> wrote in message
news:%23rDFQpsZFHA.2124@.TK2MSFTNGP14.phx.gbl...
> Clustered means the index keys and the table are clustered in the same
> page?
> Jessy
>
> "Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
> news:%23xMrpksZFHA.2128@.TK2MSFTNGP14.phx.gbl...
>> Hi,
>> Physical ordering of data inside the data page will be same as the Index
> key
>> order.
>> The pages in the data chain and the records on the pages are ordered on
> the
>> value of the clustered index key. All inserts are made at the point the
> key
>> value in the inserted row fits in the ordering sequence.
>> See more details of cluetsred index in books online.
>>
>> Thanks
>> Hari
>> SQL Server MVP
>>
>> "Jessy Martin" <Jessy_Smith79@.hotmail.com> wrote in message
>> news:%23Sy2IfsZFHA.3852@.TK2MSFTNGP10.phx.gbl...
>> > Why the name clustered is used in the clustered index? What is exactly
>> > clustered here?
>> >
>> > Thanks,
>> >
>> > Jessy
>> >
>> >
>>
>|||"Jessy Martin" <Jessy_Smith79@.hotmail.com> wrote in message
news:#Sy2IfsZFHA.3852@.TK2MSFTNGP10.phx.gbl...
> Why the name clustered is used in the clustered index? What is exactly
> clustered here?
> Thanks,
> Jessy
>
As an example...
A clustered index is sort of like a dictionary. The keys (dictionary words)
are stored in sorted order. If you need to add a new row called Alligator,
then it would be placed in the correct location in the dictionary.
A non-clustered index is more like the index you find at the back of a book.
The index at the back of the book is stored in sorted order, however, it has
page numbers which tell you to go to page xx to find your word. When you
insert a row here, the data will be appended to the end of the table (unless
you have a clustered index on it), and the index at the back of the book
will be updated appropriately.
One thing to note is that when you have a nonclustered index on a table that
has a clustered index, the "page numbers" don't actually point at the pages,
but rather point at the clustered index key (dictionary word from above).
When you do an insert, the nonclustered index has it's row modified and it
then points to the clustered index key and the row is added in the
dictionary order.
HTH
Rick Sawtell
MCT, MCSD, MCDBA|||Excellent explanation. This is the sort of explanation I was looking
Thank you very much,
Jessy
"Rick Sawtell" <r_sawtell@.hotmail.com> wrote in message
news:OYPXjysZFHA.1456@.TK2MSFTNGP15.phx.gbl...
> "Jessy Martin" <Jessy_Smith79@.hotmail.com> wrote in message
> news:#Sy2IfsZFHA.3852@.TK2MSFTNGP10.phx.gbl...
> > Why the name clustered is used in the clustered index? What is exactly
> > clustered here?
> >
> > Thanks,
> >
> > Jessy
> >
> >
> As an example...
> A clustered index is sort of like a dictionary. The keys (dictionary
words)
> are stored in sorted order. If you need to add a new row called
Alligator,
> then it would be placed in the correct location in the dictionary.
> A non-clustered index is more like the index you find at the back of a
book.
> The index at the back of the book is stored in sorted order, however, it
has
> page numbers which tell you to go to page xx to find your word. When you
> insert a row here, the data will be appended to the end of the table
(unless
> you have a clustered index on it), and the index at the back of the book
> will be updated appropriately.
> One thing to note is that when you have a nonclustered index on a table
that
> has a clustered index, the "page numbers" don't actually point at the
pages,
> but rather point at the clustered index key (dictionary word from above).
> When you do an insert, the nonclustered index has it's row modified and it
> then points to the clustered index key and the row is added in the
> dictionary order.
> HTH
> Rick Sawtell
> MCT, MCSD, MCDBA
>
>|||One of the main benefits of clustered indexes is that you can get better
response for range queries or queries with duplicate keys, because the data
is stored on the same or side by side pages. An IO of 1 page will return
multiple rows that satisfy such a query, reducing IO time in a big way.
--
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
"Jessy Martin" <Jessy_Smith79@.hotmail.com> wrote in message
news:%23Sy2IfsZFHA.3852@.TK2MSFTNGP10.phx.gbl...
> Why the name clustered is used in the clustered index? What is exactly
> clustered here?
> Thanks,
> Jessy
>|||Hari:
I'm not sure what you mean by this statement. Your statement is true for
non-clustered indexes, but for the clustered index, the index key and the
data are on the same pages and ARE the data pages. The clustered index does
not use Index pages; they are the data pages, at the leaf level.
Sincerely,
Anthony Thomas
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:%23Tcu7vsZFHA.3120@.TK2MSFTNGP12.phx.gbl...
Hi,
No. There are seperate Index and Data pages. read the below article.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/createdb/cm_8_des_05_5h6b.asp
Thanks
Hari
SQL Server MVP
"Jessy Martin" <Jessy_Smith79@.hotmail.com> wrote in message
news:%23rDFQpsZFHA.2124@.TK2MSFTNGP14.phx.gbl...
> Clustered means the index keys and the table are clustered in the same
> page?
> Jessy
>
> "Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
> news:%23xMrpksZFHA.2128@.TK2MSFTNGP14.phx.gbl...
>> Hi,
>> Physical ordering of data inside the data page will be same as the Index
> key
>> order.
>> The pages in the data chain and the records on the pages are ordered on
> the
>> value of the clustered index key. All inserts are made at the point the
> key
>> value in the inserted row fits in the ordering sequence.
>> See more details of cluetsred index in books online.
>>
>> Thanks
>> Hari
>> SQL Server MVP
>>
>> "Jessy Martin" <Jessy_Smith79@.hotmail.com> wrote in message
>> news:%23Sy2IfsZFHA.3852@.TK2MSFTNGP10.phx.gbl...
>> > Why the name clustered is used in the clustered index? What is exactly
>> > clustered here?
>> >
>> > Thanks,
>> >
>> > Jessy
>> >
>> >
>>
>

Basic question.... on Index....

Why the name clustered is used in the clustered index? What is exactly
clustered here?
Thanks,
JessyHi,
Physical ordering of data inside the data page will be same as the Index key
order.
The pages in the data chain and the records on the pages are ordered on the
value of the clustered index key. All inserts are made at the point the key
value in the inserted row fits in the ordering sequence.
See more details of cluetsred index in books online.
Thanks
Hari
SQL Server MVP
"Jessy Martin" <Jessy_Smith79@.hotmail.com> wrote in message
news:%23Sy2IfsZFHA.3852@.TK2MSFTNGP10.phx.gbl...
> Why the name clustered is used in the clustered index? What is exactly
> clustered here?
> Thanks,
> Jessy
>|||Clustered means the index keys and the table are clustered in the same page?
Jessy
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:%23xMrpksZFHA.2128@.TK2MSFTNGP14.phx.gbl...
> Hi,
> Physical ordering of data inside the data page will be same as the Index
key
> order.
> The pages in the data chain and the records on the pages are ordered on
the
> value of the clustered index key. All inserts are made at the point the
key
> value in the inserted row fits in the ordering sequence.
> See more details of cluetsred index in books online.
>
> Thanks
> Hari
> SQL Server MVP
>
> "Jessy Martin" <Jessy_Smith79@.hotmail.com> wrote in message
> news:%23Sy2IfsZFHA.3852@.TK2MSFTNGP10.phx.gbl...
>|||Hi,
No. There are seperate Index and Data pages. read the below article.
_05_5h6b.asp" target="_blank">http://msdn.microsoft.com/library/d...>
_05_5h6b.asp
Thanks
Hari
SQL Server MVP
"Jessy Martin" <Jessy_Smith79@.hotmail.com> wrote in message
news:%23rDFQpsZFHA.2124@.TK2MSFTNGP14.phx.gbl...
> Clustered means the index keys and the table are clustered in the same
> page?
> Jessy
>
> "Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
> news:%23xMrpksZFHA.2128@.TK2MSFTNGP14.phx.gbl...
> key
> the
> key
>|||"Jessy Martin" <Jessy_Smith79@.hotmail.com> wrote in message
news:#Sy2IfsZFHA.3852@.TK2MSFTNGP10.phx.gbl...
> Why the name clustered is used in the clustered index? What is exactly
> clustered here?
> Thanks,
> Jessy
>
As an example...
A clustered index is sort of like a dictionary. The keys (dictionary words)
are stored in sorted order. If you need to add a new row called Alligator,
then it would be placed in the correct location in the dictionary.
A non-clustered index is more like the index you find at the back of a book.
The index at the back of the book is stored in sorted order, however, it has
page numbers which tell you to go to page xx to find your word. When you
insert a row here, the data will be appended to the end of the table (unless
you have a clustered index on it), and the index at the back of the book
will be updated appropriately.
One thing to note is that when you have a nonclustered index on a table that
has a clustered index, the "page numbers" don't actually point at the pages,
but rather point at the clustered index key (dictionary word from above).
When you do an insert, the nonclustered index has it's row modified and it
then points to the clustered index key and the row is added in the
dictionary order.
HTH
Rick Sawtell
MCT, MCSD, MCDBA|||Excellent explanation. This is the sort of explanation I was looking
Thank you very much,
Jessy
"Rick Sawtell" <r_sawtell@.hotmail.com> wrote in message
news:OYPXjysZFHA.1456@.TK2MSFTNGP15.phx.gbl...
> "Jessy Martin" <Jessy_Smith79@.hotmail.com> wrote in message
> news:#Sy2IfsZFHA.3852@.TK2MSFTNGP10.phx.gbl...
> As an example...
> A clustered index is sort of like a dictionary. The keys (dictionary
words)
> are stored in sorted order. If you need to add a new row called
Alligator,
> then it would be placed in the correct location in the dictionary.
> A non-clustered index is more like the index you find at the back of a
book.
> The index at the back of the book is stored in sorted order, however, it
has
> page numbers which tell you to go to page xx to find your word. When you
> insert a row here, the data will be appended to the end of the table
(unless
> you have a clustered index on it), and the index at the back of the book
> will be updated appropriately.
> One thing to note is that when you have a nonclustered index on a table
that
> has a clustered index, the "page numbers" don't actually point at the
pages,
> but rather point at the clustered index key (dictionary word from above).
> When you do an insert, the nonclustered index has it's row modified and it
> then points to the clustered index key and the row is added in the
> dictionary order.
> HTH
> Rick Sawtell
> MCT, MCSD, MCDBA
>
>|||One of the main benefits of clustered indexes is that you can get better
response for range queries or queries with duplicate keys, because the data
is stored on the same or side by side pages. An IO of 1 page will return
multiple rows that satisfy such a query, reducing IO time in a big way.
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
"Jessy Martin" <Jessy_Smith79@.hotmail.com> wrote in message
news:%23Sy2IfsZFHA.3852@.TK2MSFTNGP10.phx.gbl...
> Why the name clustered is used in the clustered index? What is exactly
> clustered here?
> Thanks,
> Jessy
>|||Hari:
I'm not sure what you mean by this statement. Your statement is true for
non-clustered indexes, but for the clustered index, the index key and the
data are on the same pages and ARE the data pages. The clustered index does
not use Index pages; they are the data pages, at the leaf level.
Sincerely,
Anthony Thomas
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:%23Tcu7vsZFHA.3120@.TK2MSFTNGP12.phx.gbl...
Hi,
No. There are seperate Index and Data pages. read the below article.
_05_5h6b.asp" target="_blank">http://msdn.microsoft.com/library/d...>
_05_5h6b.asp
Thanks
Hari
SQL Server MVP
"Jessy Martin" <Jessy_Smith79@.hotmail.com> wrote in message
news:%23rDFQpsZFHA.2124@.TK2MSFTNGP14.phx.gbl...
> Clustered means the index keys and the table are clustered in the same
> page?
> Jessy
>
> "Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
> news:%23xMrpksZFHA.2128@.TK2MSFTNGP14.phx.gbl...
> key
> the
> key
>

Basic Question on SQL Server 2005 Backup Theory

I am replicating a large number of databases (the size changes
dynamically) from one sql server to another, all pragmatically.
Once a week, I do a full backup and restore it on the destination.
All other times I am just backing up the log files, copying them over,
and restoring them. Basically a glorified log ship.
About once a week, I get various exceptions stating the following:
********
System.Data.SqlClient.SqlException: BACKUP LOG cannot be performed
because there is no current database backup.
********
My question is: with this scenario, how often do I have to actually
perform a full backup? Does SQL Server 2005 really care?
Thanks a lot,
Michael Gorsuch
> My question is: with this scenario, how often do I have to actually
> perform a full backup? Does SQL Server 2005 really care?
Only the very first time. Assuming you ship all transaction log backups, and don't do anything with
the originating database that break the log backup sequence (like put it in simple recovery model).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Michael Gorsuch" <michael.gorsuch@.gmail.com> wrote in message
news:1177597505.788472.212590@.t39g2000prd.googlegr oups.com...
>I am replicating a large number of databases (the size changes
> dynamically) from one sql server to another, all pragmatically.
> Once a week, I do a full backup and restore it on the destination.
> All other times I am just backing up the log files, copying them over,
> and restoring them. Basically a glorified log ship.
> About once a week, I get various exceptions stating the following:
> ********
> System.Data.SqlClient.SqlException: BACKUP LOG cannot be performed
> because there is no current database backup.
> ********
> My question is: with this scenario, how often do I have to actually
> perform a full backup? Does SQL Server 2005 really care?
> Thanks a lot,
> Michael Gorsuch
>

Basic Question on SQL Server 2005 Backup Theory

I am replicating a large number of databases (the size changes
dynamically) from one sql server to another, all pragmatically.
Once a week, I do a full backup and restore it on the destination.
All other times I am just backing up the log files, copying them over,
and restoring them. Basically a glorified log ship.
About once a week, I get various exceptions stating the following:
********
System.Data.SqlClient.SqlException: BACKUP LOG cannot be performed
because there is no current database backup.
********
My question is: with this scenario, how often do I have to actually
perform a full backup? Does SQL Server 2005 really care?
Thanks a lot,
Michael Gorsuch> My question is: with this scenario, how often do I have to actually
> perform a full backup? Does SQL Server 2005 really care?
Only the very first time. Assuming you ship all transaction log backups, and
don't do anything with
the originating database that break the log backup sequence (like put it in
simple recovery model).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Michael Gorsuch" <michael.gorsuch@.gmail.com> wrote in message
news:1177597505.788472.212590@.t39g2000prd.googlegroups.com...
>I am replicating a large number of databases (the size changes
> dynamically) from one sql server to another, all pragmatically.
> Once a week, I do a full backup and restore it on the destination.
> All other times I am just backing up the log files, copying them over,
> and restoring them. Basically a glorified log ship.
> About once a week, I get various exceptions stating the following:
> ********
> System.Data.SqlClient.SqlException: BACKUP LOG cannot be performed
> because there is no current database backup.
> ********
> My question is: with this scenario, how often do I have to actually
> perform a full backup? Does SQL Server 2005 really care?
> Thanks a lot,
> Michael Gorsuch
>

Basic Question on SQL Server 2005 Backup Theory

I am replicating a large number of databases (the size changes
dynamically) from one sql server to another, all pragmatically.
Once a week, I do a full backup and restore it on the destination.
All other times I am just backing up the log files, copying them over,
and restoring them. Basically a glorified log ship.
About once a week, I get various exceptions stating the following:
********
System.Data.SqlClient.SqlException: BACKUP LOG cannot be performed
because there is no current database backup.
********
My question is: with this scenario, how often do I have to actually
perform a full backup? Does SQL Server 2005 really care?
Thanks a lot,
Michael Gorsuch> My question is: with this scenario, how often do I have to actually
> perform a full backup? Does SQL Server 2005 really care?
Only the very first time. Assuming you ship all transaction log backups, and don't do anything with
the originating database that break the log backup sequence (like put it in simple recovery model).
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Michael Gorsuch" <michael.gorsuch@.gmail.com> wrote in message
news:1177597505.788472.212590@.t39g2000prd.googlegroups.com...
>I am replicating a large number of databases (the size changes
> dynamically) from one sql server to another, all pragmatically.
> Once a week, I do a full backup and restore it on the destination.
> All other times I am just backing up the log files, copying them over,
> and restoring them. Basically a glorified log ship.
> About once a week, I get various exceptions stating the following:
> ********
> System.Data.SqlClient.SqlException: BACKUP LOG cannot be performed
> because there is no current database backup.
> ********
> My question is: with this scenario, how often do I have to actually
> perform a full backup? Does SQL Server 2005 really care?
> Thanks a lot,
> Michael Gorsuch
>sql

Tuesday, March 27, 2012

Basic Question on SQL SELECT Performance

Hi, I hope this is an appropriate group to ask a question about basic SQL
SELECT performance.
I'm creating a VIEW which draws together two tables; T_ONE and T_MANY.
Basically, the VIEW creates a LEFT JOIN from T_ONE to T_MANY so that the Ad
Hoc SQL submitted from the software is simply a SELECT * from the VIEW. (I
like to use views to keep software-embedded SQL as simple as possible.)
Now here's the thing. The item from the WHERE clause when selecting from
this view is from a column in T_MANY. Does this indicate that for
performance reasons I should place T_MANY on the left side of the JOIN? I've
always thought that relative JOIN placement defines logical join
relationship, but that the optimizer would intelligently decide upon the
quickest path to the data, regardless of where a particular table is placed
in the JOIN.
Disclaimer: I'm using a different DBMS right now, Interbase, and was getting
absolutely horrible performance until I switched T_MANY around to the left
side of the join. We're migrating to SQL Server and I'm wondering whether
what I'm seeing is actually a feature of SQL, or whether Interbase simply
doesn't 'have the brains' to optimize the query properly. Would this be a
problem in SQL Server as well? Would an INNER JOIN be more efficient than a
LEFT join (effectively, our relationship constraints mandate that these must
be INNER joins anyway - it's not possible for an entry to exist in either
table without at least one match in the other table) or should it make no
difference?
Thanks for your advice.
Joe GeretzDefintely Inner join is better then Outer Joins.
In the Query, is that you are only filtering the rows between the two tables
with a where clause or is it that you are trying to find out all the left
items and replacing them with values.
From my understanding you are trying to do a simple join. So please use
Inner Join and it should give you a good performance and make sure indexes
are done properly on the tables where the join is made. And if it contains
too many rows then collect statistics before you do the join.
Shyam
"Joseph Geretz" <jgeretz@.nospam.com> wrote in message
news:OxNKHB4DEHA.1544@.TK2MSFTNGP09.phx.gbl...
> Hi, I hope this is an appropriate group to ask a question about basic SQL
> SELECT performance.
> I'm creating a VIEW which draws together two tables; T_ONE and T_MANY.
> Basically, the VIEW creates a LEFT JOIN from T_ONE to T_MANY so that the
Ad
> Hoc SQL submitted from the software is simply a SELECT * from the VIEW. (I
> like to use views to keep software-embedded SQL as simple as possible.)
> Now here's the thing. The item from the WHERE clause when selecting from
> this view is from a column in T_MANY. Does this indicate that for
> performance reasons I should place T_MANY on the left side of the JOIN?
I've
> always thought that relative JOIN placement defines logical join
> relationship, but that the optimizer would intelligently decide upon the
> quickest path to the data, regardless of where a particular table is
placed
> in the JOIN.
> Disclaimer: I'm using a different DBMS right now, Interbase, and was
getting
> absolutely horrible performance until I switched T_MANY around to the left
> side of the join. We're migrating to SQL Server and I'm wondering whether
> what I'm seeing is actually a feature of SQL, or whether Interbase simply
> doesn't 'have the brains' to optimize the query properly. Would this be a
> problem in SQL Server as well? Would an INNER JOIN be more efficient than
a
> LEFT join (effectively, our relationship constraints mandate that these
must
> be INNER joins anyway - it's not possible for an entry to exist in either
> table without at least one match in the other table) or should it make no
> difference?
> Thanks for your advice.
> Joe Geretz
>
>

basic question on permissions..

I have some contractors termserving into my sql2000
server. They need to admin the sql databases and use the
query analyzer. What is the best way for me to give them
permissions to do this without making them local
administrators of the box?Can you allow them to Term Serv into another machine other than SQL?
Running queries and managing the database doesn't equate to having to be a
sysadmin.
What exactly do they need to do?
Perhaps all they need is DBO access to their database, not Sysadmin access
to the entire server.
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.

Basic Question on Join

Hi,

I'm pretty much a database beginner and have what I think is a basic
question:

If I have a table which has a 'status' column and I can have say three
statuses: "active", "pending", "inactive". Is it better to break these
out into a different "Statuses" table?

On the one hand it seems to me it would be better to be in a different
table since I'll index this column because I'll be in a where clause
sometimes and I think indexing it would be easier than indexing the
actual words. On the other hand, are joins going to slow queries down
too much? I read something about creating my own sql server 2000
datatype - would this be a good place to do such a thing?

Thanks for your help. (And if you could provide a reason why one
solution is better than the other so I can start understanding better,
I'd be very appreciative.)

Thanks.nick wrote:
> Hi,
> I'm pretty much a database beginner and have what I think is a basic
> question:
> If I have a table which has a 'status' column and I can have say three
> statuses: "active", "pending", "inactive". Is it better to break these
> out into a different "Statuses" table?
> On the one hand it seems to me it would be better to be in a different
> table since I'll index this column because I'll be in a where clause
> sometimes and I think indexing it would be easier than indexing the
> actual words. On the other hand, are joins going to slow queries down
> too much? I read something about creating my own sql server 2000
> datatype - would this be a good place to do such a thing?
> Thanks for your help. (And if you could provide a reason why one
> solution is better than the other so I can start understanding better,
> I'd be very appreciative.)
> Thanks.

If you're storing addresses should you have 50 separate tables, one for
each state?

Zach|||"nick" <nickgieschen@.hotmail.com> wrote in message
news:305cab98.0411191325.29e48efc@.posting.google.c om...
> Hi,
> I'm pretty much a database beginner and have what I think is a basic
> question:
> If I have a table which has a 'status' column and I can have say three
> statuses: "active", "pending", "inactive". Is it better to break these
> out into a different "Statuses" table?
> On the one hand it seems to me it would be better to be in a different
> table since I'll index this column because I'll be in a where clause
> sometimes and I think indexing it would be easier than indexing the
> actual words. On the other hand, are joins going to slow queries down
> too much? I read something about creating my own sql server 2000
> datatype - would this be a good place to do such a thing?
> Thanks for your help. (And if you could provide a reason why one
> solution is better than the other so I can start understanding better,
> I'd be very appreciative.)

Having a seperate lookup table may give you a better performance, testing is
the best way to determine. The lookup table could have an numeric value
that corresponds to active, pending, inactive and then you store the numeric
value in your main table. You wouldn't necessarily have to join to the
lookup table, you could just say WHERE Status = 1.

Using lookup tables can be more flexible for front-end coding because if
you have additions to your lookup choices you can simply edit the table
rather than digging around in the front-end code.

I wouldn't think a user-defined datatype would be useful for this.

hth|||nick (nickgieschen@.hotmail.com) writes:
> I'm pretty much a database beginner and have what I think is a basic
> question:
> If I have a table which has a 'status' column and I can have say three
> statuses: "active", "pending", "inactive". Is it better to break these
> out into a different "Statuses" table?
> On the one hand it seems to me it would be better to be in a different
> table since I'll index this column because I'll be in a where clause
> sometimes and I think indexing it would be easier than indexing the
> actual words. On the other hand, are joins going to slow queries down
> too much? I read something about creating my own sql server 2000
> datatype - would this be a good place to do such a thing?

Basic question? It is actually one that I run into when I'm database design
every now and when, and the answer is not always the same. Mainly it is a
judgement's call. But these days, I tend to go for the table.

I like to first point that when I decide whether to add a table, or to
just have a column with some distinct values, performance has none to with
that decision. More important is the aspect of maintenance, the possibility
to present the value, extensibility and whether the value is important
enough to deserve a table.

Having a single column like:

status chat(1) NOT NULL CHECK (status IN ('A', 'P', 'I'))

has the advantage that it's up little space in the documentation, and
so easier to grasp. But if the value is to be presented in a GUI, the
GUI gets responsible for doing the translation (or the user gets to see
A, P and I. Another issue, is whether you need to add a new value. For
various reasons when we change tables, our standard routine is to take
the long way and reload the data into a new table. A bit expensive for
a changed CHECK constraint.

If you have a column with a lookup-table like:

status char(1) NOT NULL REFERENCES statusvalues (status)

this is more work for me initially, because I have to create an INSERT-
file with the statusvalues, and there is one more table in the database.
(In our case actually two, because there would also be a name table
that gives translations in different languages.). But if I later need
to add a new value, it's just a matter of changing that INSERT-file and
no need to reload the table. And with all strings in the database, the
GUI gets a simpler job.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

basic question for sp

Hi,
I need to write a sp. In the sp first I do a select statement (select cycle
from table where ... ) it only returns a single value. and the rest of the s
p
will do different select based the value. how can assign the result to a
varable? ThanksJen,
Try:
DECLARE @.MYVAR INT --OR CHAR OR VARCHAR OR...DEPENDING ON VALUE
SELECT @.MYVAR = COL FROM...
HTH
Jerry
"Jen" <Jen@.discussions.microsoft.com> wrote in message
news:CB644854-6C94-48BC-8E45-9DC9A959F0C5@.microsoft.com...
> Hi,
> I need to write a sp. In the sp first I do a select statement (select
> cycle
> from table where ... ) it only returns a single value. and the rest of the
> sp
> will do different select based the value. how can assign the result to a
> varable? Thanks|||Something along the lines of:
SET @.var = ( SELECT ... ) ;
You will have to make sure the select statement returns a single value or
you will get an error.
Anith|||DECLARE @.Variable <type>
SELECT @.Variable = cycle FROM table WHERE ...
John Scragg
"Jen" wrote:

> Hi,
> I need to write a sp. In the sp first I do a select statement (select cycl
e
> from table where ... ) it only returns a single value. and the rest of the
sp
> will do different select based the value. how can assign the result to a
> varable? Thankssql

Basic question about replication

Hi,
I am a newbie to replication. I recently joined a company where I have a SQL
Server running 2000 SP3 and I see a distribution database and Replication
Monitor in the Enterprise Manager.
On going to Tools->Replication ->Configure Publishing, Subscribers and
Distribution a pop-up window comes up. In this window under the Publishers
tab, the name of the Server comes up as selected. In the subscribers tab an
ODBC data source is selected. However, in the Publications database tab, NO
database name is checked.
I want to delete the distribution database. Can I safely assume that no
replication is taking place, since no database has been selected for
replication? Or is there a way to find out if any replication is taking
place? Thanks in advance.Hi,
I am not sure but you can check this by executing
sp_helpreplicationoption
Shows the types of replication options enabled for a server. This stored
procedure is executed at the Publisher on the publication database. Take help
of books onile also.
Manu
"sharman" wrote:
> Hi,
> I am a newbie to replication. I recently joined a company where I have a SQL
> Server running 2000 SP3 and I see a distribution database and Replication
> Monitor in the Enterprise Manager.
> On going to Tools->Replication ->Configure Publishing, Subscribers and
> Distribution a pop-up window comes up. In this window under the Publishers
> tab, the name of the Server comes up as selected. In the subscribers tab an
> ODBC data source is selected. However, in the Publications database tab, NO
> database name is checked.
> I want to delete the distribution database. Can I safely assume that no
> replication is taking place, since no database has been selected for
> replication? Or is there a way to find out if any replication is taking
> place? Thanks in advance.
>

Basic Question about password and logon command

I have running SQL queries all day and have been getting tired of selecting the DATA SOURCE NAME and then having to type in the appropriate password. What can I add to my SQL command to do this for me?
Thanks for the help!
NormDo you mean like a connect line in your script?|||Originally posted by exdter
Do you mean like a connect line in your script?

Yes, exactly|||Is this what you mean?
The first line of your script should be
conn[ect] user/password/database
The problem with this is that your password won't be encrypted, so someone can see it.
I hope this helps.|||Originally posted by exdter
Is this what you mean?
The first line of your script should be
conn[ect] user/password/database
The problem with this is that your password won't be encrypted, so someone can see it.
I hope this helps.

Forgive my ignorance but I don't think I asked for the right thing.

Here's what I'm looking at....

I'm in Access and I run an SQL query such as:

select COUNT(*) from employee_data where title = 'Programmer'

and the next thing you know is a window pops up where I need to click on the "Machine Data Source" tab and then the appropriate "Data Source Name" which then has me type in my password.

Thanks for the help.

Norm|||Oh, sorry. I can't help with that one.
I don't know Access.

Basic Question - Truncate Log

Hello Experts
We just started using SQL Server 7.0 in our organization which had come
along with BackOffice with NT 4.0. We have just started putting in some data
in it and have created some tables and some relationships.
My Question is
Should One Truncate Log?
If Yes When Should it be done?
Would appreciate your suggestions on this - THANKS in advance
Regards
Manish Sawjiani
Three Cheers to Technet for the Help!
I suggest you start with Tibor's aricle:
http://www.karaszi.com/sqlserver/info_dont_shrink.asp
-oj
"Manish Sawjiani" <ManishSawjiani@.discussions.microsoft.com> wrote in
message news:24CEF98E-AF48-4707-BA94-1AF01E796BAE@.microsoft.com...
> Hello Experts
> We just started using SQL Server 7.0 in our organization which had come
> along with BackOffice with NT 4.0. We have just started putting in some
> data
> in it and have created some tables and some relationships.
> My Question is
> Should One Truncate Log?
> If Yes When Should it be done?
> Would appreciate your suggestions on this - THANKS in advance
> Regards
> Manish Sawjiani
> --
> Three Cheers to Technet for the Help!
|||Hi,
If it is not production database you could set the database option "Truncate
Log on Checkpoint". This will clear the Transaction log byy may itself.
If it is a production database or if the data is critical then you can not
enable the Truncate log on checkpoint option. Instead of that you have to
perform
Transaction log backup (See BACKUP LOG in books online). After the
Trasnaction log backup Log will be automatically cleared.
Thanks
Hari
SQL Server DBA
"Manish Sawjiani" <ManishSawjiani@.discussions.microsoft.com> wrote in
message news:24CEF98E-AF48-4707-BA94-1AF01E796BAE@.microsoft.com...
> Hello Experts
> We just started using SQL Server 7.0 in our organization which had come
> along with BackOffice with NT 4.0. We have just started putting in some
> data
> in it and have created some tables and some relationships.
> My Question is
> Should One Truncate Log?
> If Yes When Should it be done?
> Would appreciate your suggestions on this - THANKS in advance
> Regards
> Manish Sawjiani
> --
> Three Cheers to Technet for the Help!

Basic Question - Truncate Log

Hello Experts
We just started using SQL Server 7.0 in our organization which had come
along with BackOffice with NT 4.0. We have just started putting in some data
in it and have created some tables and some relationships.
My Question is
Should One Truncate Log?
If Yes When Should it be done?
Would appreciate your suggestions on this - THANKS in advance
Regards
Manish Sawjiani
--
Three Cheers to Technet for the Help!I suggest you start with Tibor's aricle:
http://www.karaszi.com/sqlserver/info_dont_shrink.asp
--
-oj
"Manish Sawjiani" <ManishSawjiani@.discussions.microsoft.com> wrote in
message news:24CEF98E-AF48-4707-BA94-1AF01E796BAE@.microsoft.com...
> Hello Experts
> We just started using SQL Server 7.0 in our organization which had come
> along with BackOffice with NT 4.0. We have just started putting in some
> data
> in it and have created some tables and some relationships.
> My Question is
> Should One Truncate Log?
> If Yes When Should it be done?
> Would appreciate your suggestions on this - THANKS in advance
> Regards
> Manish Sawjiani
> --
> Three Cheers to Technet for the Help!|||Hi,
If it is not production database you could set the database option "Truncate
Log on Checkpoint". This will clear the Transaction log byy may itself.
If it is a production database or if the data is critical then you can not
enable the Truncate log on checkpoint option. Instead of that you have to
perform
Transaction log backup (See BACKUP LOG in books online). After the
Trasnaction log backup Log will be automatically cleared.
Thanks
Hari
SQL Server DBA
"Manish Sawjiani" <ManishSawjiani@.discussions.microsoft.com> wrote in
message news:24CEF98E-AF48-4707-BA94-1AF01E796BAE@.microsoft.com...
> Hello Experts
> We just started using SQL Server 7.0 in our organization which had come
> along with BackOffice with NT 4.0. We have just started putting in some
> data
> in it and have created some tables and some relationships.
> My Question is
> Should One Truncate Log?
> If Yes When Should it be done?
> Would appreciate your suggestions on this - THANKS in advance
> Regards
> Manish Sawjiani
> --
> Three Cheers to Technet for the Help!

Basic Question - Truncate Log

Hello Experts
We just started using SQL Server 7.0 in our organization which had come
along with BackOffice with NT 4.0. We have just started putting in some data
in it and have created some tables and some relationships.
My Question is
Should One Truncate Log?
If Yes When Should it be done?
Would appreciate your suggestions on this - THANKS in advance
Regards
Manish Sawjiani
--
Three Cheers to technet for the Help!I suggest you start with Tibor's aricle:
http://www.karaszi.com/sqlserver/info_dont_shrink.asp
-oj
"Manish Sawjiani" <ManishSawjiani@.discussions.microsoft.com> wrote in
message news:24CEF98E-AF48-4707-BA94-1AF01E796BAE@.microsoft.com...
> Hello Experts
> We just started using SQL Server 7.0 in our organization which had come
> along with BackOffice with NT 4.0. We have just started putting in some
> data
> in it and have created some tables and some relationships.
> My Question is
> Should One Truncate Log?
> If Yes When Should it be done?
> Would appreciate your suggestions on this - THANKS in advance
> Regards
> Manish Sawjiani
> --
> Three Cheers to technet for the Help!|||Hi,
If it is not production database you could set the database option "Truncate
Log on Checkpoint". This will clear the Transaction log byy may itself.
If it is a production database or if the data is critical then you can not
enable the Truncate log on checkpoint option. Instead of that you have to
perform
Transaction log backup (See BACKUP LOG in books online). After the
Trasnaction log backup Log will be automatically cleared.
Thanks
Hari
SQL Server DBA
"Manish Sawjiani" <ManishSawjiani@.discussions.microsoft.com> wrote in
message news:24CEF98E-AF48-4707-BA94-1AF01E796BAE@.microsoft.com...
> Hello Experts
> We just started using SQL Server 7.0 in our organization which had come
> along with BackOffice with NT 4.0. We have just started putting in some
> data
> in it and have created some tables and some relationships.
> My Question is
> Should One Truncate Log?
> If Yes When Should it be done?
> Would appreciate your suggestions on this - THANKS in advance
> Regards
> Manish Sawjiani
> --
> Three Cheers to technet for the Help!sql

Basic Question - Push & Pull subscription

Paul/Hillary;
Scenario:
servers in the same domain:
Create the publisher/distributor
Create publication "MyPublication"
Create push subscription to Server B "PushToB"
Logon onto Server B
Create Pull Subscription "PullFromA"
Cannot create Pull Subscription...
A quick google search and I find
"When you create a pull subscription and a push subscription for the
publication already exists for the Subscriber, an error message informs you
that the push subscription already exists and that you should drop any push
subscriptions before proceeding. When you create a pull subscription, and
another pull subscription to the same publication already exists, you will be
required to drop the existing subscription before adding the new one unless
the first subscription has expired."
Logon to Publisher
Delete Push subscription "PushToB" on publisher
logon to subscriber
Create Pull subscription "PullFromA" on subscriber
logon to publisher
Create Push subscription "PushToB" on publisher
Push subscription fails....
When I create a publication for each on the publisher, it works.
What am I missing?
MJ
Hi Pual;
No, you are dealing with ignorance on my end (thank you for your patience).
Context:
I need to changes at the publisher to push to the subscriber
I then need changes at the subscriber to push to the publisher.
Test envrironment Solution:
I set up a merge publication on the publisher then loged onto the
subscriber and created a pull subscription. Every thing is fine.
this is sql server 2000.
My biggest challenge has been reading so many sources and I am getting
confused:
Microsofts "Patterns and Practices" Data Patterns
Microsoft's High Availablitity Volume 1 and Volume 2
Hillary's "Transaction ad Snapshot"
I even pleaded Hillary to publish his promised 2nd book on Merge Replication.
"Paul Ibison" wrote:

> I'm not sure I follow. You are restricted from having a pull and push on the
> subscriber to the same publication and the same subscriber database. Your
> scenario arrives at this same point each time but in a different order
> (pushtob is still created after pullfroma) - or am I misreading something
> here.
> Cheers,
> Paul Ibison
>
>
|||Question: Merge or Transactional bidirectional replication?
I am looking for a Bi-directional merge replication solution
Does the subscriber go offline? Yes
Does the subscriber modify the same data as the publisher? Yes
What happens when they conflict (assuming the subscriber isn't connected to
the publisher)? Publisher has ultimate determination.
How many subscribers do you have?
A vague answer is 12
A better answer is I use a filter and create a separate publication for each.
Do the subscribers need to be distinguished? Yes
"Paul Ibison" wrote:

> OK - I see. The term Push and Pull refer to where the work is being done
> (simplified a bit). The actual work remains the same, so you need either a
> push or a pull subscription but not both. If you want bidirectional
> replication then the choice usually is between merge and transactional. The
> latter can be queued, immediate updating or bidirectional or peer-to-peer.
> Many posibilities here. Some questions will help narrow down a bit. Does the
> subscriber go offline? Does the subscriber modify the same data as the
> publisher? What happens when they conflict (assuming the subscriber isn't
> connected tot he publisher). How many subscribers do you have? Do the
> subscribers need to be distinguished?
> If you have clear answers to these questions and hopefully I've not left too
> many out, then we can probably tell you exactly what type of replication you
> need
> HTH,
> Paul Ibison
>
>
|||Thank you for patience and dedication from a dedicated Ibison and Cotter
follower.
MJ
"Paul Ibison" wrote:

> OK - it sounds like merge is your best option then. You don't necessarily
> need a separate publication per subscriber - dynamic subscriptions might do
> the trick for you.
> HTH,
> Paul Ibison
>
>
>

Basic question - no one has the answer?

Hi,

I know the difference between char and varchar but there is conflicting advice from professionals about which one to use. In the case of a customer table (name of company, address etc) some professionals say use char because it will only occupy x amount of space and therefore querys will run faster because sql server does not need to check the length of each field. Others say use varchar because then there is no wasted space (seems obvious).

Could anyone give me a description of why one is prefered over another?

Thanks,

MarkSpeed will be required more for data path access...anything else is probably inconsequental...

Sorry, still didn't give you an answer...

But all development I've ever seen usually uses varchar...but I probably wouldn't say varchar(5) or something...

All of Oracle is varchar2...except char(1)

BOL was of no help...

I'll give it a google...|||http://p2p.wrox.com/archive/sql_server/2001-04/101.asp

Says almost the same thing...

you can test it though...load up 2 identical tables and do some metrics

If you're selecting lots of data it may be a problem...but you should use bcp in that case anyway.|||Here check this site out...

It's a research team the paired up with MS. They use SQL Server..

anyway, they are mapping the entire nights sky.. I think they claim the database to be at 888GB right now...

The even let you see their catalog on line...seems everything is varchar

have a look

http://skyserver.sdss.org/en/help/browser/browser.asp|||Ok Brett,

Thanks for the help and advice. You mentioned metrics. Do you know of any free software that can give performance metrics for sql?

Many thanks,

Mark

Originally posted by Brett Kaiser
Speed will be required more for data path access...anything else is probably inconsequental...

Sorry, still didn't give you an answer...

But all development I've ever seen usually uses varchar...but I probably wouldn't say varchar(5) or something...

All of Oracle is varchar2...except char(1)

BOL was of no help...

I'll give it a google...|||Yeah,

SQL Server itself...

Build 2 tables that are identical except for the datatype differences you want to check out

Create a while loop to populate with data for n times...yiou probably want to check it out for small medium and large row sets.

Create a set of sql scripts to access the data in different ways and manners..

set show stats and show plans in QA

Start a trace with profiler...

execute the 2 scripts in two different windows...

do them seaparately at first..then run them against each other...

Si?|||Ok Brett,

Thanks for the info,

Mark

Originally posted by Brett Kaiser
Yeah,

SQL Server itself...

Build 2 tables that are identical except for the datatype differences you want to check out

Create a while loop to populate with data for n times...yiou probably want to check it out for small medium and large row sets.

Create a set of sql scripts to access the data in different ways and manners..

set show stats and show plans in QA

Start a trace with profiler...

execute the 2 scripts in two different windows...

do them seaparately at first..then run them against each other...

Si?|||1 major think that to take into consideration is:

Does your column allow nullable values?

If yes, then it is better not to have it as char. Because char datatype counts null as a storage value.

e.g. if u declare char(1000) a null colum will store 1000 bytes of null data.

If any of u still haven't thought of it from this angle!|||Just my .02, if you will have to do any string manipulation, use varchar.

Depending on the type of queries you will be running, char gives a predictable placing on the 8kb data page which may result in less logical IO.

I usually use varchar unless I know there will be no nulls and it's a guaranteed length (like state abbreviations)

HTH|||Ok,

Many thanks for the advice

Originally posted by rhigdon
Just my .02, if you will have to do any string manipulation, use varchar.

Depending on the type of queries you will be running, char gives a predictable placing on the 8kb data page which may result in less logical IO.

I usually use varchar unless I know there will be no nulls and it's a guaranteed length (like state abbreviations)

HTH

Basic Question

We want to set up another office as an online disaster recovery site. Can I
clister between two SQL servers over a T1?
Your best bet is using third party software, though you might be able to use
MNS (Majority Node Set). Have you looked into Log Shipping with SQL?
Cheers,
Rod
MVP - Windows Server - Clustering
http://www.nw-america.com - Clustering
http://msmvps.com/clustering - Blog
"Rick Vines" <Rick Vines@.discussions.microsoft.com> wrote in message
news:640BDCB1-F523-4B21-AF91-AB24D58D2DCD@.microsoft.com...
> We want to set up another office as an online disaster recovery site. Can
> I
> clister between two SQL servers over a T1?

basic question

hi i have the following variables.
declare @.viStock int
set @.viStock = 1000
declare @.vdStartDate datetime
declare @.vdEndDate datetime
set @.vdStartDate = getdate()
set @.vdEndDate = dateadd(w, 10, getdate())
i want to insert into a temp ttable the following
amount date
100 24-10-2005
100 31-11-2005
100 31-11-2005
.. and so on for 10 ws.
where amount = stock / @.vdStartDate - @.vdEndDate
how do i do this so that the amount is equally divided?
thankshere is the schema.
--
-- drop table temp
-- create table temp
-- (
-- amt int,
-- date datetime
-- )
--
declare @.viStock int
set @.viStock = 1000
declare @.vdStartDate datetime
declare @.vdEndDate datetime
set @.vdStartDate = getdate()
set @.vdEndDate = dateadd(w, 10, getdate())
insert into temp
(amt,date)
(
select @.viStock / datediff([w], @.vdStartDate, @.vdEndDate),
dateadd([w], 1, @.vdEndDate)
--group by @.viStock/ datediff(w, @.vdStartDate, @.vdEndDate), dateadd(w,
1, @.vdEndDate))
)
select * From temp
delete from temp
i cant use a group by here says -Server: Msg 164, Level 15, State 1, Line 20
GROUP BY expressions must refer to column names that appear in the select
list.
how do i correct that?
thanks
"ichor" <ichor@.hotmail.com> wrote in message
news:eJJ2wST2FHA.2564@.TK2MSFTNGP10.phx.gbl...
> hi i have the following variables.
> declare @.viStock int
> set @.viStock = 1000
> declare @.vdStartDate datetime
> declare @.vdEndDate datetime
> set @.vdStartDate = getdate()
> set @.vdEndDate = dateadd(w, 10, getdate())
>
> i want to insert into a temp ttable the following
> amount date
> 100 24-10-2005
> 100 31-11-2005
> 100 31-11-2005
> .. and so on for 10 ws.
> where amount = stock / @.vdStartDate - @.vdEndDate
> how do i do this so that the amount is equally divided?
>
> thanks
>|||On Tue, 25 Oct 2005 17:21:15 +1000, ichor wrote:

>hi i have the following variables.
>declare @.viStock int
>set @.viStock = 1000
>declare @.vdStartDate datetime
>declare @.vdEndDate datetime
>set @.vdStartDate = getdate()
>set @.vdEndDate = dateadd(w, 10, getdate())
>
>i want to insert into a temp ttable the following
>amount date
>100 24-10-2005
>100 31-11-2005
>100 31-11-2005
>.. and so on for 10 ws.
>where amount = stock / @.vdStartDate - @.vdEndDate
>how do i do this so that the amount is equally divided?
Hi ichor,
First step is to create and fill a numbers table. This is a one-time
job, and you'll find that there are many uses for a umbers table. Check
out http://www.aspfaq.com/show.asp?id=2516 for details on how to make a
numbers table and some examples of how to use it.
Now to the actual query:
SET @.NumWs = DATEDIFF(w, @.vdStartDate, @.vdEndDate)
INSERT INTO temptable (amount, [date])
SELECT @.viStock / @.NumWs,
DATEADD(w, Number-1, @.vdStartDate)
FROM Numbers
WHERE Number BETWEEN 1 AND @.NumWs
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)

Basic question

I've instaled M Visual Web Developer studio 2005 ee and SQL 2005.
Service is working, but i can't connect my project with serwer. ASP configuration tool(security) can't connect. Error message doesn't show any reason.
Server menager can connect normally.
Please help
what is the error message?sql

Basic question

I've instaled M Visual Web Developer studio 2005 ee and SQL 2005.
Service is working, but i can't connect my project with serwer. ASP configuration tool(security) can't connect. Error message doesn't show any reason.
Server menager can connect normally.
Please help
what is the error message?

Basic Question

I have many views and views on these views. Is there anyone out there who might have a suggestion as to how I can keep them straight so that I won't lose track of what I made them for? I am starting to not remember why I made some, so I have to go back and try and remember. Any suggestion would be appreciated.Make a table of your views.|||I thought about that and think that it is the best way. Thanks.|||Thanks.|||A long time ago we had the same issue with pointers. The best way to handle this is to create an object map/diagram which shows the views and their dependencies.|||Like an Excel Sheet?
Thanks.|||Any type of modeling software like visio, rational, erwin ...|||Thats a good idea. Thanks.|||Or you can go NUTS...

Just mine the parent child relationships with code...

-- In M$ infinite wisdom...the give us more than we need for this...the second result set
-- blows up the INSERT INTO...so lets build our own

USE Northwind
GO

create procedure sp_depends2 -- 1996/08/09 16:51
@.objname nvarchar(776) /* the object we want to check */
as

declare @.objid int /* the id of the object we want */
declare @.found_some bit /* flag for dependencies found */
declare @.dbname sysname

/*
** Make sure the @.objname is local to the current database.
*/

select @.dbname = parsename(@.objname,3)

if @.dbname is not null and @.dbname <> db_name()
begin
raiserror(15250,-1,-1)
return (1)
end

/*
** See if @.objname exists.
*/
select @.objid = object_id(@.objname)
if @.objid is null
begin
select @.dbname = db_name()
raiserror(15009,-1,-1,@.objname,@.dbname)
return (1)
end

/*
** Initialize @.found_some to indicate that we haven't seen any dependencies.
*/
select @.found_some = 0

set nocount on

/*
** Print out the particulars about the local dependencies.
*/
if exists (select *
from sysdepends
where id = @.objid)
begin
raiserror(15459,-1,-1)
select 'name' = (s6.name+ '.' + o1.name),
type = substring(v2.name, 5, 16),
updated = substring(u4.name, 1, 7),
selected = substring(w5.name, 1, 8),
'column' = col_name(d3.depid, d3.depnumber)
from sysobjects o1
,master.dbo.spt_values v2
,sysdepends d3
,master.dbo.spt_values u4
,master.dbo.spt_values w5 --11667
,sysusers s6
where o1.id = d3.depid
and o1.xtype = substring(v2.name,1,2) collate database_default and v2.type = 'O9T'
and u4.type = 'B' and u4.number = d3.resultobj
and w5.type = 'B' and w5.number = d3.readobj|d3.selall
and d3.id = @.objid
and o1.uid = s6.uid
and deptype < 2

select @.found_some = 1
end

/* Let's get rid of this part
** Now check for things that depend on the object.
if exists (select *
from sysdepends
where depid = @.objid)
begin
raiserror(15460,-1,-1)
select distinct 'name' = (s.name + '.' + o.name),
type = substring(v.name, 5, 16)
from sysobjects o, master.dbo.spt_values v, sysdepends d,
sysusers s
where o.id = d.id
and o.xtype = substring(v.name,1,2) collate database_default and v.type = 'O9T'
and d.depid = @.objid
and o.uid = s.uid
and deptype < 2

select @.found_some = 1
end

*/

/*
** Did we find anything in sysdepends?
*/
if @.found_some = 0
raiserror(15461,-1,-1)

set nocount off

return (0) -- sp_depends
GO

-- Now on to our code

CREATE VIEW myView01 AS SELECT * FROM Orders
GO
CREATE VIEW myView02 AS SELECT * FROM myView01
GO
CREATE VIEW myView03 AS SELECT * FROM myView02
GO

CREATE TABLE ViewDepends (
ViewName sysname NULL
, ViewDep sysname NULL
, ViewType varchar(50) NULL
, updated varchar(5) NULL
, selected varchar(5) NULL
, columnname sysname NULL)
GO
SET NOCOUNT ON
DECLARE @.ViewName sysname
, @.SQL varchar(8000)

DECLARE myDep CURSOR
FOR
SELECT 'INSERT INTO ViewDepends(ViewDep, ViewType, updated, selected, columnname) '
+ ' EXEC sp_depends2 [' + TABLE_NAME + ']' AS SQL
, TABLE_NAME
FROM INFORMATION_SCHEMA.Tables
WHERE TABLE_TYPE = 'VIEW'

OPEN myDep

FETCH NEXT FROM myDep INTO @.SQL, @.ViewName

WHILE @.@.FETCH_STATUS = 0
BEGIN
-- SELECT @.SQL
EXEC(@.SQL)
UPDATE ViewDepends SET ViewName = @.ViewName
WHERE ViewName IS NULL
FETCH NEXT FROM myDep INTO @.SQL, @.ViewName
END

CLOSE myDep
DEALLOCATE myDep
SET NOCOUNT OFF
GO

SELECT * FROM ViewDepends ORDER BY ViewName

GO

DROP PROC sp_depends2
DROP TABLE ViewDepends
DROP VIEW myView01
DROP VIEW myView02
DROP VIEW myView03
GO|||A couple of thoughts:

1. Use consistent naming conventions that are grounded in mnemonics. Though it's nice to be able to use 255 characters to name a view or table or column, it can be a real pain to retype every time.

2. Examine your assumptions carefully every time you create a new view. Do you really need it? Is it possible to modify an existing view? Can you avoid creating the view and use something dynamic instead?

3. Someone else suggested the use of various tools to mine through the sysobjects table and determine relationships and dependencies. Note that you can determine object dependencies from QA by drilling into the object from the object browser.

4. Documentation. I don't do enough of this either.

Regards,

hmscott|||Thanks alot!

Basic question

hello,
I am not an administrator, please if I want to know the name of my sql
server, how can i find it?
I have sql server 2000 which I installed long time ago, I forgot what I
named it during the installation, i think it is the default name.
Is it local or (local) or something else?
Thank you.
Hi,
Login to Query analyzer and execute the below command
select @.@.SERVERNAME
Thanks
Hari
SQL Server MVP
"Philip Germanos" <PhilipGermanos@.discussions.microsoft.com> wrote in
message news:D659E5D9-F809-4C0E-8DE4-F6DCD98BFC66@.microsoft.com...
> hello,
> I am not an administrator, please if I want to know the name of my sql
> server, how can i find it?
> I have sql server 2000 which I installed long time ago, I forgot what I
> named it during the installation, i think it is the default name.
> Is it local or (local) or something else?
> Thank you.

Basic question

hello,
I am not an administrator, please if I want to know the name of my sql
server, how can i find it?
I have sql server 2000 which I installed long time ago, I forgot what I
named it during the installation, i think it is the default name.
Is it local or (local) or something else?
Thank you.Hi,
Login to Query analyzer and execute the below command
select @.@.SERVERNAME
Thanks
Hari
SQL Server MVP
"Philip Germanos" <PhilipGermanos@.discussions.microsoft.com> wrote in
message news:D659E5D9-F809-4C0E-8DE4-F6DCD98BFC66@.microsoft.com...
> hello,
> I am not an administrator, please if I want to know the name of my sql
> server, how can i find it?
> I have sql server 2000 which I installed long time ago, I forgot what I
> named it during the installation, i think it is the default name.
> Is it local or (local) or something else?
> Thank you.

Basic question

hello,
I am not an administrator, please if I want to know the name of my sql
server, how can i find it?
I have sql server 2000 which I installed long time ago, I forgot what I
named it during the installation, i think it is the default name.
Is it local or (local) or something else?
Thank you.Hi,
Login to Query analyzer and execute the below command
select @.@.SERVERNAME
Thanks
Hari
SQL Server MVP
"Philip Germanos" <PhilipGermanos@.discussions.microsoft.com> wrote in
message news:D659E5D9-F809-4C0E-8DE4-F6DCD98BFC66@.microsoft.com...
> hello,
> I am not an administrator, please if I want to know the name of my sql
> server, how can i find it?
> I have sql server 2000 which I installed long time ago, I forgot what I
> named it during the installation, i think it is the default name.
> Is it local or (local) or something else?
> Thank you.sql

Basic Query: Alternatives to Group By for nText column

I am having some difficulty writing a relatively basic query. The objective is to retrieve the new stories (headlines) for the past 3 days from the database. Since each headline can be assigned multiple categories (topics) the query returns a row for every headline assignment. I can't use the 'Group By' expression because one of the columns is nText.

So basically if there is an article written yesterday, "I Love Cats" that gets assigned both topics 'CATS' and 'PETS' I only it returned with the first topic assigned... 'CATS'. Here is a little image of the three tables being called:

http://64.225.154.232/temp_dbDiagram.gif

I don't think that this query is too difficult, but I'm just getting my feet wet with writing queries that are more than select * from whatever. Any insight or recommendations are greatly appreciated.

SELECT headline.HEADLINE_ID, headline.HEADLINE_TITLE, headline.HEADLINE_DATE, headline.HEADLINE_THUMBNAIL,
topic.TOPIC_NAME, topic.TOPIC_URL
FROM tbl_CCF_Headlines headline INNER JOIN
tbl_CCF_Headlines_Topics ON headline.HEADLINE_ID = tbl_CCF_Headlines_Topics.HEADLINE_ID INNER JOIN
tbl_CCF_Topics topic ON tbl_CCF_Headlines_Topics.TOPIC_ID = topic.TOPIC_ID
WHERE (headline.HEADLINE_DATE IN
(SELECT TOP 3 HEADLINE_DATE
FROM tbl_CCF_HEADLINES
GROUP BY HEADLINE_DATE
ORDER BY HEADLINE_DATE DESC))
ORDER BY headline.HEADLINE_DATE DESCTry to cast youe text column to varchar(1000).|||What if the nText-field contains more than 1000 characters? What if it contains more than 4000 characters which I believe is the limit for nVarChar? I have this very same situation and am yet to find a solution...

-Tuukka

basic query question

Hello,
I was wondering how best to write a valid query that
Assimilates the following query.
SELECT id,COUNT(*) AS cnt FROM table_name WHERE cnt > 0
GROUP BY id;
basically it's a query that returns a recordset with
unique values for one of the alias fields
any suggestions greatly appreciatedYou can't use the column alias in the where clause, but if I understand your
query correctly, you don't need it.
SQL Server will only returns rows for id's which actually occur, so their
count will always be greater than 0.
Just use hte query you have without the WHERE clause.
--
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"aylwin" <aylwinagena@.hotmail.com> wrote in message
news:00ed01c3939d$db056be0$a001280a@.phx.gbl...
> Hello,
> I was wondering how best to write a valid query that
> Assimilates the following query.
> SELECT id,COUNT(*) AS cnt FROM table_name WHERE cnt > 0
> GROUP BY id;
> basically it's a query that returns a recordset with
> unique values for one of the alias fields
> any suggestions greatly appreciated|||Hi thank you,
My actual query is different. my example is simplified.
My actual query is more like:
SELECT z.application_id as AppID, queued_by_user, queued_date,
'-1' AS NoInQueue, ProcessType, Reprint_Flag, First_Name
FROM l_DraftPrintingQueue z, l_customer a, d_customer_detail b
WHERE suspendprinting = 0
and
a.customer_id = b.customer_id
and
b.application_id = z.application_id
--Group By AppID <<problem>>
ORDER BY first_name ASC
the query returns many AppID's. I was trying to use a Group By but there
seems to be a problem with the where clause.
any ideas' thanks again!!!
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!|||See my replies in the other group you posted to. Please don't multipost.
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as ugroup=microsoft.public.sqlserver
"aylwin agena" <aylwinagena@.hotmail.com> wrote in message
news:%23PWmhh6kDHA.2964@.tk2msftngp13.phx.gbl...
> Hi thank you,
> My actual query is different. my example is simplified.
> My actual query is more like:
> SELECT z.application_id as AppID, queued_by_user, queued_date,
> '-1' AS NoInQueue, ProcessType, Reprint_Flag, First_Name
> FROM l_DraftPrintingQueue z, l_customer a, d_customer_detail b
> WHERE suspendprinting = 0
> and
> a.customer_id = b.customer_id
> and
> b.application_id = z.application_id
> --Group By AppID <<problem>>
> ORDER BY first_name ASC
> the query returns many AppID's. I was trying to use a Group By but there
> seems to be a problem with the where clause.
> any ideas' thanks again!!!
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!|||select id, count(*) as cnt from table_name
group by id having count(*) > 0|||The HAVING clause is unnecessary here as you won't ever ever count an id
value if it doesn't appear in the data, so the counts will always be
positive.
--
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"bill" <anonymous@.discussions.microsoft.com> wrote in message
news:2DBC44C3-5418-4B4C-8B4F-CD18F62A9761@.microsoft.com...
> select id, count(*) as cnt from table_name
> group by id having count(*) > 0

Basic query question

Hi,
I have a basic query question and hope that someone can clarify for me.
2 queries...
#1
\\\
SELECT *
FROM
Table1 AS A
INNER JOIN Table2 AS B ON
B.Column1 = A.Column1 AND
B.Column2 = A.Column2
///
#2
\\\
SELECT *
FROM
Table1 AS A, Table2 AS B
WHERE
B.Column1 = A.Column1 AND
B.Column2 = A.Column2
///
I suppose I will get the same result among these 2 queries, I just wonder is
there any performance different between these 2 queries? Any opinion which
one is better?
Thanks in advance.it will really give you the same result
but as a matter of standard
i suggest you use the first one.
performance wise i dont know.
its just that the first one is my preferred
choice
<hr>
MCP #2324787
"Kent" wrote:

> Hi,
> I have a basic query question and hope that someone can clarify for me.
> 2 queries...
> #1
> \\\
> SELECT *
> FROM
> Table1 AS A
> INNER JOIN Table2 AS B ON
> B.Column1 = A.Column1 AND
> B.Column2 = A.Column2
> ///
> #2
> \\\
> SELECT *
> FROM
> Table1 AS A, Table2 AS B
> WHERE
> B.Column1 = A.Column1 AND
> B.Column2 = A.Column2
> ///
> I suppose I will get the same result among these 2 queries, I just wonder
is
> there any performance different between these 2 queries? Any opinion whic
h
> one is better?
> Thanks in advance.|||AFAIK, there will be no performance difference between these two
particular queries; the optimizer should recognize them as being the
same and generate an identical execution plan for them (something which
you can easily test in Query Analyzer).
I prefer the JOIN syntax because it
a) is easier to read (to me), and
b) allows you to perform more complex joins. You can easily join three
tables with an INNER JOIN between two of those tables, and an OUTER
JOIN with the last table.
HTH,
Stu|||Kent,
This issue is a old issue and I think that our gurus here could answer you
with guarantee. From my own point of view it's the same although I prefer th
e
first one.
Regards,
"Jose G. de Jesus Jr MCP, MCDBA" wrote:
> it will really give you the same result
> but as a matter of standard
> i suggest you use the first one.
> performance wise i dont know.
> its just that the first one is my preferred
> choice
> --
>
> <hr>
> MCP #2324787
>
> "Kent" wrote:
>|||Kent
No, should not be any differences bettwen two queries. See an execution
plan to make sure.
"Kent" <Kent@.discussions.microsoft.com> wrote in message
news:EBE53BFA-BCF0-437A-847C-548B447FBDD5@.microsoft.com...
> Hi,
> I have a basic query question and hope that someone can clarify for me.
> 2 queries...
> #1
> \\\
> SELECT *
> FROM
> Table1 AS A
> INNER JOIN Table2 AS B ON
> B.Column1 = A.Column1 AND
> B.Column2 = A.Column2
> ///
> #2
> \\\
> SELECT *
> FROM
> Table1 AS A, Table2 AS B
> WHERE
> B.Column1 = A.Column1 AND
> B.Column2 = A.Column2
> ///
> I suppose I will get the same result among these 2 queries, I just wonder
> is
> there any performance different between these 2 queries? Any opinion
> which
> one is better?
> Thanks in advance.|||The optimizer will recognize these doing the same thing and optimize them th
e same way. The first is
preferred and the more modern syntax.
Outer joins is another story, though... In short, don't use the old ( *= ) s
yntax.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Kent" <Kent@.discussions.microsoft.com> wrote in message
news:EBE53BFA-BCF0-437A-847C-548B447FBDD5@.microsoft.com...
> Hi,
> I have a basic query question and hope that someone can clarify for me.
> 2 queries...
> #1
> \\\
> SELECT *
> FROM
> Table1 AS A
> INNER JOIN Table2 AS B ON
> B.Column1 = A.Column1 AND
> B.Column2 = A.Column2
> ///
> #2
> \\\
> SELECT *
> FROM
> Table1 AS A, Table2 AS B
> WHERE
> B.Column1 = A.Column1 AND
> B.Column2 = A.Column2
> ///
> I suppose I will get the same result among these 2 queries, I just wonder
is
> there any performance different between these 2 queries? Any opinion whic
h
> one is better?
> Thanks in advance.|||Ya, they are the same in Execution Plan.
I think the first one is more neat when I get to join more tables.
Thanks all for help. :)
"Tibor Karaszi" wrote:

> The optimizer will recognize these doing the same thing and optimize them
the same way. The first is
> preferred and the more modern syntax.
> Outer joins is another story, though... In short, don't use the old ( *= )
syntax.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Kent" <Kent@.discussions.microsoft.com> wrote in message
> news:EBE53BFA-BCF0-437A-847C-548B447FBDD5@.microsoft.com...
>

Basic Query

Hi,
I want to know, is it possible to have MQSQL Database Server on UNIX. is it supported in UNIX platforms.
this is just a general query.
Thanx for the help ... GiriNo, that would be Anti-Microsoft.

Basic problems with replication

Hi
I've just installed Sql Server 7 and wanted to see how replication works.
With DTS i copied Northwind database so now i have two db Northwind and
Northwind_copy on my server.
Using wizards (default values) I've tried snapshot replication from
Northwind (publication) to Northwind_copy (pull subscription, I used sa
login without password ? is it correct ? ).
It seems easy but doesn't work ;(
Snapshot agent session details:
7) The process could not bulk copy out of table
'[dbo].[syncobj_0x3044324641344544]'
6) Bulk copied snapshot data for article 'Categories' (0 rows)
5) Bulk copying snapshot data for article 'Categories'
4) Locking published tables while generating the snapshot
3) Generating Schema script for article 'Categories'
2) Connecting to Publisher 'MyServer'
1) Initializing
In Pull Substraction window:
Could not get license information correctly. The step failed
Thanks
urga
Hi,
For Snapshot replication , no need to copy the objects to Northwind_copy
database. Automatically snapshot replication will copy the selected
articles to destination database.
Licensing:-
- check the licensing in control panel and see how many license you have for
sql 7
- check this registry key as well for previlages..
hklm\system\currentcontrolset\services\licenseinfo \mssql7.0
-- Apply SP4 for SQL 7 snd check.
Thanks
Hari
MCDBA
"urga" <urga@.go2.pl> wrote in message
news:cbtu2h$r0f$1@.nemesis.news.tpi.pl...
> Hi
> I've just installed Sql Server 7 and wanted to see how replication works.
> With DTS i copied Northwind database so now i have two db Northwind and
> Northwind_copy on my server.
> Using wizards (default values) I've tried snapshot replication from
> Northwind (publication) to Northwind_copy (pull subscription, I used sa
> login without password ? is it correct ? ).
> It seems easy but doesn't work ;(
> Snapshot agent session details:
> 7) The process could not bulk copy out of table
> '[dbo].[syncobj_0x3044324641344544]'
> 6) Bulk copied snapshot data for article 'Categories' (0 rows)
> 5) Bulk copying snapshot data for article 'Categories'
> 4) Locking published tables while generating the snapshot
> 3) Generating Schema script for article 'Categories'
> 2) Connecting to Publisher 'MyServer'
> 1) Initializing
> In Pull Substraction window:
> Could not get license information correctly. The step failed
> Thanks
> urga
>
>
sql

Basic problem (calculating nulls)

Hi Everyone,

I have a basic problem, am calculating two fields, which works fine when both have values (0's included), however when there is nothing populated in the field I don't get a result.

Therefore how do I default a null to a zero so this can be calculated?

Thanks all...Hi

if isnull(myfiel) then
myvar:=0|||Thank you very much will give that a go now.

Basic problem

I downloaded SQLExpress and Visual Studio Express to my home computer.

I built a simple database, adding data through theSQLexpress admin tool.

I built a web page using MS Studio. I connected to the database and used the webpage for a few days. Then I restarted the computer. Now the web page won't open, and MS Studio won't open the MDF file in the App_Data folder.

I can still see and work in the database through SQL server Express.

The web page and the MSStudio attempt to connect to the mdf file both fail with this message:

Cannot open user default database. Login failed.
Login failed for user 'KAAAK/Administrator'.

So it seems to be trying to connect as the Windows user.

When I try to modify the connection to connect through a user/password I created in SQL manager, I get a message that the user is not a trusted SQL user.

from web.config:

<

connectionStrings>

<

addname="ConnectionString"connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\info.mdf;Integrated Security=True;User Instance=True;User ID=Admin;Password=12345"providerName="System.Data.SqlClient"/>

</

connectionStrings>

That was changed from the original string created automatically by MS Studio

<

connectionStrings>

<

addname="stocksConnectionString"connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\stocks.mdf;Integrated Security=True;User Instance=True;"providerName="System.Data.SqlClient"/>

</

connectionStrings>I am sure this is some simple problem, but why would the system refuse to access an mdf file it had already been accessing.?

Thanks, Michael

Hi!,

This may happen because the SQL server is configure for windows authentication only. Change to mixed mode.

Hope this will help.

Regards

basic PL/SQL question

Okay,

kinda new at this:

I have Id's that can have duplicates. I also have programs that can have duplicates. I am looking for a list of IDs with programs that have a rowcount > 1 for that given id.

Example

ID Program
-- ----
111 12345 <----These are the records I want
111 12345 <----
222 32145
333 99999
444 55555
444 66666

with my current query I keep getting 1 ID per 1 Program?

What PL/SQL do I need?

Thanks in advance!

JNot PL/SQL, just SQL:

select id, program, count(*)
from x
group by id, program
having count(*) > 1;

Basic Parameter

This is a beginning type of question - I am trying to set up a parameter that
will contain 5 numeric digits. As the user starts typing i.e. a 3 I would
like to see 30000 appear, then if they type a 1 then 31000 will appear, next
if they type a 2 then I would see 31200 then a 5 they would see 31250 and
lastly if they typed a 1 then 31251 would appear in the list and when they
hit enter that would be the number of the work order that appears.
Thank you.On Nov 8, 3:49 pm, NormaD <Nor...@.discussions.microsoft.com> wrote:
> This is a beginning type of question - I am trying to set up a parameter that
> will contain 5 numeric digits. As the user starts typing i.e. a 3 I would
> like to see 30000 appear, then if they type a 1 then 31000 will appear, next
> if they type a 2 then I would see 31200 then a 5 they would see 31250 and
> lastly if they typed a 1 then 31251 would appear in the list and when they
> hit enter that would be the number of the work order that appears.
> Thank you.
Unfortunately, this type of functionality does not exist in SSRS/
Reporting Services (aside from standard auto-complete in your browser,
which isn't quite the same thing). The best way to create this
functionality is to create a custom ASP.NET application that does this
via callback/postback. Sorry that I could not be of greater
assistance.
Regards,
Enrique Martinez
Sr. Software Consultant

Basic package is causing an error

I'm getting the following error message on a basic copy from a datareader (using an ODBC datasource) to a sqlnativeclient. There are no transformations or anything. Don't know what is going on. Any insights are appreciated.

[SQL Server Destination [361]] Error: An OLE DB error has occurred. Error code: 0x80040E14. An OLE DB record is available. Source: "Microsoft SQL Native Client" Hresult: 0x80040E14 Description: "Could not bulk load because SSIS file mapping object 'Global\DTSQLIMPORT ' could not be opened. Operating system error code 2(The system cannot find the file specified.). Make sure you are accessing a local server via Windows security.".

SQL Server Destination only works if the server you are inserting to is the same server that you are running SSIS on. Otherise you get the message that you are seeing.

-Jamie

|||

Jamie Thomson wrote:

SQL Server Destination only works if the server you are inserting to is the same server that you are running SSIS on. Otherise you get the message that you are seeing.

-Jamie

jamie is correct. you can use the ole db destination instead.

btw, in her ssis webcast, joy mundy said that the ole db destination outperforms the sql server destination (in most cases).

|||

Duane Douglas wrote:

Jamie Thomson wrote:

SQL Server Destination only works if the server you are inserting to is the same server that you are running SSIS on. Otherise you get the message that you are seeing.

-Jamie

jamie is correct. you can use the ole db destination instead.

btw, in her ssis webcast, joy mundy said that the ole db destination outperforms the sql server destination (in most cases).

Really? Then Joy Mundy is wrong. Please could you send me a link to the webcast, I need to check this out?

Regards

Jamie

|||Thank you Jamie and Duane. Makes sense, but I didn't realize you had to use OLE DB for non-local connections. I'll go that route.|||

OLE DB Destination is the "default" destination for any relational database table. The SQL Server Destination is an optional extra that can be used in very specific circumstances.

Personally I think the name "SQL Server Destination" confuses people. They see it and automatically think it should be used when inserting into SQL Server and that is not the case. In Microsoft's defence it does say this very very clearly in the documentation.

-Jamie

|||I'm sure it is documented, but as often happens in life I have to fly by the seat of my pants learning as I go for a quick solution to a problem. No time to actually learn the product till later. Again, the help is greatly appreciated.|||

Jamie Thomson wrote:

Duane Douglas wrote:

Jamie Thomson wrote:

SQL Server Destination only works if the server you are inserting to is the same server that you are running SSIS on. Otherise you get the message that you are seeing.

-Jamie

jamie is correct. you can use the ole db destination instead.

btw, in her ssis webcast, joy mundy said that the ole db destination outperforms the sql server destination (in most cases).

Really? Then Joy Mundy is wrong. Please could you send me a link to the webcast, I need to check this out?

Regards

Jamie

jamie,

here's the link to joy's webcast: http://msevents.microsoft.com/cui/WebCastEventDetails.aspx?EventID=1032297072&EventCategory=5&culture=en-US&CountryCode=US

|||

Jamie Thomson wrote:

Personally I think the name "SQL Server Destination" confuses people. They see it and automatically think it should be used when inserting into SQL Server and that is not the case. In Microsoft's defence it does say this very very clearly in the documentation.

-Jamie

i agree. "local sql server destination" might be a more appropriate title.sql