Friday, March 30, 2012

How Do I Automate A Recovery Process With Lots of Transaction Logs

I have to automate a process that will restore the latest BAK file and all the TRN files that occured afterwards on a remote server. I can't use the log shipping process. The BAK file is created nightly, and TRN files are created every 15 mins. I'm using a maintenance plan, so the file names change
Can anyone think of a good way to recover all those files, without all the clicking and typing
Jeff ZuerleinJeff
Create JOB under Management -SQL Server Agent folders with RESTORE DATABASE
..... command.
"Jeff Zuerlein" <anonymous@.discussions.microsoft.com> wrote in message
news:367639E5-7A83-4D3D-8FA4-2507A221F958@.microsoft.com...
> I have to automate a process that will restore the latest BAK file and all
the TRN files that occured afterwards on a remote server. I can't use the
log shipping process. The BAK file is created nightly, and TRN files are
created every 15 mins. I'm using a maintenance plan, so the file names
change.
> Can anyone think of a good way to recover all those files, without all the
clicking and typing?
> Jeff Zuerlein|||Jeff,
I'm interested in why you can't use log shipping. If it is because you're
not using Enterprise Edition, then there are scripts in the Resource Kit to
do it manually for Standard Edition and below, or online there are a few
people who provide them for free:
http://www.sql-server-performance.com/sql_server_log_shipping.asp
HTH,
Paul Ibison|||It's purely political
I'm using a maintenance plan, so the names of the transaction logs change
I think I could code my way out, but I hate to spend the time if there is a better solution
Jeff|||To load logs from a folder you can get the file names into a temp table in
date order (earliest first) using something like this pseudo code
declare @.files int
create table #files(filename varchar(255))
insert #files exec master..xp_cmdshell 'dir /B /A-D /O-D c:\logs\*.trn'
delete #files where filename is null or filename like '%File Not Found%'
select @.files = count(*) from #files
If @.files >0
begin
-- loop through files in a cursor issuing a restore log command
end
--
HTH
Jasper Smith (SQL Server MVP)
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Jeff Zuerlein" <anonymous@.discussions.microsoft.com> wrote in message
news:FCFA3898-9DAB-46EA-8BD8-0AF5982572EF@.microsoft.com...
> It's purely political.
> I'm using a maintenance plan, so the names of the transaction logs change.
> I think I could code my way out, but I hate to spend the time if there is
a better solution.
> Jeffsql

How Do I Automate A Recovery Process With Lots of Transaction Logs

I have to automate a process that will restore the latest BAK file and all t
he TRN files that occured afterwards on a remote server. I can't use the lo
g shipping process. The BAK file is created nightly, and TRN files are crea
ted every 15 mins. I'm usi
ng a maintenance plan, so the file names change.
Can anyone think of a good way to recover all those files, without all the c
licking and typing?
Jeff ZuerleinJeff
Create JOB under Management -SQL Server Agent folders with RESTORE DATABASE
..... command.
"Jeff Zuerlein" <anonymous@.discussions.microsoft.com> wrote in message
news:367639E5-7A83-4D3D-8FA4-2507A221F958@.microsoft.com...
> I have to automate a process that will restore the latest BAK file and all
the TRN files that occured afterwards on a remote server. I can't use the
log shipping process. The BAK file is created nightly, and TRN files are
created every 15 mins. I'm using a maintenance plan, so the file names
change.
> Can anyone think of a good way to recover all those files, without all the
clicking and typing?
> Jeff Zuerlein|||Jeff,
I'm interested in why you can't use log shipping. If it is because you're
not using Enterprise Edition, then there are scripts in the Resource Kit to
do it manually for Standard Edition and below, or online there are a few
people who provide them for free:
http://www.sql-server-performance.c...og_shipping.asp
HTH,
Paul Ibison|||It's purely political.
I'm using a maintenance plan, so the names of the transaction logs change.
I think I could code my way out, but I hate to spend the time if there is a
better solution.
Jeff|||To load logs from a folder you can get the file names into a temp table in
date order (earliest first) using something like this pseudo code
declare @.files int
create table #files(filename varchar(255))
insert #files exec master..xp_cmdshell 'dir /B /A-D /O-D c:\logs\*.trn'
delete #files where filename is null or filename like '%File Not Found%'
select @.files = count(*) from #files
If @.files >0
begin
-- loop through files in a cursor issuing a restore log command
end
HTH
Jasper Smith (SQL Server MVP)
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Jeff Zuerlein" <anonymous@.discussions.microsoft.com> wrote in message
news:FCFA3898-9DAB-46EA-8BD8-0AF5982572EF@.microsoft.com...
> It's purely political.
> I'm using a maintenance plan, so the names of the transaction logs change.
> I think I could code my way out, but I hate to spend the time if there is
a better solution.
> Jeff

How do I attach query results to send mail

I have several tasks that I don't want to use conditional failure on. I have a ON ERROR send mail task right now that works. I want to have that send mail task include query results from a separate query. How do I do that?

Peter Cwik

How about dropping the result of the query into a file usig the Flat File Destination and then attaching that file within Send Mail Task?

Just an idea...

-Jamie

|||SSIS is new to me...how do I do that?|||

What I just descibed is slightly advanced because it required the use of expressions. I don't want to try and cover those before you know the basics.

If I were you I would build the bit that populates a flat file first. You'll need a new data-flow. Drop an OLE DB Source Adapter into your data flow. Paste your query into the OLE DB Source Adapter.

Then, drop a Flat File Destination Adapter onto the data-flow. Drag a data path between your source adapter and your destination adapter. Open up the destination adapter editor and accept all the defaults - including building your flat file connection manager.

If none of that makes any sense then i recommend you work your way through the SSIS tutorial provided off the SQL Server install CD.

-Jamie

|||

That part makes sense.

Thanks!

How do I attach database when I just have express edition

I'm trying to attach a database to sql server using the sp_attach_db
stored procedure. However, I don't see management studio on my
computer. I do have Visual Basic 2005, which is supposed to install
the express version of SQL Server. How do I run the command to attach
the database given that I don't have a paid-for version of sql server?
Thanks,
MarvinTry using the utility SQLCMD.EXE
How to: Connect to the Database Engine Using sqlcmd.exe
http://msdn2.microsoft.com/en-us/library/ms188247.aspx
AMB
"COHENMARVIN@.lycos.com" wrote:
> I'm trying to attach a database to sql server using the sp_attach_db
> stored procedure. However, I don't see management studio on my
> computer. I do have Visual Basic 2005, which is supposed to install
> the express version of SQL Server. How do I run the command to attach
> the database given that I don't have a paid-for version of sql server?
> Thanks,
> Marvin
>|||Hi
For SQL Server 2005 Express Edition you can download a management studio
and you will not pay for that , pease search on interent
<COHENMARVIN@.lycos.com> wrote in message
news:2e4245c5-ad3a-444d-882d-61eacf58aa4d@.i29g2000prf.googlegroups.com...
> I'm trying to attach a database to sql server using the sp_attach_db
> stored procedure. However, I don't see management studio on my
> computer. I do have Visual Basic 2005, which is supposed to install
> the express version of SQL Server. How do I run the command to attach
> the database given that I don't have a paid-for version of sql server?
> Thanks,
> Marvin|||> For SQL Server 2005 Express Edition you can download a Management Studio
> and you will not pay for that, please search on internet
Microsoft SQL Server Management Studio Express
http://www.microsoft.com/downloads/details.aspx?familyid=C243A5AE-4BD1-4E3D-94B8-5A0F62BF7796
Brief Description
Microsoft SQL Server Management Studio Express (SSMSE) is a free,
easy-to-use
graphical management tool for managing SQL Server 2005 Express Edition and
SQL Server 2005 Express Edition with Advanced Services.
Tom
http://kbupdate.info/

How do I attach database when I just have express edition

I'm trying to attach a database to sql server using the sp_attach_db
stored procedure. However, I don't see management studio on my
computer. I do have Visual Basic 2005, which is supposed to install
the express version of SQL Server. How do I run the command to attach
the database given that I don't have a paid-for version of sql server?
Thanks,
Marvin
Try using the utility SQLCMD.EXE
How to: Connect to the Database Engine Using sqlcmd.exe
http://msdn2.microsoft.com/en-us/library/ms188247.aspx
AMB
"COHENMARVIN@.lycos.com" wrote:

> I'm trying to attach a database to sql server using the sp_attach_db
> stored procedure. However, I don't see management studio on my
> computer. I do have Visual Basic 2005, which is supposed to install
> the express version of SQL Server. How do I run the command to attach
> the database given that I don't have a paid-for version of sql server?
> Thanks,
> Marvin
>
|||Hi
For SQL Server 2005 Express Edition you can download a management studio
and you will not pay for that , pease search on interent
<COHENMARVIN@.lycos.com> wrote in message
news:2e4245c5-ad3a-444d-882d-61eacf58aa4d@.i29g2000prf.googlegroups.com...
> I'm trying to attach a database to sql server using the sp_attach_db
> stored procedure. However, I don't see management studio on my
> computer. I do have Visual Basic 2005, which is supposed to install
> the express version of SQL Server. How do I run the command to attach
> the database given that I don't have a paid-for version of sql server?
> Thanks,
> Marvin

How do I associate a sql server login with the SQLAgentUserRole?

Currently a 2005 login has been granted sysadmin because I can not figure out how to grant the same login the SqlAgentUserRole. I thought I would use SSMS but there must be a trick. The role only exists in the msdb database, which the login has not been granted explicit access to. And the login does not appear in the list of Role Members or its sub windows. This should be real easy and intuitive . . .

Thanks!

Michael

You cannot associate a login with a database role. What you can do is map the login to a database user (CREATE USER/sp_adduser) and then make that user a role member (sp_addrolemember).

For understanding the distinction that exists between logins and users, have a look at: http://blogs.msdn.com/lcris/archive/2007/03/23/basic-sql-server-security-concepts-logins-users-and-principals.aspx.

Thanks

Laurentiu

|||

I was rather loose with my definitions. But thinking about it caused me to create a User in msdb for the login in question and was then able to associate the User in msdb as a Member of the fixed database role SQLAgentUserRole. I still don't know yet if this will allow me to demote the login from sysadmin and still allow the User to set-up and run his own SqlServerAgent jobs. But that is another day!

Thanks

sql

How do I assign nos for column

I have existing data in a table and would like to
assign auto number to a column.
How can I do?
Thank you for your help in advance!
-Kim
To add an identity column to your existing table you can issue the following
command:
alter table yourtable add newcol int identity
----
-
Need SQL Server Examples check out my website
http://www.geocities.com/sqlserverexamples
"Kim" <anonymous@.discussions.microsoft.com> wrote in message
news:00af01c49045$a6f16e80$a401280a@.phx.gbl...
> I have existing data in a table and would like to
> assign auto number to a column.
> How can I do?
> Thank you for your help in advance!
> -Kim
|||Greg,
I don't want to add a column, I already have a column,
I want to assign sequence numbers to this column.
Sequence numbers will depend on another field, if
the field value = 'A' it will have one sequence,
if the field value = 'B' then it will have another
sequence, so on...
here is the example -
Col1 Col2 Col3 ...
T123 Test rec1 A
F001 Test Rec2 B
S0001 Test Rec3 A
P001 Test Rec4 A
it should have the following values ...
Col1 Col2 Col3 ...
A00001 Test rec1 A
B00001 Test Rec2 B
A00002 Test Rec3 A
A00003 Test Rec4 A
Hope this helps!
Thank you,
-Kim

>--Original Message--
>To add an identity column to your existing table you can
issue the following
>command:
>alter table yourtable add newcol int identity
>--
>----
--
>----
--
>-
>Need SQL Server Examples check out my website
>http://www.geocities.com/sqlserverexamples
>
>"Kim" <anonymous@.discussions.microsoft.com> wrote in
message
>news:00af01c49045$a6f16e80$a401280a@.phx.gbl...
>
>.
>
|||Kim wrote:
> Greg,
> I don't want to add a column, I already have a column,
> I want to assign sequence numbers to this column.
> Sequence numbers will depend on another field, if
> the field value = 'A' it will have one sequence,
> if the field value = 'B' then it will have another
> sequence, so on...
> here is the example -
> Col1 Col2 Col3 ...
> T123 Test rec1 A
> F001 Test Rec2 B
> S0001 Test Rec3 A
> P001 Test Rec4 A
> it should have the following values ...
>
> Col1 Col2 Col3 ...
> A00001 Test rec1 A
> B00001 Test Rec2 B
> A00002 Test Rec3 A
> A00003 Test Rec4 A
> Hope this helps!
> Thank you,
> -Kim
If you know the number of possible col3 values beforehand, you can write
a T-SQL script to move through the table, grab each row, one at a time,
check the col3 value, increment the corresponding counter value in the
script, and update the row using the counter value.
Pseudo-Code Here:
Start all counters at 0
Loop through a cursor on the table (do this off-hours)
Get col3 value
If col3 = 'A' then
CounterA = CounterA + 1
NewCol1 = col3 + Right('0000' + CAST(CounterA as varchar(5)), 5)
If col3 = 'B' Then
CounterB = CounterB + 1
etc.
Update Table
Set Col1 = NewCol1
Where PKVal = WhateverThePKValueIs
David G.
|||David,
I will implement your suggestion - thanks.
In the meantime wanted to find out from you how
can I create sequences for each of the series for future
use? Like for 'A' ... 'A000001' onwards,
for 'B' ... 'B000001' onwards.
'cause after I update my database with these numbers
I would like it to autogenerate while creating records
for each of the series.
Thank you for your help!
-Kim

>--Original Message--
>Kim wrote:
>
>If you know the number of possible col3 values
beforehand, you can write
>a T-SQL script to move through the table, grab each row,
one at a time,
>check the col3 value, increment the corresponding
counter value in the
>script, and update the row using the counter value.
>Pseudo-Code Here:
>Start all counters at 0
>Loop through a cursor on the table (do this off-hours)
> Get col3 value
> If col3 = 'A' then
> CounterA = CounterA + 1
> NewCol1 = col3 + Right('0000' + CAST(CounterA as
varchar(5)), 5)
> If col3 = 'B' Then
> CounterB = CounterB + 1
> etc.
> Update Table
> Set Col1 = NewCol1
> Where PKVal = WhateverThePKValueIs
>--
>David G.
>.
>
|||Kim wrote:[vbcol=seagreen]
> David,
> I will implement your suggestion - thanks.
> In the meantime wanted to find out from you how
> can I create sequences for each of the series for future
> use? Like for 'A' ... 'A000001' onwards,
> for 'B' ... 'B000001' onwards.
> 'cause after I update my database with these numbers
> I would like it to autogenerate while creating records
> for each of the series.
> Thank you for your help!
> -Kim
You can create a trigger on the table or a before trigger if the value
is not part of the PK. You'll have to keep track of the underlying key
values using another table.
I'm not a big fan of these types of intelligent keys because maintance
and implementation are much more difficult than using an indentity
columns. Have you considered using an identity column with the col3 as
the compound PK. That way, you have to do nothing to get the values in
there. You can then create a computed column on the table to return
values to your application in the correct format.
David G.

How do I assign nos for column

I have existing data in a table and would like to
assign auto number to a column.
How can I do?
Thank you for your help in advance!
-KimTo add an identity column to your existing table you can issue the following
command:
alter table yourtable add newcol int identity
--
----
----
-
Need SQL Server Examples check out my website
http://www.geocities.com/sqlserverexamples
"Kim" <anonymous@.discussions.microsoft.com> wrote in message
news:00af01c49045$a6f16e80$a401280a@.phx.gbl...
> I have existing data in a table and would like to
> assign auto number to a column.
> How can I do?
> Thank you for your help in advance!
> -Kim|||Greg,
I don't want to add a column, I already have a column,
I want to assign sequence numbers to this column.
Sequence numbers will depend on another field, if
the field value = 'A' it will have one sequence,
if the field value = 'B' then it will have another
sequence, so on...
here is the example -
Col1 Col2 Col3 ...
T123 Test rec1 A
F001 Test Rec2 B
S0001 Test Rec3 A
P001 Test Rec4 A
it should have the following values ...
Col1 Col2 Col3 ...
A00001 Test rec1 A
B00001 Test Rec2 B
A00002 Test Rec3 A
A00003 Test Rec4 A
Hope this helps!
Thank you,
-Kim
>--Original Message--
>To add an identity column to your existing table you can
issue the following
>command:
>alter table yourtable add newcol int identity
>--
>----
--
>----
--
>-
>Need SQL Server Examples check out my website
>http://www.geocities.com/sqlserverexamples
>
>"Kim" <anonymous@.discussions.microsoft.com> wrote in
message
>news:00af01c49045$a6f16e80$a401280a@.phx.gbl...
>> I have existing data in a table and would like to
>> assign auto number to a column.
>> How can I do?
>> Thank you for your help in advance!
>> -Kim
>
>.
>|||Kim wrote:
> Greg,
> I don't want to add a column, I already have a column,
> I want to assign sequence numbers to this column.
> Sequence numbers will depend on another field, if
> the field value = 'A' it will have one sequence,
> if the field value = 'B' then it will have another
> sequence, so on...
> here is the example -
> Col1 Col2 Col3 ...
> T123 Test rec1 A
> F001 Test Rec2 B
> S0001 Test Rec3 A
> P001 Test Rec4 A
> it should have the following values ...
>
> Col1 Col2 Col3 ...
> A00001 Test rec1 A
> B00001 Test Rec2 B
> A00002 Test Rec3 A
> A00003 Test Rec4 A
> Hope this helps!
> Thank you,
> -Kim
If you know the number of possible col3 values beforehand, you can write
a T-SQL script to move through the table, grab each row, one at a time,
check the col3 value, increment the corresponding counter value in the
script, and update the row using the counter value.
Pseudo-Code Here:
Start all counters at 0
Loop through a cursor on the table (do this off-hours)
Get col3 value
If col3 = 'A' then
CounterA = CounterA + 1
NewCol1 = col3 + Right('0000' + CAST(CounterA as varchar(5)), 5)
If col3 = 'B' Then
CounterB = CounterB + 1
etc.
Update Table
Set Col1 = NewCol1
Where PKVal = WhateverThePKValueIs
--
David G.|||David,
I will implement your suggestion - thanks.
In the meantime wanted to find out from you how
can I create sequences for each of the series for future
use? Like for 'A' ... 'A000001' onwards,
for 'B' ... 'B000001' onwards.
'cause after I update my database with these numbers
I would like it to autogenerate while creating records
for each of the series.
Thank you for your help!
-Kim
>--Original Message--
>Kim wrote:
>> Greg,
>> I don't want to add a column, I already have a column,
>> I want to assign sequence numbers to this column.
>> Sequence numbers will depend on another field, if
>> the field value = 'A' it will have one sequence,
>> if the field value = 'B' then it will have another
>> sequence, so on...
>> here is the example -
>> Col1 Col2 Col3 ...
>> T123 Test rec1 A
>> F001 Test Rec2 B
>> S0001 Test Rec3 A
>> P001 Test Rec4 A
>> it should have the following values ...
>>
>> Col1 Col2 Col3 ...
>> A00001 Test rec1 A
>> B00001 Test Rec2 B
>> A00002 Test Rec3 A
>> A00003 Test Rec4 A
>> Hope this helps!
>> Thank you,
>> -Kim
>
>If you know the number of possible col3 values
beforehand, you can write
>a T-SQL script to move through the table, grab each row,
one at a time,
>check the col3 value, increment the corresponding
counter value in the
>script, and update the row using the counter value.
>Pseudo-Code Here:
>Start all counters at 0
>Loop through a cursor on the table (do this off-hours)
> Get col3 value
> If col3 = 'A' then
> CounterA = CounterA + 1
> NewCol1 = col3 + Right('0000' + CAST(CounterA as
varchar(5)), 5)
> If col3 = 'B' Then
> CounterB = CounterB + 1
> etc.
> Update Table
> Set Col1 = NewCol1
> Where PKVal = WhateverThePKValueIs
>--
>David G.
>.
>|||Kim wrote:
> David,
> I will implement your suggestion - thanks.
> In the meantime wanted to find out from you how
> can I create sequences for each of the series for future
> use? Like for 'A' ... 'A000001' onwards,
> for 'B' ... 'B000001' onwards.
> 'cause after I update my database with these numbers
> I would like it to autogenerate while creating records
> for each of the series.
> Thank you for your help!
> -Kim
>> --Original Message--
>> Kim wrote:
>> Greg,
>> I don't want to add a column, I already have a column,
>> I want to assign sequence numbers to this column.
>> Sequence numbers will depend on another field, if
>> the field value = 'A' it will have one sequence,
>> if the field value = 'B' then it will have another
>> sequence, so on...
>> here is the example -
>> Col1 Col2 Col3 ...
>> T123 Test rec1 A
>> F001 Test Rec2 B
>> S0001 Test Rec3 A
>> P001 Test Rec4 A
>> it should have the following values ...
>>
>> Col1 Col2 Col3 ...
>> A00001 Test rec1 A
>> B00001 Test Rec2 B
>> A00002 Test Rec3 A
>> A00003 Test Rec4 A
>> Hope this helps!
>> Thank you,
>> -Kim
>>
>> If you know the number of possible col3 values beforehand, you can
>> write a T-SQL script to move through the table, grab each row, one
>> at a time, check the col3 value, increment the corresponding counter
>> value in the script, and update the row using the counter value.
>> Pseudo-Code Here:
>> Start all counters at 0
>> Loop through a cursor on the table (do this off-hours)
>> Get col3 value
>> If col3 = 'A' then
>> CounterA = CounterA + 1
>> NewCol1 = col3 + Right('0000' + CAST(CounterA as varchar(5)), 5)
>> If col3 = 'B' Then
>> CounterB = CounterB + 1
>> etc.
>> Update Table
>> Set Col1 = NewCol1
>> Where PKVal = WhateverThePKValueIs
>> --
>> David G.
>> .
You can create a trigger on the table or a before trigger if the value
is not part of the PK. You'll have to keep track of the underlying key
values using another table.
I'm not a big fan of these types of intelligent keys because maintance
and implementation are much more difficult than using an indentity
columns. Have you considered using an identity column with the col3 as
the compound PK. That way, you have to do nothing to get the values in
there. You can then create a computed column on the table to return
values to your application in the correct format.
David G.

How do I assign nos for column

I have existing data in a table and would like to
assign auto number to a column.
How can I do?
Thank you for your help in advance!
-KimTo add an identity column to your existing table you can issue the following
command:
alter table yourtable add newcol int identity
----
----
-
Need SQL Server Examples check out my website
http://www.geocities.com/sqlserverexamples
"Kim" <anonymous@.discussions.microsoft.com> wrote in message
news:00af01c49045$a6f16e80$a401280a@.phx.gbl...
> I have existing data in a table and would like to
> assign auto number to a column.
> How can I do?
> Thank you for your help in advance!
> -Kim|||Greg,
I don't want to add a column, I already have a column,
I want to assign sequence numbers to this column.
Sequence numbers will depend on another field, if
the field value = 'A' it will have one sequence,
if the field value = 'B' then it will have another
sequence, so on...
here is the example -
Col1 Col2 Col3 ...
T123 Test rec1 A
F001 Test Rec2 B
S0001 Test Rec3 A
P001 Test Rec4 A
it should have the following values ...
Col1 Col2 Col3 ...
A00001 Test rec1 A
B00001 Test Rec2 B
A00002 Test Rec3 A
A00003 Test Rec4 A
Hope this helps!
Thank you,
-Kim

>--Original Message--
>To add an identity column to your existing table you can
issue the following
>command:
>alter table yourtable add newcol int identity
>--
>----
--
>----
--
>-
>Need SQL Server Examples check out my website
>http://www.geocities.com/sqlserverexamples
>
>"Kim" <anonymous@.discussions.microsoft.com> wrote in
message
>news:00af01c49045$a6f16e80$a401280a@.phx.gbl...
>
>.
>|||Kim wrote:
> Greg,
> I don't want to add a column, I already have a column,
> I want to assign sequence numbers to this column.
> Sequence numbers will depend on another field, if
> the field value = 'A' it will have one sequence,
> if the field value = 'B' then it will have another
> sequence, so on...
> here is the example -
> Col1 Col2 Col3 ...
> T123 Test rec1 A
> F001 Test Rec2 B
> S0001 Test Rec3 A
> P001 Test Rec4 A
> it should have the following values ...
>
> Col1 Col2 Col3 ...
> A00001 Test rec1 A
> B00001 Test Rec2 B
> A00002 Test Rec3 A
> A00003 Test Rec4 A
> Hope this helps!
> Thank you,
> -Kim
If you know the number of possible col3 values beforehand, you can write
a T-SQL script to move through the table, grab each row, one at a time,
check the col3 value, increment the corresponding counter value in the
script, and update the row using the counter value.
Pseudo-Code Here:
Start all counters at 0
Loop through a cursor on the table (do this off-hours)
Get col3 value
If col3 = 'A' then
CounterA = CounterA + 1
NewCol1 = col3 + Right('0000' + CAST(CounterA as varchar(5)), 5)
If col3 = 'B' Then
CounterB = CounterB + 1
etc.
Update Table
Set Col1 = NewCol1
Where PKVal = WhateverThePKValueIs
David G.|||David,
I will implement your suggestion - thanks.
In the meantime wanted to find out from you how
can I create sequences for each of the series for future
use? Like for 'A' ... 'A000001' onwards,
for 'B' ... 'B000001' onwards.
'cause after I update my database with these numbers
I would like it to autogenerate while creating records
for each of the series.
Thank you for your help!
-Kim

>--Original Message--
>Kim wrote:
>
>If you know the number of possible col3 values
beforehand, you can write
>a T-SQL script to move through the table, grab each row,
one at a time,
>check the col3 value, increment the corresponding
counter value in the
>script, and update the row using the counter value.
>Pseudo-Code Here:
>Start all counters at 0
>Loop through a cursor on the table (do this off-hours)
> Get col3 value
> If col3 = 'A' then
> CounterA = CounterA + 1
> NewCol1 = col3 + Right('0000' + CAST(CounterA as
varchar(5)), 5)
> If col3 = 'B' Then
> CounterB = CounterB + 1
> etc.
> Update Table
> Set Col1 = NewCol1
> Where PKVal = WhateverThePKValueIs
>--
>David G.
>.
>|||Kim wrote:[vbcol=seagreen]
> David,
> I will implement your suggestion - thanks.
> In the meantime wanted to find out from you how
> can I create sequences for each of the series for future
> use? Like for 'A' ... 'A000001' onwards,
> for 'B' ... 'B000001' onwards.
> 'cause after I update my database with these numbers
> I would like it to autogenerate while creating records
> for each of the series.
> Thank you for your help!
> -Kim
>
You can create a trigger on the table or a before trigger if the value
is not part of the PK. You'll have to keep track of the underlying key
values using another table.
I'm not a big fan of these types of intelligent keys because maintance
and implementation are much more difficult than using an indentity
columns. Have you considered using an identity column with the col3 as
the compound PK. That way, you have to do nothing to get the values in
there. You can then create a computed column on the table to return
values to your application in the correct format.
David G.

how do I assign a string to a parameter Im passing to a select statement?

Hello,

I'm needing to pass a variable length number of values to a select statement so I can populate a result list with items related to all the checkboxlist items that were selected by the user. for example, the user checks products x, y and z, then hits submit, and then they see a list of all the tests they need to run for each product.

I found a UDF that parses a comma delimited string and puts the values into a table. I learned how to do this here:

http://codebetter.com/blogs/darrell.norton/archive/2003/07/01/361.aspx


I have a checkboxlist that I'm generating the string from, so the string could look like this: "1,3,4,5,7" etc.

I added the function mentioned in the URL above to my database, and if I understand right, I should be able to pass the table it creates into the select statement like so:

WHERE (OrderStatus IN ((select value from dbo.fn_Split(@.StatusList,','))) OR @.StatusList IS NULL)

but now I don't know how to assign the string value to the parameter, say to '@.solution_id'.

my current select statement which was generated by Visual Studio 2005 looks like this:

SELECT [test], [owner], [date] FROM [test_table] WHERE ([solution_ID] = @.solution_ID)


...but this only pulls results for the first item checked in the checkboxlist.

Does anyone know how this is done? I'm sure it's simple, but I'm new to ASP .NET so any help would be greatly appreciated.

hi

First make sure you have createddbo.fn_Split .

SELECT [test], [owner], [date]FROM [test_table]WHERE ([solution_ID]IN ((select valuefrom dbo.fn_Split(@.solution_ID,',')))OR @.solution_IDISNULL)

I am not sure "OR @.solution_IDISNULL" should be added,you have to decide it according to your logic.

You are required to pass @.solution_ID to the statement(1,3,4,6 etc) then you can get corresponding test.

Hope this helps.

|||

Thanks for your response. If I'm following you, I do understand that I need to pass @.solution_ID to the select statement like you showed. I have a string of values that I created from iterating through CheckBoxList to find selected boxes. My question is, how do I assign the value of this string to @.solution_ID?

Regards,

Daniel

|||

Assume you have checkboxlist Check1, using following code to get @.solution_ID :

for (int i = 0; i < Check1.Items.Count; i++)
{
if (Check1.Items[i].Selected)
{
// List the selected items
solution_ID = solution_ID + Check1.Items[i].Text;
solution_ID = solution_ID +",";
}
}

Then connect with DB:


SqlCommand sqlcmd = new SqlCommand("SELECT [test], [owner], [date]FROM [test_table]WHERE
([solution_ID]IN ((select valuefrom dbo.fn_Split(@.solution_ID,',')))OR @.solution_IDISNULL)",
sqlconn);
sqlcmd.Parameters.AddWithValue("@.solution_ID",solution_ID);
sqlconn.Open();
SqlDataReader sdr = sqlcmd.ExecuteReader();

.............

You 'd bette put bold sql script into a stored procedure.

hope this helps.

How do I apply a LDF log file to a restored database?

I only have the ldf file and the bak file.

My bak file was current to 3/2/2007

My ldf file was current to 3/25/2007

I do not have the mdf file.

How to I apply the transaction from the ldf file to my resotred database?

Hello David,

According to my knowledge it not is possible to apply a .ldf file but if you are using some external tool like Logexplorer then you can atleast view the transactions in that .ldf file.

|||If this is the case it would seem to negate the purpose of having a log file?|||

The purposes of the log file are:

To facilitate rollback/rollforward when a database is brought online after an unusual shutdown|||

you said you have a .bak file and a log file. My gut feeling is that , this bak file is a full backup of your database. In that case you can restore the database from this back file as on the bak file is created.

YOu have mentioned that you have a ldf file. is it physical file or is it a bakup file. confirm this

run the following command to know what all are the contents inside the bak file

RESTORE FILELISTONLY FROM DISK = 'D:\your bak filename.bak'

if it is a full backup use restore command to restore it. Read about Restore command in BOL

Madhu

|||

No David ,

It would not negate the use of a log file. if you had a .mdf file then you could attach the log file with the .mdf file. .trn files are the log back up file not the .ldf files.

How do I apply a LDF log file to a restored database?

I only have the ldf file and the bak file.

My bak file was current to 3/2/2007

My ldf file was current to 3/25/2007

I do not have the mdf file.

How to I apply the transaction from the ldf file to my resotred database?

Hello David,

According to my knowledge it not is possible to apply a .ldf file but if you are using some external tool like Logexplorer then you can atleast view the transactions in that .ldf file.

|||If this is the case it would seem to negate the purpose of having a log file?|||

The purposes of the log file are:

To facilitate rollback/rollforward when a database is brought online after an unusual shutdown|||

you said you have a .bak file and a log file. My gut feeling is that , this bak file is a full backup of your database. In that case you can restore the database from this back file as on the bak file is created.

YOu have mentioned that you have a ldf file. is it physical file or is it a bakup file. confirm this

run the following command to know what all are the contents inside the bak file

RESTORE FILELISTONLY FROM DISK = 'D:\your bak filename.bak'

if it is a full backup use restore command to restore it. Read about Restore command in BOL

Madhu

|||

No David ,

It would not negate the use of a log file. if you had a .mdf file then you could attach the log file with the .mdf file. .trn files are the log back up file not the .ldf files.

How do I append string to end of sql query results?

I need to append text to the end of my sql query results.

For instance, my query returns a list of user names in
firstname.lastname. I need to add @.yahoo.com to each record. So the
end result should be firstname.lastname@.yahoo.com. What should by
select statement look like?

Any help?"diesel" <dieselpb03@.yahoo.com> skrev i en meddelelse
news:854ece22.0407131219.6f38c10a@.posting.google.c om...
> I need to append text to the end of my sql query results.
> For instance, my query returns a list of user names in
> firstname.lastname. I need to add @.yahoo.com to each record. So the
> end result should be firstname.lastname@.yahoo.com. What should by
> select statement look like?
> Any help?

SELECT Firstname + '.' + Lastname + '@.yahoo.com' AS Name
FROM tblPerson

easypeasy

--
Med venlig hilsen

Tom F Jensen
FFSoft
www.ffsoft.dk|||Maybe:

SELECT name + '@.yahoo.com'
FROM YourTable

--
David Portas
SQL Server MVP
--

How do I append a row to SQL results?

I have a problem with a dropdowncontrol. It is databound, but I need to add "select..." to be the first item in the dropdown. Here is the SQL:

SELECT * FROM [PB_Subtopics] Where BriefID=" + DropDownList1.SelectedValue

So the problem I am having is I can't just make an item in the dropdownlist called "select..." and then use appenddatabounditems="true". I'm using ajax and it keeps appending stuff over an over without resetting. So I think I'm going to have to do this within the sql.

So maybe that was more information than you needed to know. Anyone know how to make the first row of my SQL results be "select..." or whatnot with a value of 0.

You need to do this kind of thing at the front end.

|||

You can do this with a UNION. Something like this:

"SELECT 0, 'Select...'
UNION
SELECT * FROM [PB_Subtopics] Where BriefID=" + DropDownList1.SelectedValue

The number of fields in the first SELECT has to match the second, so adjust that as needed. And I've put in line breaks here to make it clearer what is happening, but it is all one string in what I assume is VB.NET. Adjust as needed for your code.

Also, you might need to use UNION ALL instead of just UNION, depending on your data.

Put the 'Select...' in the field location where the data used to display the item in the dropdown list.

Make sense?

Don

|||

bbaxter:

I have a problem with a dropdowncontrol. It is databound, but I need to add "select..." to be the first item in the dropdown. Here is the SQL:

SELECT * FROM [PB_Subtopics] Where BriefID=" + DropDownList1.SelectedValue

So the problem I am having is I can't just make an item in the dropdownlist called "select..." and then use appenddatabounditems="true". I'm using ajax and it keeps appending stuff over an over without resetting. So I think I'm going to have to do this within the sql.

So maybe that was more information than you needed to know. Anyone know how to make the first row of my SQL results be "select..." or whatnot with a value of 0.

Try this:

1-- Get The Result Set2SELECT Col1, Col2, Col33From MyTable45UNION-- to append67SELECT'MyRowValueForCol1','MyRowValueForCol2','MyRowValueForCol3'-- columns value of the row you want to append to the result set8FROM MyRowTable-- if you are geeting this row from table OR you can ignor this line if the values are hard coded9

Good luck.

|||

You can have the resultset modified using one of the above techniques, that should work.

You can also turn on append databound items and turn off viewstate (Viewstate will prevent the multiple additions as well as cut down the size of your page and the response you get back).

Or you can just add this type of code:

Sub ddlMyDropdown_databound(sender as object,e as object) handles ddlMydropdown.databound

ctype(sender,dropdown).items.insert(0,new listitem("Select...",""))

end sub

sql

how do I alter the column with index on it

hi,
I have a sqlserver 2000 db. I want to alter two columns
from one of the tables to not allow nulls.
but these 2 columns (one if char, and the other is
smalldatetime), one have clustered index on it, and the
other one is part of a combined index of two columns.
is the only way for the column alteration is to drop the
index first, and then re-create it later?
many thanks!
JJ
Hi,
Altering the data type of one column which has participated in an index is
not supported. If the modified column participates in an index, the only
type changes that are allowed are increasing the length of a
variable-length type (for example, VARCHAR(10) to VARCHAR(20)), changing
nullability of the column, or both. I believe you have to drop the original
index and rebuild a new index.
Thanks
Hari
MCDBA
"JJ Wang" <anonymous@.discussions.microsoft.com> wrote in message
news:2131001c45a37$30e96600$a501280a@.phx.gbl...
> hi,
> I have a sqlserver 2000 db. I want to alter two columns
> from one of the tables to not allow nulls.
> but these 2 columns (one if char, and the other is
> smalldatetime), one have clustered index on it, and the
> other one is part of a combined index of two columns.
> is the only way for the column alteration is to drop the
> index first, and then re-create it later?
> many thanks!
> JJ
|||You can user table designer shipped with SQL server client tools or
Visuastudio to change the table.
Lishil, VSDATA Team
--
>Content-Class: urn:content-classes:message
>From: "JJ Wang" <anonymous@.discussions.microsoft.com>
>Sender: "JJ Wang" <anonymous@.discussions.microsoft.com>
>Subject: how do I alter the column with index on it
>Date: Thu, 24 Jun 2004 15:04:16 -0700
>Lines: 15
>Message-ID: <2131001c45a37$30e96600$a501280a@.phx.gbl>
>MIME-Version: 1.0
>Content-Type: text/plain;
>charset="iso-8859-1"
>Content-Transfer-Encoding: 7bit
>X-Newsreader: Microsoft CDO for Windows 2000
>X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
>Thread-Index: AcRaNzDpwp7EieNJRQCcEtOkif2wyg==
>Newsgroups:
microsoft.public.sqlserver.programming,microsoft.p ublic.sqlserver.tools
>Path: cpmsftngxa10.phx.gbl
>Xref: cpmsftngxa10.phx.gbl microsoft.public.sqlserver.tools:24659
microsoft.public.sqlserver.programming:453163
>NNTP-Posting-Host: tk2msftngxa13.phx.gbl 10.40.1.165
>X-Tomcat-NG: microsoft.public.sqlserver.tools
>hi,
>I have a sqlserver 2000 db. I want to alter two columns
>from one of the tables to not allow nulls.
>but these 2 columns (one if char, and the other is
>smalldatetime), one have clustered index on it, and the
>other one is part of a combined index of two columns.
>is the only way for the column alteration is to drop the
>index first, and then re-create it later?
>many thanks!
>JJ
>
|||thanks Lishil. I know the tool to alter it, I just want
to know whether I have to drop the index first before I
alter the column. please see my privious email for detail.
thanks.
JJ
>--Original Message--
>You can user table designer shipped with SQL server
client tools or
>Visuastudio to change the table.
>Lishil, VSDATA Team
>
>--
>microsoft.public.sqlserver.programming,microsoft. public.sq
lserver.tools[vbcol=seagreen]
microsoft.public.sqlserver.tools:24659
>microsoft.public.sqlserver.programming:453163
>.
>
|||thanks Hari. I fear so too. oh well...
thanks.
JJ
>--Original Message--
>Hi,
>Altering the data type of one column which has
participated in an index is
>not supported. If the modified column participates in an
index, the only
>type changes that are allowed are increasing the length
of a
>variable-length type (for example, VARCHAR(10) to VARCHAR
(20)), changing
>nullability of the column, or both. I believe you have to
drop the original
>index and rebuild a new index.
>
>--
>Thanks
>Hari
>MCDBA
>"JJ Wang" <anonymous@.discussions.microsoft.com> wrote in
message
>news:2131001c45a37$30e96600$a501280a@.phx.gbl...
>
>.
>
|||Ok, you already get answer from hari_prasad_k@.hotmail.com.
You do need to drop index in you case.
Lishi Liu, VSData team
--
>Content-Class: urn:content-classes:message
>From: "JJ Wang" <anonymous@.discussions.microsoft.com>
>Sender: "JJ Wang" <anonymous@.discussions.microsoft.com>
>References: <2131001c45a37$30e96600$a501280a@.phx.gbl>
<$AXF2GuXEHA.2352@.cpmsftngxa06.phx.gbl>
>Subject: RE: how do I alter the column with index on it
>Date: Thu, 8 Jul 2004 18:24:14 -0700
>Lines: 61
>Message-ID: <2962a01c46553$72445bb0$a501280a@.phx.gbl>
>MIME-Version: 1.0
>Content-Type: text/plain;
>charset="iso-8859-1"
>Content-Transfer-Encoding: 7bit
>X-Newsreader: Microsoft CDO for Windows 2000
>X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
>Thread-Index: AcRlU3JEKPTFyjEUT129z6+ojcBcmg==
>Newsgroups:
microsoft.public.sqlserver.tools,microsoft.public. sqlserver.programming
>Path: cpmsftngxa06.phx.gbl
>Xref: cpmsftngxa06.phx.gbl microsoft.public.sqlserver.programming:456466
microsoft.public.sqlserver.tools:24467
>NNTP-Posting-Host: tk2msftngxa13.phx.gbl 10.40.1.165
>X-Tomcat-NG: microsoft.public.sqlserver.tools
>thanks Lishil. I know the tool to alter it, I just want
>to know whether I have to drop the index first before I
>alter the column. please see my privious email for detail.
>thanks.
>JJ
>client tools or
>lserver.tools
>microsoft.public.sqlserver.tools:24659
>

How do I allow users to see reports

Hi,
I know I am being thick here, and should probably just read the manual, but
how do enable users to log on and view reports. I have gone in to the
Properties of the report folder where the report I want a user to see is
located. I then set the security options to add a user, assigning them the
browser role. The report then inherits that role of the folder. However,
when the user logs in to the site their homepage is completely blank. They
don't get all the buttons and the top and definitely no reports. What do I
still need to do? Please help.
TIA,
JarrydHi,
Nevermind this post. Sussed it out. I was being stupid.
TIA,
Jarryd
"Jarryd" <jarryd@.community.nospam> wrote in message
news:%23MRFbAMvHHA.3660@.TK2MSFTNGP06.phx.gbl...
> Hi,
> I know I am being thick here, and should probably just read the manual,
> but how do enable users to log on and view reports. I have gone in to the
> Properties of the report folder where the report I want a user to see is
> located. I then set the security options to add a user, assigning them
> the browser role. The report then inherits that role of the folder.
> However, when the user logs in to the site their homepage is completely
> blank. They don't get all the buttons and the top and definitely no
> reports. What do I still need to do? Please help.
> TIA,
> Jarryd
>

How do I allow users to schedule jobs in Management Studio

Does anyone know how I can grant a non sysdba user who has bulkadmin and dbcreator rights to schedule jobs on databases they've created?

The user is a developer and we dont want to give him sysdba rights.

http://www.sql-server-performance.com//faq/?f=137

How do I Allow SQL DB dump job through a firewall?

We recently moved a SQL box into a DMZ but we still want to allow a Database
dump job to be allowed. What protocol and port needs to be opened for the
following job to run:
BACKUP DATABASE [Database1] TO DISK = N'\\server1\DBBACKUP\Database1' WITH
INIT , NOUNLOAD , NAME = N'Database1', NOSKIP , STATS = 10, NOFORMAT
Network file shares are accessed via the SMB (Server Message Block)
protocol. I have no clue what ports are used.
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Paul Cyr" <PaulCyr@.discussions.microsoft.com> wrote in message
news:AEF08916-1733-458F-AE03-C9C6BC771624@.microsoft.com...
> We recently moved a SQL box into a DMZ but we still want to allow a
Database
> dump job to be allowed. What protocol and port needs to be opened for the
> following job to run:
> BACKUP DATABASE [Database1] TO DISK = N'\\server1\DBBACKUP\Database1'
WITH
> INIT , NOUNLOAD , NAME = N'Database1', NOSKIP , STATS = 10, NOFORMAT
|||Hi
I would not let SQL Server "push" though the firewall. Dump the DB locally
to the SQL Server's drive and then have a task from behind the firewall come
and pick the file up.
If you push, and your box gets compromised, the hacker has access through to
your internal network as those ports are open to a supposedly "trusted"
server.
Regards
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Geoff N. Hiten" <SRDBA@.Careerbuilder.com> wrote in message
news:Odz5U609EHA.2552@.TK2MSFTNGP09.phx.gbl...[vbcol=seagreen]
> Network file shares are accessed via the SMB (Server Message Block)
> protocol. I have no clue what ports are used.
> --
> Geoff N. Hiten
> Microsoft SQL Server MVP
> Senior Database Administrator
> Careerbuilder.com
> I support the Professional Association for SQL Server
> www.sqlpass.org
> "Paul Cyr" <PaulCyr@.discussions.microsoft.com> wrote in message
> news:AEF08916-1733-458F-AE03-C9C6BC771624@.microsoft.com...
> Database
the[vbcol=seagreen]
> WITH
NOFORMAT
>
|||That is a great idea. Why didn't I think of that?
I'll try to setup a process that grabs the database on a regular basis after
it has dumped locally but I need to generate e-mail alerts if the dump fails
for any reason so I need to open it up to a certain extent anyway. Actually,
opening to SMTP traffic only seems much better then what I was trying to
accomplish previously.
Thanks again for the suggestion!
"Mike Epprecht (SQL MVP)" wrote:

> Hi
> I would not let SQL Server "push" though the firewall. Dump the DB locally
> to the SQL Server's drive and then have a task from behind the firewall come
> and pick the file up.
> If you push, and your box gets compromised, the hacker has access through to
> your internal network as those ports are open to a supposedly "trusted"
> server.
> Regards
> --
> Mike Epprecht, Microsoft SQL Server MVP
> Zurich, Switzerland
> IM: mike@.epprecht.net
> MVP Program: http://www.microsoft.com/mvp
> Blog: http://www.msmvps.com/epprecht/
> "Geoff N. Hiten" <SRDBA@.Careerbuilder.com> wrote in message
> news:Odz5U609EHA.2552@.TK2MSFTNGP09.phx.gbl...
> the
> NOFORMAT
>
>

How do I Allow SQL DB dump job through a firewall?

We recently moved a SQL box into a DMZ but we still want to allow a Database
dump job to be allowed. What protocol and port needs to be opened for the
following job to run:
BACKUP DATABASE [Database1] TO DISK = N'\\server1\DBBACKUP\Database1' W
ITH
INIT , NOUNLOAD , NAME = N'Database1', NOSKIP , STATS = 10, NOFORMATNetwork file shares are accessed via the SMB (Server Message Block)
protocol. I have no clue what ports are used.
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Paul Cyr" <PaulCyr@.discussions.microsoft.com> wrote in message
news:AEF08916-1733-458F-AE03-C9C6BC771624@.microsoft.com...
> We recently moved a SQL box into a DMZ but we still want to allow a
Database
> dump job to be allowed. What protocol and port needs to be opened for the
> following job to run:
> BACKUP DATABASE [Database1] TO DISK = N'\\server1\DBBACKUP\Database1'
WITH
> INIT , NOUNLOAD , NAME = N'Database1', NOSKIP , STATS = 10, NOFORMAT|||Hi
I would not let SQL Server "push" though the firewall. Dump the DB locally
to the SQL Server's drive and then have a task from behind the firewall come
and pick the file up.
If you push, and your box gets compromised, the hacker has access through to
your internal network as those ports are open to a supposedly "trusted"
server.
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Geoff N. Hiten" <SRDBA@.Careerbuilder.com> wrote in message
news:Odz5U609EHA.2552@.TK2MSFTNGP09.phx.gbl...
> Network file shares are accessed via the SMB (Server Message Block)
> protocol. I have no clue what ports are used.
> --
> Geoff N. Hiten
> Microsoft SQL Server MVP
> Senior Database Administrator
> Careerbuilder.com
> I support the Professional Association for SQL Server
> www.sqlpass.org
> "Paul Cyr" <PaulCyr@.discussions.microsoft.com> wrote in message
> news:AEF08916-1733-458F-AE03-C9C6BC771624@.microsoft.com...
> Database
the[vbcol=seagreen]
> WITH
NOFORMAT[vbcol=seagreen]
>|||That is a great idea. Why didn't I think of that?
I'll try to setup a process that grabs the database on a regular basis after
it has dumped locally but I need to generate e-mail alerts if the dump fails
for any reason so I need to open it up to a certain extent anyway. Actually,
opening to SMTP traffic only seems much better then what I was trying to
accomplish previously.
Thanks again for the suggestion!
"Mike Epprecht (SQL MVP)" wrote:

> Hi
> I would not let SQL Server "push" though the firewall. Dump the DB locally
> to the SQL Server's drive and then have a task from behind the firewall co
me
> and pick the file up.
> If you push, and your box gets compromised, the hacker has access through
to
> your internal network as those ports are open to a supposedly "trusted"
> server.
> Regards
> --
> Mike Epprecht, Microsoft SQL Server MVP
> Zurich, Switzerland
> IM: mike@.epprecht.net
> MVP Program: http://www.microsoft.com/mvp
> Blog: http://www.msmvps.com/epprecht/
> "Geoff N. Hiten" <SRDBA@.Careerbuilder.com> wrote in message
> news:Odz5U609EHA.2552@.TK2MSFTNGP09.phx.gbl...
> the
> NOFORMAT
>
>sql

How do I Allow SQL DB dump job through a firewall?

We recently moved a SQL box into a DMZ but we still want to allow a Database
dump job to be allowed. What protocol and port needs to be opened for the
following job to run:
BACKUP DATABASE [Database1] TO DISK = N'\\server1\DBBACKUP\Database1' WITH
INIT , NOUNLOAD , NAME = N'Database1', NOSKIP , STATS = 10, NOFORMATNetwork file shares are accessed via the SMB (Server Message Block)
protocol. I have no clue what ports are used.
--
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Paul Cyr" <PaulCyr@.discussions.microsoft.com> wrote in message
news:AEF08916-1733-458F-AE03-C9C6BC771624@.microsoft.com...
> We recently moved a SQL box into a DMZ but we still want to allow a
Database
> dump job to be allowed. What protocol and port needs to be opened for the
> following job to run:
> BACKUP DATABASE [Database1] TO DISK = N'\\server1\DBBACKUP\Database1'
WITH
> INIT , NOUNLOAD , NAME = N'Database1', NOSKIP , STATS = 10, NOFORMAT|||Hi
I would not let SQL Server "push" though the firewall. Dump the DB locally
to the SQL Server's drive and then have a task from behind the firewall come
and pick the file up.
If you push, and your box gets compromised, the hacker has access through to
your internal network as those ports are open to a supposedly "trusted"
server.
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Geoff N. Hiten" <SRDBA@.Careerbuilder.com> wrote in message
news:Odz5U609EHA.2552@.TK2MSFTNGP09.phx.gbl...
> Network file shares are accessed via the SMB (Server Message Block)
> protocol. I have no clue what ports are used.
> --
> Geoff N. Hiten
> Microsoft SQL Server MVP
> Senior Database Administrator
> Careerbuilder.com
> I support the Professional Association for SQL Server
> www.sqlpass.org
> "Paul Cyr" <PaulCyr@.discussions.microsoft.com> wrote in message
> news:AEF08916-1733-458F-AE03-C9C6BC771624@.microsoft.com...
> > We recently moved a SQL box into a DMZ but we still want to allow a
> Database
> > dump job to be allowed. What protocol and port needs to be opened for
the
> > following job to run:
> > BACKUP DATABASE [Database1] TO DISK = N'\\server1\DBBACKUP\Database1'
> WITH
> > INIT , NOUNLOAD , NAME = N'Database1', NOSKIP , STATS = 10,
NOFORMAT
>|||That is a great idea. Why didn't I think of that?
I'll try to setup a process that grabs the database on a regular basis after
it has dumped locally but I need to generate e-mail alerts if the dump fails
for any reason so I need to open it up to a certain extent anyway. Actually,
opening to SMTP traffic only seems much better then what I was trying to
accomplish previously.
Thanks again for the suggestion!
"Mike Epprecht (SQL MVP)" wrote:
> Hi
> I would not let SQL Server "push" though the firewall. Dump the DB locally
> to the SQL Server's drive and then have a task from behind the firewall come
> and pick the file up.
> If you push, and your box gets compromised, the hacker has access through to
> your internal network as those ports are open to a supposedly "trusted"
> server.
> Regards
> --
> Mike Epprecht, Microsoft SQL Server MVP
> Zurich, Switzerland
> IM: mike@.epprecht.net
> MVP Program: http://www.microsoft.com/mvp
> Blog: http://www.msmvps.com/epprecht/
> "Geoff N. Hiten" <SRDBA@.Careerbuilder.com> wrote in message
> news:Odz5U609EHA.2552@.TK2MSFTNGP09.phx.gbl...
> > Network file shares are accessed via the SMB (Server Message Block)
> > protocol. I have no clue what ports are used.
> >
> > --
> > Geoff N. Hiten
> > Microsoft SQL Server MVP
> > Senior Database Administrator
> > Careerbuilder.com
> >
> > I support the Professional Association for SQL Server
> > www.sqlpass.org
> >
> > "Paul Cyr" <PaulCyr@.discussions.microsoft.com> wrote in message
> > news:AEF08916-1733-458F-AE03-C9C6BC771624@.microsoft.com...
> > > We recently moved a SQL box into a DMZ but we still want to allow a
> > Database
> > > dump job to be allowed. What protocol and port needs to be opened for
> the
> > > following job to run:
> > > BACKUP DATABASE [Database1] TO DISK = N'\\server1\DBBACKUP\Database1'
> > WITH
> > > INIT , NOUNLOAD , NAME = N'Database1', NOSKIP , STATS = 10,
> NOFORMAT
> >
> >
>
>

How do I allow Internet client to RS

A picture paints 1000 words (Well here's 6 words and a diagram of our
configuration -- I hope its a enough.)
--RS--Firewall--Website--SQL--Firewall--
(internal) (DMZ)
(Internet)
How do I give Internet clients access to view their reports:
Recofiguration is a possibility. One scenario discuess is to have the RS in
the DMZ; however since the RS Admin is internal there's a concern that Visual
Studio can't deploy across firewalls.
Can anyone explain if the current configuration is feasable or the revised
configuration is possible.
Savvy95We have a production environment that has our SQL server behind a firewall
and the web server in the DMZ zone. Is it possible to install SQL Reporting
services on the SQL Server (that is behind the firewall) and access the
reports created in SQL Reporting from the Web Server and make it available
for browsing?
Any suggestions are welcomed!
Thanks!
"savvy95" wrote:
> A picture paints 1000 words (Well here's 6 words and a diagram of our
> configuration -- I hope its a enough.)
> --RS--Firewall--Website--SQL--Firewall--
> (internal) (DMZ)
> (Internet)
> How do I give Internet clients access to view their reports:
> Recofiguration is a possibility. One scenario discuess is to have the RS in
> the DMZ; however since the RS Admin is internal there's a concern that Visual
> Studio can't deploy across firewalls.
> Can anyone explain if the current configuration is feasable or the revised
> configuration is possible.
> Savvy95

How do I allow an end user make modifications to a rdl that I created using Report Designe

Hi,
I have several reports ( .rdl) that I created using report designer, how can
I let the end user make modifications to the text in some of these reports.
As I am unable to use Report Builder to modify reports ( .rdl ) created with
Report designer, what are my options. is there a way I can embed the report
designer within my c# winform application. I have tried converting/creating
a report builder version but with no success..
Thanks in advance..On Mar 2, 3:09 pm, "Rob Dob" <robdob20012...@.yahoo.com> wrote:
> Hi,
> I have several reports ( .rdl) that I created using report designer, how can
> I let the end user make modifications to the text in some of these reports.
> As I am unable to use Report Builder to modify reports ( .rdl ) created with
> Report designer, what are my options. is there a way I can embed the report
> designer within my c# winform application. I have tried converting/creating
> a report builder version but with no success..
> Thanks in advance..
Hi there...if you are running SSRS 2005 I would make the report using
the report builder if at all possible then give the user rights to
change it. There probably are other ways of doing this but I think
this might be the easiest...|||On Mar 2, 5:21 pm, "sullins602" <ben.sull...@.gmail.com> wrote:
> On Mar 2, 3:09 pm, "Rob Dob" <robdob20012...@.yahoo.com> wrote:
> > Hi,
> > I have several reports ( .rdl) that I created using report designer, how can
> > I let the end user make modifications to the text in some of these reports.
> > As I am unable to use Report Builder to modify reports ( .rdl ) created with
> > Report designer, what are my options. is there a way I can embed the report
> > designer within my c# winform application. I have tried converting/creating
> > a report builder version but with no success..
> > Thanks in advance..
> Hi there...if you are running SSRS 2005 I would make the report using
> the report builder if at all possible then give the user rights to
> change it. There probably are other ways of doing this but I think
> this might be the easiest...
Also, depending on the text that needs to be changed, you could allow
certain text report parameters to be filled in by the user and use the
parameter results to set the text in the report.
Regards,
Enrique Martinez
Sr. SQL Server Developer

How do I administer SqlServer 2005

Hi;
I just installed SqlServer 2005 developer edition and I can't find any way
to administer it. There is a "Sql Server Configuration Manager" in the menu
but nothing like the Enterprise Manager in SqlServer 2000.
What am I missing?
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com
Cubicle Wars - http://www.windwardreports.com/film.htm
You are missing SQL Server Management Studio.
You may need to put in the disk again, and select INSTALL Client Tools.
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
"David Thielen" <thielen@.nospam.nospam> wrote in message
news:CA288C02-B0C8-4F6E-A075-BB6AE535BCCF@.microsoft.com...
> Hi;
> I just installed SqlServer 2005 developer edition and I can't find any way
> to administer it. There is a "Sql Server Configuration Manager" in the
> menu
> but nothing like the Enterprise Manager in SqlServer 2000.
> What am I missing?
> --
> thanks - dave
> david_at_windward_dot_net
> http://www.windwardreports.com
> Cubicle Wars - http://www.windwardreports.com/film.htm
>
|||that was it.
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com
Cubicle Wars - http://www.windwardreports.com/film.htm
"Arnie Rowland" wrote:

> You are missing SQL Server Management Studio.
> You may need to put in the disk again, and select INSTALL Client Tools.
> --
> Arnie Rowland, Ph.D.
> Westwood Consulting, Inc
> Most good judgment comes from experience.
> Most experience comes from bad judgment.
> - Anonymous
>
> "David Thielen" <thielen@.nospam.nospam> wrote in message
> news:CA288C02-B0C8-4F6E-A075-BB6AE535BCCF@.microsoft.com...
>
>
|||Thanks Dave -and I enjoyed 'Cubicle Wars'. Nice.
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
"David Thielen" <thielen@.nospam.nospam> wrote in message
news:BD10F348-D97E-4B53-9D16-9EE9DEE054EE@.microsoft.com...[vbcol=seagreen]
> that was it.
> --
> thanks - dave
> david_at_windward_dot_net
> http://www.windwardreports.com
> Cubicle Wars - http://www.windwardreports.com/film.htm
>
>
> "Arnie Rowland" wrote:
|||Hi David
You may install the client tools, then you'll get SQL Server Management
Studio.
If you need a web-based solution, then you can try myLittleAdmin for SQL
Server 2005
http://www.mylittleadmin.com
Best regards
David Thielen wrote:
> Hi;
> I just installed SqlServer 2005 developer edition and I can't find
> any way to administer it. There is a "Sql Server Configuration
> Manager" in the menu but nothing like the Enterprise Manager in
> SqlServer 2000.
> What am I missing?
I'm protected by SpamBrave
http://www.spambrave.com/

How do I adjust the tab settings in SQL Server Enterprise Manager.

I found how to adjust the tab settings when editing a stored procedure using
Query Analyzer, but I don't see any way to adjust the tab settings when
editing a stored procedure using SQL Server Enterprise Manager.
Does anyone know how to do this?
Thanks,
VernThere isn't. That dialog is only really appropriate for viewing the code or
copying it. You should use Query Analyzer to edit and will find the task is
much easier and cleaner.
Andrew J. Kelly SQL MVP
"Vern" <Vern@.discussions.microsoft.com> wrote in message
news:DF5D3DF0-B5EE-49C9-9816-F124D350F4F8@.microsoft.com...
>I found how to adjust the tab settings when editing a stored procedure
>using
> Query Analyzer, but I don't see any way to adjust the tab settings when
> editing a stored procedure using SQL Server Enterprise Manager.
> Does anyone know how to do this?
> Thanks,
> Vernsql

How do I add Virtual table to Report Model (dsv)?

Hi,

problem: I got "Sale" table that include Employee ID & Manager ID.

I want to connect" Employee" table twice to "Sale"

once: Sale.EmployeeID=Employee.EmployeeID

second: Sale.ManagerID=Employee.EmployeeID

how do I create a virtual table for the second connection? can't I solve it in the model layer or need to add view in the database layer?

Thanks,

Assaf

You need to open DSV in Model Designer and add new relationship with Sale.ManagerID=Employee.EmployeeID (you should already have one relship for Sale.EmployeeID=Employee.EmployeeID).

Then open the model and regen the two involved entities or create two new roles manually.

How do I add todays date?

I am new to Reporting Services and I need to kno how to add todays date to my
reports.
ThanksI found it in , Expressions, Globals, Execution Time
"Vincel2k2" wrote:
> I am new to Reporting Services and I need to kno how to add todays date to my
> reports.
> Thanks|||Just add a TextBox field and set its value to :
=System.DateTime.Now.ToString()
If you only want the date, you shoud use :
=System.DateTime.Now.ToShortDateString()

How Do I Add Time with integer value in MSSQL ?

Hi, Expert

How Do I Add Time with integer value in MSSQL ??

For Example: 07:00:50 + 20 = 07:01:10

Note: 20 is in second

Thanks in advance

Check out the DATEADD function in BOL (documentation).|||

Hi,

You can play with DATEADD function for your question, for example:

SELECT dateadd(s, 20, getdate())

this one will add 20 seconds to now.

You can look up this function from Books Online to find more information. By the way, in SQL Server there is datatime data type, but not time or date only data type.

How do i add symbols like a bullet to a report(urgent)

Hi,

Is there a way i can add a symbol like a bullet a (wingding font) to my report in addition to other text in a text box.

any help will be appreciated.

Regards,

Karen

Sorry Karen, but formatting is applied to the whole textbox. You can't format text differently within the same textbox.

I think your best option is to add another column to the left and add the bullet there.

Jarret

|||

Jarret,

Thanks for your answer, but isnt there a ASCII character that i use with it like something like chr().

Regards,

Karen

|||

Nevermind i did it by,

using alt+0149 and it shows up in the expression.

regards

KAren

How do i add Pubs database to Sql server 2005

Hi there,
I just want to play with Pubs data base that is available in
Management Studio and apply all the enhancements of T-SQL in SQL '05.
How would i install the PUBs and Northwind databases to the Management
Studio databases?
Thanks
-DDownload and install from MS:
http://www.microsoft.com/downloads/...&DisplayLang=en
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Learner" <pradev@.gmail.com> wrote in message
news:1139932399.753049.165860@.g47g2000cwa.googlegroups.com...
> Hi there,
> I just want to play with Pubs data base that is available in
> Management Studio and apply all the enhancements of T-SQL in SQL '05.
> How would i install the PUBs and Northwind databases to the Management
> Studio databases?
> Thanks
> -D
>|||Hi Tibor,
Yes i got the SQL2000SampleDb.msi already on to my desktop. But i
couldn't find an option to select so that i could install in Sql server
2005 rather than in Sql server 2000.
I also tried backing up the pubs data base from Sql server 2000 and
restroing it in Sql server 2005. It has thrown some error.
Do i need to set up some thing in order to forcebly install in Sql
server 2005 during the installation process of Sql2000SampleDb.msi?
Thanks
-L|||> I also tried backing up the pubs data base from Sql server 2000 and
> restroing it in Sql server 2005. It has thrown some error.
Above work, I've done that several times. But you need to provide us with mo
re information. What
errors? Did you use the MOVE option for the RESTORE command?

> Yes i got the SQL2000SampleDb.msi already on to my desktop. But i
> couldn't find an option to select so that i could install in Sql server
> 2005 rather than in Sql server 2000.
Same procedure. Just follow the readme, and adapt the steps for 2005 (like u
sing SSMS instead of
EM),
Whatever method you chose, remember that the databases will be in 80 compati
bility mode. Change
using sp_dbcmptlevel.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Learner" <pradev@.gmail.com> wrote in message
news:1139933503.450724.203960@.f14g2000cwb.googlegroups.com...
> Hi Tibor,
> Yes i got the SQL2000SampleDb.msi already on to my desktop. But i
> couldn't find an option to select so that i could install in Sql server
> 2005 rather than in Sql server 2000.
> I also tried backing up the pubs data base from Sql server 2000 and
> restroing it in Sql server 2005. It has thrown some error.
> Do i need to set up some thing in order to forcebly install in Sql
> server 2005 during the installation process of Sql2000SampleDb.msi?
> Thanks
> -L
>|||Tibor,
The mssage i got in the final step of restoration process when i
clicked on OK after the adding the pub.bak from
-Microsoft Sql Server
+80
+90
-MS Sql
- BACKUP
-pubs.bak
from Locate Backup file wizard.
The error i got was
TITLE: Microsoft SQL Server Management Studio
--
Restore failed for Server 'DEVI\SQLDM2005'. (Microsoft.SqlServer.Smo)
For help, click:
http://go.microsoft.com/fwlink?Prod...er&LinkId=20476
ADDITIONAL INFORMATION:
System.Data.SqlClient.SqlError: The operating system returned the error
'32(The process cannot access the file because it is being used by
another process.)' while attempting
'RestoreContainer::ValidateTargetForCrea
tion' on 'C:\Program
Files\Microsoft SQL Server\MSSQL\data\pubs.mdf'.
(Microsoft.SqlServer.Smo)
For help, click:
http://go.microsoft.com/fwlink?Prod...>
LinkId=20476
BUTTONS:
OK
--
I am not sure why it is complaining about 'its being used by another
process' I don't have it available under my server explorer.
I can send the word doc of all the snap shots that i documented during
the restoration process if you think that helps.
Thanks
-L|||How many instances of SQL Server are you running? It sounds like the MDF
you are trying to attach is already attached to another instance of SQL
Server...
"Learner" <pradev@.gmail.com> wrote in message
news:1139935089.008898.70290@.o13g2000cwo.googlegroups.com...
> Tibor,
> The mssage i got in the final step of restoration process when i
> clicked on OK after the adding the pub.bak from
> -Microsoft Sql Server
> +80
> +90
> -MS Sql
> - BACKUP
> -pubs.bak
> from Locate Backup file wizard.
> The error i got was
> TITLE: Microsoft SQL Server Management Studio
> --
> Restore failed for Server 'DEVI\SQLDM2005'. (Microsoft.SqlServer.Smo)
> For help, click:
> http://go.microsoft.com/fwlink?Prod...er&LinkId=20476
> --
> ADDITIONAL INFORMATION:
> System.Data.SqlClient.SqlError: The operating system returned the error
> '32(The process cannot access the file because it is being used by
> another process.)' while attempting
> 'RestoreContainer::ValidateTargetForCrea
tion' on 'C:\Program
> Files\Microsoft SQL Server\MSSQL\data\pubs.mdf'.
> (Microsoft.SqlServer.Smo)
> For help, click:
> http://go.microsoft.com/fwlink?Prod...
0&LinkId=20476
> --
> BUTTONS:
> OK
> --
> I am not sure why it is complaining about 'its being used by another
> process' I don't have it available under my server explorer.
> I can send the word doc of all the snap shots that i documented during
> the restoration process if you think that helps.
> Thanks
> -L
>|||Hello,
I have three servers registered in my Registered Servers window.
Devi (Sql server 2000)
Devi\Sqldm2005(Sql server 2005)
Devserver\Sql2005(Sql server 2005)
And i have only instance running under my Object Explorer
Devi\Sqldm2005(Sql server 2005)
I have pubs and Northwind databases by default under the server
Devi(which is sql server 2000).
But i don't have it attached it to my Object Explorer if at all that
makes any difference.
I am not sure if i am answering your question right though.
Tahanks
-D|||Look in Books Online for the syntax of sp_attach_db. You need to provide the
physical file names for
both the mdf and the ldf file.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Learner" <pradev@.gmail.com> wrote in message
news:1139936762.694587.151210@.g47g2000cwa.googlegroups.com...
> Hello,
> I have three servers registered in my Registered Servers window.
> Devi (Sql server 2000)
> Devi\Sqldm2005(Sql server 2005)
> Devserver\Sql2005(Sql server 2005)
> And i have only instance running under my Object Explorer
> Devi\Sqldm2005(Sql server 2005)
> I have pubs and Northwind databases by default under the server
> Devi(which is sql server 2000).
> But i don't have it attached it to my Object Explorer if at all that
> makes any difference.
> I am not sure if i am answering your question right though.
>
> Tahanks
> -D
>|||Tibor,
You mean i need to do it in Management Studio rather than using the
GUI wizards? I will try doing it through Management Studio.
But mean while if you are comfortable with, i just sent over word
document that i have made during the restoring process to your hotmail
account. Could you please suggest me if i did it right?
Thanks
-L|||Yes, I'm referring to write and execute the TSQL commands in stead of using
the GUI dialogs. I never
use the GUI for these things, so I can't be much help there, I'm afraid...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Learner" <pradev@.gmail.com> wrote in message
news:1139937684.832280.213070@.g47g2000cwa.googlegroups.com...
> Tibor,
> You mean i need to do it in Management Studio rather than using the
> GUI wizards? I will try doing it through Management Studio.
> But mean while if you are comfortable with, i just sent over word
> document that i have made during the restoring process to your hotmail
> account. Could you please suggest me if i did it right?
> Thanks
> -L
>sql

How do i add my database to "data sources"?

In Lesson 9 as you can see here (at 16:50), a connection is created against his .mdf database, and the dataset is shown in the "Data Source" window/panel.
He can then simply drag the data source onto the form, and controls are created and bound automaticly - or drag them as a datagridview to the form.

That is what i want to do, but i have some problems...

I have set up a connection to my SQL Express database, and a dataset is created without problems. The problem is that this dataset does not show up in "Data Source". Actually, i have never seen anything in that panel before, in any of the data sources i have added!

What am i doing wrong? In the menu i click "Data" --> Add new data source --> finish the "wizard". Then i click "Data" --> Show Data sources --> It's EMPTY!

Does this also happen if you just connect to a regular database, not through .mdf file? When i tried it with regular database it works, but although "Data Source" panel is not empty, it contains only DataSources names which are empty inside and not possible to drag onto designer. Is it what you mean by "empty"? If so, then you can click on "Server Explorer" and drag and drop your dataset from there. Then your data sources are going to get populated also.|||

I am trying to connect to a regular database, stored on a different computer running MSSQL Express. Connection and everything is okay.

By "empty", i mean completely empty - theres nothing in the panel - no items at all.

See this screenshot:

http://dritbra.com/temp/datasource.png

As you can see on the screenshot, the items appears as soon as something else than the form designer is active...

Btw, when viewing the server explorer i can't drag the items to the form... The mouse has this "not allowed" icon.

|||So theres really no one who can even confirm that the data set is supposed to appear in the data source panel, available for "drag and drop"?|||

Ok, this appears to be a known issue - probably occuring because i have had a beta installed (allthough i have completely reinstalled final version two times on this computer).

SOLUTION:

OPEN:
C:\Documents and Settings\<UserName>\Application Data\Microsoft\VisualStudio\8.0\DataBindingSetting\WinFormControls.xml

ADD THIS:

<DataType Name="System.Collections.IList">
<BindableControlInfo Name="DataGridView" Type="System.Windows.Forms.DataGridView" AssemblyName="System.Windows.Forms, Version=2.6.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<BindableControlInfo Name="[None]" Type="Microsoft.VSDesigner.Data.BindManager.NoneControlPlaceHolder" />
</DataType>

How do i add my database to "data sources"?

In Lesson 9 as you can see here (at 16:50), a connection is created against his .mdf database, and the dataset is shown in the "Data Source" window/panel.
He can then simply drag the data source onto the form, and controls are created and bound automaticly - or drag them as a datagridview to the form.

That is what i want to do, but i have some problems...

I have set up a connection to my SQL Express database, and a dataset is created without problems. The problem is that this dataset does not show up in "Data Source". Actually, i have never seen anything in that panel before, in any of the data sources i have added!

What am i doing wrong? In the menu i click "Data" --> Add new data source --> finish the "wizard". Then i click "Data" --> Show Data sources --> It's EMPTY!

Does this also happen if you just connect to a regular database, not through .mdf file? When i tried it with regular database it works, but although "Data Source" panel is not empty, it contains only DataSources names which are empty inside and not possible to drag onto designer. Is it what you mean by "empty"? If so, then you can click on "Server Explorer" and drag and drop your dataset from there. Then your data sources are going to get populated also.|||

I am trying to connect to a regular database, stored on a different computer running MSSQL Express. Connection and everything is okay.

By "empty", i mean completely empty - theres nothing in the panel - no items at all.

See this screenshot:

http://dritbra.com/temp/datasource.png

As you can see on the screenshot, the items appears as soon as something else than the form designer is active...

Btw, when viewing the server explorer i can't drag the items to the form... The mouse has this "not allowed" icon.

|||So theres really no one who can even confirm that the data set is supposed to appear in the data source panel, available for "drag and drop"?|||

Ok, this appears to be a known issue - probably occuring because i have had a beta installed (allthough i have completely reinstalled final version two times on this computer).

SOLUTION:

OPEN:
C:\Documents and Settings\<UserName>\Application Data\Microsoft\VisualStudio\8.0\DataBindingSetting\WinFormControls.xml

ADD THIS:

<DataType Name="System.Collections.IList">
<BindableControlInfo Name="DataGridView" Type="System.Windows.Forms.DataGridView" AssemblyName="System.Windows.Forms, Version=2.6.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<BindableControlInfo Name="[None]" Type="Microsoft.VSDesigner.Data.BindManager.NoneControlPlaceHolder" />
</DataType>

How do I add condition for a sum() value in the select statement?

Hi
I'm builing this string dynamically in C# program. I need to add one more
filtering condition of "Sum(Amount) >0" to the Select statement. I added it
but I got an error message. Can someone help on how to do this in one select
statment?
Thanks, Alpha
select exttid,sum(amount) as FeeBalance from tblLedger
where exttid in
(select distinct(exttid) from tblBilling b
where datediff(day,cast('5/17/2005' as datetime),b.formdate) >= 0
and datediff(day,cast('8/17/2005' as datetime),b.formdate) <= 0)
and void = 0
group by exttid
Look at the "Having" clause of the select statement. "Having" works on
"Group By" much like the 'Where" works on "From". In your case, you would
add something like:
HAVING Sum(Amount) > 0
after your Group By section.
Geoff N. Hiten
Senior Database Administrator
Microsoft SQL Server MVP
"Alpha" <Alpha@.discussions.microsoft.com> wrote in message
news:F6DA3969-24F9-4895-B7CB-93ECC06EB852@.microsoft.com...
> Hi
> I'm builing this string dynamically in C# program. I need to add one more
> filtering condition of "Sum(Amount) >0" to the Select statement. I added
> it
> but I got an error message. Can someone help on how to do this in one
> select
> statment?
> Thanks, Alpha
> select exttid,sum(amount) as FeeBalance from tblLedger
> where exttid in
> (select distinct(exttid) from tblBilling b
> where datediff(day,cast('5/17/2005' as datetime),b.formdate) >= 0
> and datediff(day,cast('8/17/2005' as datetime),b.formdate) <= 0)
> and void = 0
> group by exttid

How do I add condition for a sum() value in the select statement?

Hi
I'm builing this string dynamically in C# program. I need to add one more
filtering condition of "Sum(Amount) >0" to the Select statement. I added it
but I got an error message. Can someone help on how to do this in one select
statment?
Thanks, Alpha
select exttid,sum(amount) as FeeBalance from tblLedger
where exttid in
(select distinct(exttid) from tblBilling b
where datediff(day,cast('5/17/2005' as datetime),b.formdate) >= 0
and datediff(day,cast('8/17/2005' as datetime),b.formdate) <= 0)
and void = 0
group by exttidLook at the "Having" clause of the select statement. "Having" works on
"Group By" much like the 'Where" works on "From". In your case, you would
add something like:
HAVING Sum(Amount) > 0
after your Group By section.
--
Geoff N. Hiten
Senior Database Administrator
Microsoft SQL Server MVP
"Alpha" <Alpha@.discussions.microsoft.com> wrote in message
news:F6DA3969-24F9-4895-B7CB-93ECC06EB852@.microsoft.com...
> Hi
> I'm builing this string dynamically in C# program. I need to add one more
> filtering condition of "Sum(Amount) >0" to the Select statement. I added
> it
> but I got an error message. Can someone help on how to do this in one
> select
> statment?
> Thanks, Alpha
> select exttid,sum(amount) as FeeBalance from tblLedger
> where exttid in
> (select distinct(exttid) from tblBilling b
> where datediff(day,cast('5/17/2005' as datetime),b.formdate) >= 0
> and datediff(day,cast('8/17/2005' as datetime),b.formdate) <= 0)
> and void = 0
> group by exttid|||Oh, I see. I have to use Having and it's after the Group. It works great.
Thank you very much and have a great day!
"Geoff N. Hiten" wrote:
> Look at the "Having" clause of the select statement. "Having" works on
> "Group By" much like the 'Where" works on "From". In your case, you would
> add something like:
> HAVING Sum(Amount) > 0
> after your Group By section.
> --
> Geoff N. Hiten
> Senior Database Administrator
> Microsoft SQL Server MVP
> "Alpha" <Alpha@.discussions.microsoft.com> wrote in message
> news:F6DA3969-24F9-4895-B7CB-93ECC06EB852@.microsoft.com...
> > Hi
> > I'm builing this string dynamically in C# program. I need to add one more
> > filtering condition of "Sum(Amount) >0" to the Select statement. I added
> > it
> > but I got an error message. Can someone help on how to do this in one
> > select
> > statment?
> >
> > Thanks, Alpha
> >
> > select exttid,sum(amount) as FeeBalance from tblLedger
> > where exttid in
> > (select distinct(exttid) from tblBilling b
> > where datediff(day,cast('5/17/2005' as datetime),b.formdate) >= 0
> > and datediff(day,cast('8/17/2005' as datetime),b.formdate) <= 0)
> > and void = 0
> > group by exttid
>
>

How do I add condition for a sum() value in the select statement?

Hi
I'm builing this string dynamically in C# program. I need to add one more
filtering condition of "Sum(Amount) >0" to the Select statement. I added it
but I got an error message. Can someone help on how to do this in one selec
t
statment?
Thanks, Alpha
select exttid,sum(amount) as FeeBalance from tblLedger
where exttid in
(select distinct(exttid) from tblBilling b
where datediff(day,cast('5/17/2005' as datetime),b.formdate) >= 0
and datediff(day,cast('8/17/2005' as datetime),b.formdate) <= 0)
and void = 0
group by exttidLook at the "Having" clause of the select statement. "Having" works on
"Group By" much like the 'Where" works on "From". In your case, you would
add something like:
HAVING Sum(Amount) > 0
after your Group By section.
Geoff N. Hiten
Senior Database Administrator
Microsoft SQL Server MVP
"Alpha" <Alpha@.discussions.microsoft.com> wrote in message
news:F6DA3969-24F9-4895-B7CB-93ECC06EB852@.microsoft.com...
> Hi
> I'm builing this string dynamically in C# program. I need to add one more
> filtering condition of "Sum(Amount) >0" to the Select statement. I added
> it
> but I got an error message. Can someone help on how to do this in one
> select
> statment?
> Thanks, Alpha
> select exttid,sum(amount) as FeeBalance from tblLedger
> where exttid in
> (select distinct(exttid) from tblBilling b
> where datediff(day,cast('5/17/2005' as datetime),b.formdate) >= 0
> and datediff(day,cast('8/17/2005' as datetime),b.formdate) <= 0)
> and void = 0
> group by exttidsql

How do I add ASPNET user to SQLExpress DB?

I am going though the ASP.NET QuickStart tutorials. One of the lessons is to add a datagrid. I am able to do that with VWD and am able to connect to the database in VWD. However when I try to execute the application I get a "Login failure" message because the user pcName/ASPNET cannot login.

How do I add the ASPNET user to the SQLExpress database? There don't seem to be any administration tools that were installed with SQL Server Express 2005.

Thanks in advance for the help!

There are two permissions to SQL Server the Server permissions under security in Management in Management Studio and the new security section within the database. The management tools are a separate download. Hope this helps.

http://msdn.microsoft.com/vstudio/express/sql/compare/default.aspx

|||Thank you so much! It worked!|||

the link you posted is taking me to sqlexpress home page. And I don't see anything that is related to our discussion. Could you help little more and send me what I need to do in order to add aspnet user to sqlexpress??

thanks

Cemal

How do I add an ODBC connection data source as a Data Flow Source

I have set up a new connection as a connection from data source, but I cannot see how to use this connection to create my Data Flow Source. I have tried using an OLE DB connection, but this is painfully slow! The process of loading 10,000 rows takes 14 - 15 minutes. The same process in Access using SQL on a linked table via DSN takes 45 seconds.

Have I missed something in my set up of the OLE DB source / connection? Will a DSN source be faster?

Thanks in advance

ADG

Use DataReader Source for ODBC connections.|||

How do you know that the slowness is in the OLE DB sauce component and not in the destination component? How are you setting up the OLE Source component? Providing a query would be faster than selecting a table from the dropdown list.

In general I would not expect ODBC to be faster than OLE DB. but you can test it; create 2 different dataflows 1 with datareader(ODBC) and other with OLEDB (provide a query!) and then connect it to a rowcount or union all transform. When you run the packages you will be able to tell how long it takes to 'read' the data.

How do I add an AS400 system as a Linked server?

I have been reading for 2 hours and testing different way to create a linked
server and I am just not placing the right data in the correct fields... any
recommendations on what to read or where to find resources
What error are you getting?
Kevin Hill
3NF Consulting
http://www.3nf-inc.com/NewsGroups.htm
Real-world stuff I run across with SQL Server:
http://kevin3nf.blogspot.com
"WANNABE" <breichenbach AT istate DOT com> wrote in message
news:OXue2r9FHHA.1804@.TK2MSFTNGP02.phx.gbl...
>I have been reading for 2 hours and testing different way to create a
>linked server and I am just not placing the right data in the correct
>fields... any recommendations on what to read or where to find resources
>