Friday, March 30, 2012
Remove ldf file
I have a SQL Server database with a secondary datafile (*.ndf). I would like to be able to delete that file and only use the *.mdf to store data. Of cource I also have a transaction log file.
Is it possible to move data from the ndf to the mdf and the delete the ndf'
Regards
/FredrikHi,
SQL Server spans data across all data files within a filegroup.So all files
fill will be used for all DMLs. to remove a file , you must first have the
data moved off of the file onto the other members in the data set.
To do this, use the EMPTY FILE parameter in DBCC SHEINKFILE command.
This will empty the file and mark it as unavailable. After that execute
REMOVE FILE in ALTER DATABASE command to drop the NDF file.
See DBCC SHRINKFILE and ALTER database in books online for syntax.
--
Thanks
Hari
MCDBA
"Fredrik" <Fredrik@.discussions.microsoft.com> wrote in message
news:5DCC35E5-43A0-45B7-A3F6-81353A62F09E@.microsoft.com...
> Hi all!
> I have a SQL Server database with a secondary datafile (*.ndf). I would
like to be able to delete that file and only use the *.mdf to store data. Of
cource I also have a transaction log file.
> Is it possible to move data from the ndf to the mdf and the delete the
ndf'
> Regards
> /Fredrik
Remove Fields Programatically
I have too many years worth or data being returned and it exceeds the width of an A4 page - So I want to allow the users to select the years that they wish to view via a checkedlistbox - but each time I remove the Columns from the dataTable that populates the report files I get an error as noted below
I'm using VS 2005 and CR shipped with it...
<error>
The field name is not known.
Error in Filed C:\documents and settings\<insert file path here>\rpt_siz_xty {EBEF8981-654C-42C7-9DDA-3AC4184771C8}.RPT:
Error in formula <sizYr01>.
If IsNull({sp_rpt_siz_xty;1.sizYr01}) Then space(12) Else Cstr({sp_rpt_siz_xty;1.sizYr01})
The field name is not known.
</error>
I've dome a fair amount of searching and can't seem to find any remove methods for the field definitions...
Anyone?I think the field u r deleting is used in a formula in report. U need to delete that formula also.|||Why do you want to do it at runtime?
Wednesday, March 28, 2012
Remove Backup History
Now,
I want to remove the backup history log from the Restore Database dialog
window but I could not find the command to remove it.
exec msdb.dbo.sp_delete_backuphistory
"JSL" <JSL@.discussions.microsoft.com> wrote in message
news:877ED168-5E2E-44CA-ABD8-9E16F83B9AA1@.microsoft.com...
> I have done a database backup and store the backup file in a harddisk
folder.
> Now,
> I want to remove the backup history log from the Restore Database dialog
> window but I could not find the command to remove it.
|||Thanks a lot. It works.
"Hassan" wrote:
> exec msdb.dbo.sp_delete_backuphistory
> "JSL" <JSL@.discussions.microsoft.com> wrote in message
> news:877ED168-5E2E-44CA-ABD8-9E16F83B9AA1@.microsoft.com...
> folder.
>
>
Remove Backup History
.
Now,
I want to remove the backup history log from the Restore Database dialog
window but I could not find the command to remove it.exec msdb.dbo.sp_delete_backuphistory
"JSL" <JSL@.discussions.microsoft.com> wrote in message
news:877ED168-5E2E-44CA-ABD8-9E16F83B9AA1@.microsoft.com...
> I have done a database backup and store the backup file in a harddisk
folder.
> Now,
> I want to remove the backup history log from the Restore Database dialog
> window but I could not find the command to remove it.|||Thanks a lot. It works.
"Hassan" wrote:
> exec msdb.dbo.sp_delete_backuphistory
> "JSL" <JSL@.discussions.microsoft.com> wrote in message
> news:877ED168-5E2E-44CA-ABD8-9E16F83B9AA1@.microsoft.com...
> folder.
>
>
Remove Backup History
Now,
I want to remove the backup history log from the Restore Database dialog
window but I could not find the command to remove it.exec msdb.dbo.sp_delete_backuphistory
"JSL" <JSL@.discussions.microsoft.com> wrote in message
news:877ED168-5E2E-44CA-ABD8-9E16F83B9AA1@.microsoft.com...
> I have done a database backup and store the backup file in a harddisk
folder.
> Now,
> I want to remove the backup history log from the Restore Database dialog
> window but I could not find the command to remove it.|||Thanks a lot. It works.
"Hassan" wrote:
> exec msdb.dbo.sp_delete_backuphistory
> "JSL" <JSL@.discussions.microsoft.com> wrote in message
> news:877ED168-5E2E-44CA-ABD8-9E16F83B9AA1@.microsoft.com...
> > I have done a database backup and store the backup file in a harddisk
> folder.
> > Now,
> > I want to remove the backup history log from the Restore Database dialog
> > window but I could not find the command to remove it.
>
>sql
Monday, March 26, 2012
remove all double quotes from column values using t-sql
I am having problem withj double quotes being inserted automatically when i
am inserting data using a CSV file.I am using a C# program to insert the
values.
My coulmn is called whereClause and it is a varchar(50) e.g
'ISNULL(salary,2000)=2000'
but what gets inserted is "'ISNULL(salary,2000)=2000'"
I am using this value in dynamic sql to generate a query such as
exec 'select salary from employee where '+@.whereClause and I get error
because of the automatic double quote insertion.
The CSV file does not have double quotes so I need a solution that will do
either 1 of the following
1)suppress insertion of double quotes in the table in C# OR
2)write query to remove the double quotes using T-SQL
Solution 2 is preferable.
Your help is highly appreciated.
Thanks.if I understood the question correctly, this should work..
declare @.a varchar(30)
set @.a = '"ISNULL(salary,2000)=2000"'
select replace(@.a,'"','')|||Thans for the reply.
But the problem is I have about a thousand rows and each condition is
different and having double quotes eg
id whereClause
1 "ISNULL(salary,5000)=5000"
2 "ISNULL(bonus,400)>600"
3 "IN(600,40)"
I want to remove all double quotes and update the table with proper values i
e
if table contains "ISNULL(salary,5000)=5000" I want to update it as
ISNULL(salary,5000)=5000
Thanks.
"Omnibuzz" wrote:
> if I understood the question correctly, this should work..
> declare @.a varchar(30)
> set @.a = '"ISNULL(salary,2000)=2000"'
> select replace(@.a,'"','')|||Use REPLACE:
create table #x (s varchar(30))
INSERT #x values ('abcdefg')
INSERT #x values ('"hijklmn"')
INSERT #x values ('o"p"q"r"s"t"u')
select * from #x
UPDATE #x
SET S = REPLACE(S,'"','')
select * from #x
Roy Harvey
Beacon Falls, CT
On Wed, 5 Apr 2006 11:18:02 -0700,
<
>Hi,
>I am having problem withj double quotes being inserted automatically when i
>am inserting data using a CSV file.I am using a C# program to insert the
>values.
>My coulmn is called whereClause and it is a varchar(50) e.g
>'ISNULL(salary,2000)=2000'
>but what gets inserted is "'ISNULL(salary,2000)=2000'"
>I am using this value in dynamic sql to generate a query such as
>exec 'select salary from employee where '+@.whereClause and I get error
>because of the automatic double quote insertion.
>The CSV file does not have double quotes so I need a solution that will do
>either 1 of the following
>1)suppress insertion of double quotes in the table in C# OR
>2)write query to remove the double quotes using T-SQL
>Solution 2 is preferable.
>Your help is highly appreciated.
>Thanks.|||Thanks.That worked like a charm!!
"Roy Harvey" wrote:
> Use REPLACE:
> create table #x (s varchar(30))
> INSERT #x values ('abcdefg')
> INSERT #x values ('"hijklmn"')
> INSERT #x values ('o"p"q"r"s"t"u')
> select * from #x
> UPDATE #x
> SET S = REPLACE(S,'"','')
> select * from #x
> Roy Harvey
> Beacon Falls, CT
> On Wed, 5 Apr 2006 11:18:02 -0700,
> <
>
>sql
remove a filegroup
I would like to remove 1 filegroup. This filegroup contains 1 file.
I know when I want to remove a file from a filegroup which contains multiple
files, I first have to empty that file (dbcc shrinkfile with emtyfile).
But how do you empty a file in a filegroup in which that file is the only
file.
This is necessary I think because only empty files can be removed from a
filegroup, and only an empty filegroup can be removed from a database.
Can someone help me with this one ?
thx
Franky,
You can move a table to a different filegroup by re-creating the clustered
index using the ON FILEGROUP clause of the CREATE INDEX statement. NC
indexes can be moved this way as well.
HTH
Jerry
"Franky" <Franky@.discussions.microsoft.com> wrote in message
news:A28170DF-7CC0-4855-A447-EB2AB8A9C26B@.microsoft.com...
>I have a database with several filegroups.
> I would like to remove 1 filegroup. This filegroup contains 1 file.
> I know when I want to remove a file from a filegroup which contains
> multiple
> files, I first have to empty that file (dbcc shrinkfile with emtyfile).
> But how do you empty a file in a filegroup in which that file is the only
> file.
> This is necessary I think because only empty files can be removed from a
> filegroup, and only an empty filegroup can be removed from a database.
> Can someone help me with this one ?
> thx
|||Jerry, thx for the advice, but I should have specified more in detail in my
question that that is not a good solution. There are hundreds of tables in
this file with each of them having several indexes. So I was looking for an
other kind of solution.
"Jerry Spivey" wrote:
> Franky,
> You can move a table to a different filegroup by re-creating the clustered
> index using the ON FILEGROUP clause of the CREATE INDEX statement. NC
> indexes can be moved this way as well.
> HTH
> Jerry
> "Franky" <Franky@.discussions.microsoft.com> wrote in message
> news:A28170DF-7CC0-4855-A447-EB2AB8A9C26B@.microsoft.com...
>
>
|||Hmmm...I don't know. Might consider detach/attach moving the file(s) to
another physical location if that is the issue here.
HTH
Jerry
"Franky" <Franky@.discussions.microsoft.com> wrote in message
news:E355035F-78C2-4C69-B9D1-83401390297E@.microsoft.com...[vbcol=seagreen]
> Jerry, thx for the advice, but I should have specified more in detail in
> my
> question that that is not a good solution. There are hundreds of tables in
> this file with each of them having several indexes. So I was looking for
> an
> other kind of solution.
>
> "Jerry Spivey" wrote:
|||That does not solve my problem, I would like to delete the filegroup with
that single file in it. And be back in the state of having 1 primary
filegroup, and 1 user filegroup which is the default with several files in it.
"Jerry Spivey" wrote:
> Hmmm...I don't know. Might consider detach/attach moving the file(s) to
> another physical location if that is the issue here.
> HTH
> Jerry
> "Franky" <Franky@.discussions.microsoft.com> wrote in message
> news:E355035F-78C2-4C69-B9D1-83401390297E@.microsoft.com...
>
>
sql
remove a filegroup
I would like to remove 1 filegroup. This filegroup contains 1 file.
I know when I want to remove a file from a filegroup which contains multiple
files, I first have to empty that file (dbcc shrinkfile with emtyfile).
But how do you empty a file in a filegroup in which that file is the only
file.
This is necessary I think because only empty files can be removed from a
filegroup, and only an empty filegroup can be removed from a database.
Can someone help me with this one ?
thxFranky,
You can move a table to a different filegroup by re-creating the clustered
index using the ON FILEGROUP clause of the CREATE INDEX statement. NC
indexes can be moved this way as well.
HTH
Jerry
"Franky" <Franky@.discussions.microsoft.com> wrote in message
news:A28170DF-7CC0-4855-A447-EB2AB8A9C26B@.microsoft.com...
>I have a database with several filegroups.
> I would like to remove 1 filegroup. This filegroup contains 1 file.
> I know when I want to remove a file from a filegroup which contains
> multiple
> files, I first have to empty that file (dbcc shrinkfile with emtyfile).
> But how do you empty a file in a filegroup in which that file is the only
> file.
> This is necessary I think because only empty files can be removed from a
> filegroup, and only an empty filegroup can be removed from a database.
> Can someone help me with this one ?
> thx|||Jerry, thx for the advice, but I should have specified more in detail in my
question that that is not a good solution. There are hundreds of tables in
this file with each of them having several indexes. So I was looking for an
other kind of solution.
"Jerry Spivey" wrote:
> Franky,
> You can move a table to a different filegroup by re-creating the clustered
> index using the ON FILEGROUP clause of the CREATE INDEX statement. NC
> indexes can be moved this way as well.
> HTH
> Jerry
> "Franky" <Franky@.discussions.microsoft.com> wrote in message
> news:A28170DF-7CC0-4855-A447-EB2AB8A9C26B@.microsoft.com...
> >I have a database with several filegroups.
> > I would like to remove 1 filegroup. This filegroup contains 1 file.
> > I know when I want to remove a file from a filegroup which contains
> > multiple
> > files, I first have to empty that file (dbcc shrinkfile with emtyfile).
> > But how do you empty a file in a filegroup in which that file is the only
> > file.
> > This is necessary I think because only empty files can be removed from a
> > filegroup, and only an empty filegroup can be removed from a database.
> >
> > Can someone help me with this one ?
> >
> > thx
>
>|||Hmmm...I don't know. Might consider detach/attach moving the file(s) to
another physical location if that is the issue here.
HTH
Jerry
"Franky" <Franky@.discussions.microsoft.com> wrote in message
news:E355035F-78C2-4C69-B9D1-83401390297E@.microsoft.com...
> Jerry, thx for the advice, but I should have specified more in detail in
> my
> question that that is not a good solution. There are hundreds of tables in
> this file with each of them having several indexes. So I was looking for
> an
> other kind of solution.
>
> "Jerry Spivey" wrote:
>> Franky,
>> You can move a table to a different filegroup by re-creating the
>> clustered
>> index using the ON FILEGROUP clause of the CREATE INDEX statement. NC
>> indexes can be moved this way as well.
>> HTH
>> Jerry
>> "Franky" <Franky@.discussions.microsoft.com> wrote in message
>> news:A28170DF-7CC0-4855-A447-EB2AB8A9C26B@.microsoft.com...
>> >I have a database with several filegroups.
>> > I would like to remove 1 filegroup. This filegroup contains 1 file.
>> > I know when I want to remove a file from a filegroup which contains
>> > multiple
>> > files, I first have to empty that file (dbcc shrinkfile with emtyfile).
>> > But how do you empty a file in a filegroup in which that file is the
>> > only
>> > file.
>> > This is necessary I think because only empty files can be removed from
>> > a
>> > filegroup, and only an empty filegroup can be removed from a database.
>> >
>> > Can someone help me with this one ?
>> >
>> > thx
>>|||That does not solve my problem, I would like to delete the filegroup with
that single file in it. And be back in the state of having 1 primary
filegroup, and 1 user filegroup which is the default with several files in it.
"Jerry Spivey" wrote:
> Hmmm...I don't know. Might consider detach/attach moving the file(s) to
> another physical location if that is the issue here.
> HTH
> Jerry
> "Franky" <Franky@.discussions.microsoft.com> wrote in message
> news:E355035F-78C2-4C69-B9D1-83401390297E@.microsoft.com...
> > Jerry, thx for the advice, but I should have specified more in detail in
> > my
> > question that that is not a good solution. There are hundreds of tables in
> > this file with each of them having several indexes. So I was looking for
> > an
> > other kind of solution.
> >
> >
> >
> > "Jerry Spivey" wrote:
> >
> >> Franky,
> >>
> >> You can move a table to a different filegroup by re-creating the
> >> clustered
> >> index using the ON FILEGROUP clause of the CREATE INDEX statement. NC
> >> indexes can be moved this way as well.
> >>
> >> HTH
> >>
> >> Jerry
> >> "Franky" <Franky@.discussions.microsoft.com> wrote in message
> >> news:A28170DF-7CC0-4855-A447-EB2AB8A9C26B@.microsoft.com...
> >> >I have a database with several filegroups.
> >> > I would like to remove 1 filegroup. This filegroup contains 1 file.
> >> > I know when I want to remove a file from a filegroup which contains
> >> > multiple
> >> > files, I first have to empty that file (dbcc shrinkfile with emtyfile).
> >> > But how do you empty a file in a filegroup in which that file is the
> >> > only
> >> > file.
> >> > This is necessary I think because only empty files can be removed from
> >> > a
> >> > filegroup, and only an empty filegroup can be removed from a database.
> >> >
> >> > Can someone help me with this one ?
> >> >
> >> > thx
> >>
> >>
> >>
>
>
remove a filegroup
I would like to remove 1 filegroup. This filegroup contains 1 file.
I know when I want to remove a file from a filegroup which contains multiple
files, I first have to empty that file (dbcc shrinkfile with emtyfile).
But how do you empty a file in a filegroup in which that file is the only
file.
This is necessary I think because only empty files can be removed from a
filegroup, and only an empty filegroup can be removed from a database.
Can someone help me with this one ?
thxFranky,
You can move a table to a different filegroup by re-creating the clustered
index using the ON FILEGROUP clause of the CREATE INDEX statement. NC
indexes can be moved this way as well.
HTH
Jerry
"Franky" <Franky@.discussions.microsoft.com> wrote in message
news:A28170DF-7CC0-4855-A447-EB2AB8A9C26B@.microsoft.com...
>I have a database with several filegroups.
> I would like to remove 1 filegroup. This filegroup contains 1 file.
> I know when I want to remove a file from a filegroup which contains
> multiple
> files, I first have to empty that file (dbcc shrinkfile with emtyfile).
> But how do you empty a file in a filegroup in which that file is the only
> file.
> This is necessary I think because only empty files can be removed from a
> filegroup, and only an empty filegroup can be removed from a database.
> Can someone help me with this one ?
> thx|||Jerry, thx for the advice, but I should have specified more in detail in my
question that that is not a good solution. There are hundreds of tables in
this file with each of them having several indexes. So I was looking for an
other kind of solution.
"Jerry Spivey" wrote:
> Franky,
> You can move a table to a different filegroup by re-creating the clustered
> index using the ON FILEGROUP clause of the CREATE INDEX statement. NC
> indexes can be moved this way as well.
> HTH
> Jerry
> "Franky" <Franky@.discussions.microsoft.com> wrote in message
> news:A28170DF-7CC0-4855-A447-EB2AB8A9C26B@.microsoft.com...
>
>|||Hmmm...I don't know. Might consider detach/attach moving the file(s) to
another physical location if that is the issue here.
HTH
Jerry
"Franky" <Franky@.discussions.microsoft.com> wrote in message
news:E355035F-78C2-4C69-B9D1-83401390297E@.microsoft.com...[vbcol=seagreen]
> Jerry, thx for the advice, but I should have specified more in detail in
> my
> question that that is not a good solution. There are hundreds of tables in
> this file with each of them having several indexes. So I was looking for
> an
> other kind of solution.
>
> "Jerry Spivey" wrote:
>|||That does not solve my problem, I would like to delete the filegroup with
that single file in it. And be back in the state of having 1 primary
filegroup, and 1 user filegroup which is the default with several files in i
t.
"Jerry Spivey" wrote:
> Hmmm...I don't know. Might consider detach/attach moving the file(s) to
> another physical location if that is the issue here.
> HTH
> Jerry
> "Franky" <Franky@.discussions.microsoft.com> wrote in message
> news:E355035F-78C2-4C69-B9D1-83401390297E@.microsoft.com...
>
>
Remove 2nd Log file
I've got a SQL 2000 SP4 server with a database that has 3 data files and 2
logs files.
I no longer need the 2nd log file and I would like to remove it. How is this
best accomplished with no or at least extremely minimal downtime. Is it done
the same way I remove a data file?
DBCC SHRINKFILE (MySecondLogFile, EMPTYFILE)
GO
USE master
GO
ALTER DATABASE MyDatabase
REMOVE FILE MySecondLogFile
Thanks for any advice or pointers!
-PhilHi,
As a first step take a transaction log backup to clear the active portion in
transaction log.
Step -1 - Transaction log backup
Step 2 - DBCC SHRINKFILE EMPTY FILE
Step -3 - ALTER DATABASE REMOVE FILE
Thanks
Hari
SQL Server MVP
"pmattson" <pmattson@.discussions.microsoft.com> wrote in message
news:CA34A3A3-1DC6-42EF-BFB9-C94DC2EC3CB2@.microsoft.com...
> Hi all,
> I've got a SQL 2000 SP4 server with a database that has 3 data files and 2
> logs files.
> I no longer need the 2nd log file and I would like to remove it. How is
> this
> best accomplished with no or at least extremely minimal downtime. Is it
> done
> the same way I remove a data file?
> DBCC SHRINKFILE (MySecondLogFile, EMPTYFILE)
> GO
> USE master
> GO
> ALTER DATABASE MyDatabase
> REMOVE FILE MySecondLogFile
>
> Thanks for any advice or pointers!
> -Phil
Friday, March 9, 2012
Remote MSSQL2000 server connection with .net
I am able connect to database with my ASP page.
Any sugession is greately appretiated!
Here is my code:
".net" page:
<%@. page language='vb' debug='true' %>
<%@. Import Namespace="System.Data" %>
<%@. Import Namespace="System.Data.SqlClient" %>
<html>
<script runat="server"
Sub Page_Load(Src As Object, E As EventArgs)
Dim MyConnection As SqlConnection
Dim da AS sqlDataAdaptor
Dim ds As DataSet
MyConnection = New SqlConnection("DSN=***;UID=***;PWD=***")
da = new sqlDataAdaptor("select * from city", MyConnection)
Try
MyConnection.open()
Response.write "Connection Success " & MyConnection.Database & "<br>"
catch sx AS sqlException
Response.write "Connection successful: <br>"
End Tryds=new Dataset()
da.Fill(ds, "City")With DataGrid1
.DataSource = ds.Tables("city").DefaultView
.DataBind()
End WithMyConnection.Close()
End Sub
</script
<body
<p>
<ASP:dataGrid id='DataGrid1' runat='server'/>
<p>
</body>
</html>
--------------
"ASP" page:
Set DB = Server.CreateObject("ADODB.Connection")
DB.Open ConnectionStringSET RSCheckeMail = DB.Execute ("select * from city")
While not RSCheckeMail.eof
Response.write "City: " & RSCheckeMail("Name") & "<br>"
RSCheckeMail.Movenext
Wend
Thanks for your help in advance.Please any help on this?|||As far as I understand it, in order to use a DSN in the connection string you have to use the ODBC provider, which is not recommended. You really need to try to use SQLClient.
Please check out the connection string suggestions athttp://www.connectionstrings.com. I would think that you would need to connect using an IP address.
Terri|||tmorton,
Thank you for your suggestion. I am trying with SQLClient only or I am missing some thing here.
I tried with all the connection strings explained in the URL: http://www.connectionstrings.com. No luck.
Any more suggestions? please.
KP|||can you post the updated code ?|||Yes, you are using SQLClient, which is good. What I was trying to say but wasn't clear is that if you want to use a DSN you would need to use ODBC instead.
Did you try a connection string in this format?
"Data Source=190.190.200.100;Network Library=DBMSSOCN;Initial Catalog=yourDatabase;User ID=yourSQLUserID;Password=youSQLUserPassword;"
If you could post your attempted connection string and any errors your are receiving this would help to troubleshoot the problem.
Terri|||tmorton,
Thank you for your advice.
I got the solution for my problem.
I think all new .net learners like me has this problem initially. I mistake I did was, not using VS .net to start my development.
All beginners you need to remember to do this when you start for the first time when you start running some sample .net pages: Create an application (vb or c#) depends as per your preference. Then add all the pages to that Application. This will make your test pages will run properly (you won't waste time like me for 3 days to scratch your head to run a simple page!!).
Here is my final code to connect remote server from your IIS:
<%@. page language='vb' %>
<%@. Import Namespace="System.Data" %>
<%@. Import Namespace="System.Data.SqlClient" %
<script runat="server"
Sub Page_Load(Src As Object, E As EventArgs)
Dim MyConnection As SqlConnection
Dim da AS sqlDataAdapter
Dim ds As DataSet
MyConnection = new SqlConnection("server=65.49.254.24;database=aspdotnet;uid=aspdotnetuser;pwd=aspdotnetpassword")da = new sqlDataAdapter("select * from city", MyConnection)
Try
MyConnection.open()
Response.write ("Connection Success <br>")
catch sx AS sqlException
Response.write ("Connection failed: <br>")
End Tryds=new Dataset()
da.fill(ds, "cities")With DataGrid1
.DataSource = ds.Tables("cities").DefaultView
.DataBind()
End With
MyConnection.Close()
End Sub</script>
<html>
<body
<p>
<ASP:dataGrid id='DataGrid1' runat='server'/>
<p>
</body>
</html>
Please correct me if you can improve the connection.
Thanks for your support.
KP|||this is good...works..but if you just want to display a set of results...you can use executereader (for returning multiple columns) which is faster than datasets...am sure you will learn along the journey...
in your case you could have just created an sqlcommand...xample..( off the top of my head)
dim mysqlcommand as sqlcommand
Dim conn As SqlConnection
dim strsql as string
conn="..."
strsql ="Select * from table"
mysqlcommand=new sqlcommand(strsql,conn)
conn.open()
datagrid.datasource=mysqlcommand.executereader()
conn.close()
also remember to open the connection late and close early...
hth|||Dinakar,
Thanks for your suggestions. I will remember them.
You are right! Just now I started long journey...
KP
Remote Installation Create Response File
Hi,
Actaully i want to install SQL SERVER 2005 Enterprise edition in the silent mode and I was tyring to create a response file (setup.iss), but from the document provided i saw that SQL SERVER 2005 Enterprise edition doesnt create response file, and doesnt support setup.iss. So please provide me some solution where i can generate response file or some thing which is similar to that.
SQL 2005 now supports a ton of switches which will allow you to select all the GUI options from the command line. Check the docs on the DVD for all the options. Stick the finished command line in a batch file and use your favorite remote install tool to launch the batch file.|||Here's the link in BOL for silent installs with a ton of examples:
http://msdn2.microsoft.com/en-us/library/ms144259.aspx
Thanks,
Sam Lester (MSFT)
Wednesday, March 7, 2012
Remote database
Requirements for hosting the report server database on a
remote SQL Server instance", it says that;
"If the remote SQL SErver instance runs as a domain user,
you must specify that same domain user account for the
report server connection"
Why is that? And what would happen if I choose to use
another Windows domain account with sufficient previliges
on the SQL Server isntance? I thought all that matters is
the permissions granted, and this requirement seems pretty
odd.
JoeI seem to remember some issues with setting the Kerberos SPN for SQL Server
when it's running as a domain account. That would result in an error when
creating subscriptions to reports. I don't remember whether that is still an
issue on current bits, I guess the simplest way to find out would be to try
it.
--
Tudor Trufinescu
Dev Lead
Sql Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Joe Bourne" <anonymous@.discussions.microsoft.com> wrote in message
news:532401c4740f$f80cdae0$a401280a@.phx.gbl...
> In the SSRS 2000 readme file, under the heading "1.6
> Requirements for hosting the report server database on a
> remote SQL Server instance", it says that;
> "If the remote SQL SErver instance runs as a domain user,
> you must specify that same domain user account for the
> report server connection"
> Why is that? And what would happen if I choose to use
> another Windows domain account with sufficient previliges
> on the SQL Server isntance? I thought all that matters is
> the permissions granted, and this requirement seems pretty
> odd.
> Joe|||Hi Tudor;
I have a smilar question.
When I install SSRS2000 with a remote SQL instance, I'd expect that all the
databases would go there. But the install insists that the sample database
AdventureWorks2000 be installed on the local SQL instance. This is annoying
because I don't plan to have any SQL instances on the RS server (I know I
still have to pay for the SQL licensing on that server, which is fine).
Why can't I choose to put the sample database on the remote SQL instance as
well?
Linchi
"Tudor Trufinescu (MSFT)" <tudortr@.ms.com> wrote in message
news:%234kWhtDdEHA.3420@.TK2MSFTNGP12.phx.gbl...
> I seem to remember some issues with setting the Kerberos SPN for SQL
Server
> when it's running as a domain account. That would result in an error when
> creating subscriptions to reports. I don't remember whether that is still
an
> issue on current bits, I guess the simplest way to find out would be to
try
> it.
> --
> Tudor Trufinescu
> Dev Lead
> Sql Server Reporting Services
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> "Joe Bourne" <anonymous@.discussions.microsoft.com> wrote in message
> news:532401c4740f$f80cdae0$a401280a@.phx.gbl...
> > In the SSRS 2000 readme file, under the heading "1.6
> > Requirements for hosting the report server database on a
> > remote SQL Server instance", it says that;
> >
> > "If the remote SQL SErver instance runs as a domain user,
> > you must specify that same domain user account for the
> > report server connection"
> >
> > Why is that? And what would happen if I choose to use
> > another Windows domain account with sufficient previliges
> > on the SQL Server isntance? I thought all that matters is
> > the permissions granted, and this requirement seems pretty
> > odd.
> >
> > Joe
>|||Yes, that is a limitation of the RS setup. The sample databases are attached
to SQL Server and that only works if the files on the same machine as SQL. A
workaround is to run setup for the sample DB on the box with SQL Server and
the rest of it on your RS box.
--
Tudor Trufinescu
Dev Lead
Sql Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Linchi Shea" <linchi_shea@.NOSPAM.ml.com> wrote in message
news:OSpZIaMdEHA.3616@.TK2MSFTNGP10.phx.gbl...
> Hi Tudor;
> I have a smilar question.
> When I install SSRS2000 with a remote SQL instance, I'd expect that all
the
> databases would go there. But the install insists that the sample database
> AdventureWorks2000 be installed on the local SQL instance. This is
annoying
> because I don't plan to have any SQL instances on the RS server (I know I
> still have to pay for the SQL licensing on that server, which is fine).
> Why can't I choose to put the sample database on the remote SQL instance
as
> well?
> Linchi
> "Tudor Trufinescu (MSFT)" <tudortr@.ms.com> wrote in message
> news:%234kWhtDdEHA.3420@.TK2MSFTNGP12.phx.gbl...
> > I seem to remember some issues with setting the Kerberos SPN for SQL
> Server
> > when it's running as a domain account. That would result in an error
when
> > creating subscriptions to reports. I don't remember whether that is
still
> an
> > issue on current bits, I guess the simplest way to find out would be to
> try
> > it.
> >
> > --
> > Tudor Trufinescu
> > Dev Lead
> > Sql Server Reporting Services
> > This posting is provided "AS IS" with no warranties, and confers no
> rights.
> >
> > "Joe Bourne" <anonymous@.discussions.microsoft.com> wrote in message
> > news:532401c4740f$f80cdae0$a401280a@.phx.gbl...
> > > In the SSRS 2000 readme file, under the heading "1.6
> > > Requirements for hosting the report server database on a
> > > remote SQL Server instance", it says that;
> > >
> > > "If the remote SQL SErver instance runs as a domain user,
> > > you must specify that same domain user account for the
> > > report server connection"
> > >
> > > Why is that? And what would happen if I choose to use
> > > another Windows domain account with sufficient previliges
> > > on the SQL Server isntance? I thought all that matters is
> > > the permissions granted, and this requirement seems pretty
> > > odd.
> > >
> > > Joe
> >
> >
>|||The AdventureWorks2000 database is attached ? Hmmm... I see all these csv
files in the ..\Samples\database folder, and that seems to indicate that the
database is created first, and then the data is loaded. This can be done on
a remote SQL instance as easily as it is done on a local instance. Am I
missing something?
Linchi
"Tudor Trufinescu (MSFT)" <tudortr@.ms.com> wrote in message
news:OOtbwgMdEHA.1384@.TK2MSFTNGP10.phx.gbl...
> Yes, that is a limitation of the RS setup. The sample databases are
attached
> to SQL Server and that only works if the files on the same machine as SQL.
A
> workaround is to run setup for the sample DB on the box with SQL Server
and
> the rest of it on your RS box.
> --
> Tudor Trufinescu
> Dev Lead
> Sql Server Reporting Services
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> "Linchi Shea" <linchi_shea@.NOSPAM.ml.com> wrote in message
> news:OSpZIaMdEHA.3616@.TK2MSFTNGP10.phx.gbl...
> > Hi Tudor;
> >
> > I have a smilar question.
> >
> > When I install SSRS2000 with a remote SQL instance, I'd expect that all
> the
> > databases would go there. But the install insists that the sample
database
> > AdventureWorks2000 be installed on the local SQL instance. This is
> annoying
> > because I don't plan to have any SQL instances on the RS server (I know
I
> > still have to pay for the SQL licensing on that server, which is fine).
> >
> > Why can't I choose to put the sample database on the remote SQL instance
> as
> > well?
> >
> > Linchi
> >
> > "Tudor Trufinescu (MSFT)" <tudortr@.ms.com> wrote in message
> > news:%234kWhtDdEHA.3420@.TK2MSFTNGP12.phx.gbl...
> > > I seem to remember some issues with setting the Kerberos SPN for SQL
> > Server
> > > when it's running as a domain account. That would result in an error
> when
> > > creating subscriptions to reports. I don't remember whether that is
> still
> > an
> > > issue on current bits, I guess the simplest way to find out would be
to
> > try
> > > it.
> > >
> > > --
> > > Tudor Trufinescu
> > > Dev Lead
> > > Sql Server Reporting Services
> > > This posting is provided "AS IS" with no warranties, and confers no
> > rights.
> > >
> > > "Joe Bourne" <anonymous@.discussions.microsoft.com> wrote in message
> > > news:532401c4740f$f80cdae0$a401280a@.phx.gbl...
> > > > In the SSRS 2000 readme file, under the heading "1.6
> > > > Requirements for hosting the report server database on a
> > > > remote SQL Server instance", it says that;
> > > >
> > > > "If the remote SQL SErver instance runs as a domain user,
> > > > you must specify that same domain user account for the
> > > > report server connection"
> > > >
> > > > Why is that? And what would happen if I choose to use
> > > > another Windows domain account with sufficient previliges
> > > > on the SQL Server isntance? I thought all that matters is
> > > > the permissions granted, and this requirement seems pretty
> > > > odd.
> > > >
> > > > Joe
> > >
> > >
> >
> >
>