Showing posts with label created. Show all posts
Showing posts with label created. Show all posts

Friday, March 30, 2012

How to change the instance name?

Hello DBA's

I have installed SQL Server 2005 on a machine with named instance, but later I noticed that I created it with the wrong name than desired. Now I need to change the instace name of the SQL Server that I have installed. How can I do that

Thanks

Satya

There is not a supported way to rename an instance. You need to uninstall and then reinstall.

Thanks,

Peter Saddow

|||

Thanks Peter

Satya

How to change the datasource view of a mining model.

Hi,

I created on model in Business Intelligence Development studio.I wants to change the datasourceview(dsv) assigned for that view.for e.g

My mining Model is StudModel.dmm.

The dsv for that model is StudDSV.dsv.

I wants to change the dsv for that model to marksDSV.dsv.

How to do that in Business Intelligence Development studio.

Thanks,

Karthik.

The BI Dev Studio does not provide you with much support for this task.

You can change the DSV manually. It may be very easy or more difficult, depending on how similar the new DSV is compared to the original DSV.

Here is something you can do, manually:

- close the Mining structure designer window

- open the DMM file in BI Dev Studio (right click and select the View Code option)

- look for the <DataSourceViewID> element in the XML. Replace the content of the element with the id of your new data source view

- close and save the file

- double click on the DMM file to load it in the designer and validate the change

Now, if your new data source view contains different tables, or if those tables have differrent columns, more work needs to be done.

Note that the changes will only be visible after you re-deploy and process fully your mining structure

Hope this helps

sql

Wednesday, March 28, 2012

How to change the attribut name?

Hi All,

Suppose I have created one table say "Customer"

Customer (cust_no, cust_name,cust_address)

I want to change the attribute name "cust_no" to "cust_number".

How to do it using ALTER command.

Pls give me the exact syntax for this.

Regards

Abdul

Hi abdul,

The safest way to do so is using the following:

/* To prevent any potential data loss issues, you should review this script in detail before running it outside the context of the database designer.*/
BEGIN TRANSACTION
SET QUOTED_IDENTIFIER ON
SET ARITHABORT ON
SET NUMERIC_ROUNDABORT OFF
SET CONCAT_NULL_YIELDS_NULL ON
SET ANSI_NULLS ON
SET ANSI_PADDING ON
SET ANSI_WARNINGS ON
COMMIT
BEGIN TRANSACTION
GO
EXECUTE sp_rename N'dbo.Customer.cust_no', N'Tmp_cust_number', 'COLUMN'
GO
EXECUTE sp_rename N'dbo.Customer.Tmp_cust_number', N'cust_number', 'COLUMN'
GO
COMMIT

(An easy way to generate a script like this yourself is changing the layout through SQL Server Management Studio, right-clicking the table, selecting "design", then making the change, and before doing anything else, clicking the left-most button labelled "Generate change script").

HTH.

Peter

How to change server name in SQL2K ?

For some reason I had to change server name. I also created new
registration in Enterprise Manager.
When I try to retreive data, it still looking for my old server name.
Where else should I change the server name . ?
Thanks
Here is a quote from KB article 257716:
<< start quote >>
Q. Can I rename a server after installing SQL Server 2000?
A: Yes, you can rename a server after the installation of SQL Server
2000. When the SQL Server service starts for the first time after the
name change, it automatically recognizes the change and resets the
computer name. You do not need to run setup again to reset this value.
However, you must perform several additional configuration steps. To
correct the sysservers system table, you should manually run the
following procedures.
For a default instance: sp_dropserver <old_servername>
go
sp_addserver <new_servername> , local
go
<< end quote >>
You can also see the following KB article:
http://support.microsoft.com/kb/303774
Razvan

Monday, March 26, 2012

How to change server name in SQL2K ?

For some reason I had to change server name. I also created new
registration in Enterprise Manager.
When I try to retreive data, it still looking for my old server name.
Where else should I change the server name . ?
Thanks
Here is a quote from KB article 257716:
<< start quote >>
Q. Can I rename a server after installing SQL Server 2000?
A: Yes, you can rename a server after the installation of SQL Server
2000. When the SQL Server service starts for the first time after the
name change, it automatically recognizes the change and resets the
computer name. You do not need to run setup again to reset this value.
However, you must perform several additional configuration steps. To
correct the sysservers system table, you should manually run the
following procedures.
For a default instance: sp_dropserver <old_servername>
go
sp_addserver <new_servername> , local
go
<< end quote >>
You can also see the following KB article:
http://support.microsoft.com/kb/303774
Razvan

How to change server name in SQL2K ?

For some reason I had to change server name. I also created new
registration in Enterprise Manager.
When I try to retreive data, it still looking for my old server name.
Where else should I change the server name . ?
ThanksHere is a quote from KB article 257716:
<< start quote >>
Q. Can I rename a server after installing SQL Server 2000?
A: Yes, you can rename a server after the installation of SQL Server
2000. When the SQL Server service starts for the first time after the
name change, it automatically recognizes the change and resets the
computer name. You do not need to run setup again to reset this value.
However, you must perform several additional configuration steps. To
correct the sysservers system table, you should manually run the
following procedures.
For a default instance: sp_dropserver <old_servername>
go
sp_addserver <new_servername> , local
go
<< end quote >>
You can also see the following KB article:
http://support.microsoft.com/kb/303774
Razvansql

How to change server name in SQL2K ?

For some reason I had to change server name. I also created new
registration in Enterprise Manager.
When I try to retreive data, it still looking for my old server name.
Where else should I change the server name . ?
ThanksHere is a quote from KB article 257716:
<< start quote >>
Q. Can I rename a server after installing SQL Server 2000?
A: Yes, you can rename a server after the installation of SQL Server
2000. When the SQL Server service starts for the first time after the
name change, it automatically recognizes the change and resets the
computer name. You do not need to run setup again to reset this value.
However, you must perform several additional configuration steps. To
correct the sysservers system table, you should manually run the
following procedures.
For a default instance: sp_dropserver <old_servername>
go
sp_addserver <new_servername> , local
go
<< end quote >>
You can also see the following KB article:
http://support.microsoft.com/kb/303774
Razvan

How to change server name in SQL2K ?

For some reason I had to change server name. I also created new
registration in Enterprise Manager.
When I try to retreive data, it still looking for my old server name.
Where else should I change the server name . ?
ThanksHere is a quote from KB article 257716:
<< start quote >>
Q. Can I rename a server after installing SQL Server 2000?
A: Yes, you can rename a server after the installation of SQL Server
2000. When the SQL Server service starts for the first time after the
name change, it automatically recognizes the change and resets the
computer name. You do not need to run setup again to reset this value.
However, you must perform several additional configuration steps. To
correct the sysservers system table, you should manually run the
following procedures.
For a default instance: sp_dropserver <old_servername>
go
sp_addserver <new_servername> , local
go
<< end quote >>
You can also see the following KB article:
http://support.microsoft.com/kb/303774
Razvan

How to Change Precision and Scale in MS SQL Server 2000

Hello,

My table was created by importing from an Excel spreadsheet. Typical fields in the rows are a date and various stock values like Open, High, Low, and Close. Unfortunately, many of the values have the wrong characteristics. These are my problems:

1. The date field has time in addition to the date. I don't want the
time in this field.

2. Many of the amount fields have a large precision, for example,
1.9399999999999999. I want to allow for a precision of 5 and a
scale of 2.

Can I make changes to my table at this point? I looked into Design Table but I don't see any feature allowing me to make changes 'on the fly'.

Any suggestions are welcome.

JoeHowdy,

Usually you can query a datetime column to extract just the date, so dont worry too much about that.

The column precision can be changed ( on the fly as it were ) using an alter table command ( see BOL ) that will automatically change the column precision and in the process round the values to what you want.

Cheers,

SG
( PS - theres nothing quite like a V8 Holden ute.....)|||Thank you for the reply. It occurs to me that one can end up creating a great many different queries if one is interested in comparing possible results/outputs. If DBA's want to save their queries for possible use later do they typically like to store them in a standard folder? Or should one create a special folder within the 'Databases' folder?

Thanks again. I am still new to working with Query Analyzer.

Joe|||I would also like to ask anyone if he or she could advise me as to how I can display only a date (without the time) when I do a query using Query Analyzer. I really don't want to see time displayed.

Can someone assist?

Thanks again.

Joe|||Howdy,

Well, sadly SQL doesnt handle splitting out dates from datetime fields very well.

Assuming you had a column called DATE in a table called INFO, if you want to display JUST the date, you need to extract the hour, min, seconds as characher values then reconstruct into a character format ( and later change to datetime , which by the way gives a defualt date of 01/01/1900)

Now, assuming you have a small table called INFO, with one column called DATE with one value of 2003-10-10 17:23:34

If you xxtract using time the following code -

select convert(varchar(2),datepart(hh,DATE))
+':'+convert(varchar(2),datepart(mm,DATE))
+':'+convert(varchar(2),datepart(ss,DATE))
from INFO

This gives -

17:23:34 ( but in varchar format).

Note too that single digit values WILL NOT have a '0' put in front of them unless you test for it & code for it accordingly.

Unless you get all dates into the same format - e.g. all varchar/char or all in datetime, mixing & matching will give you a headache.

Cheers,

SG.

how to change model DB

Hi,
How to change model DB, so that new created DB can use file size & location
or other options copied from model DB?
Thanks,
Jack
just clarification: change the default values of the database options for
Model DB, so any newly created databases can use new value such as DB file
location & size.
Many thanks,
"Jack" <chongh.hc@.gmail.com> wrote in message
news:eKs4i%23P2FHA.3876@.TK2MSFTNGP09.phx.gbl...
> Hi,
> How to change model DB, so that new created DB can use file size &
> location or other options copied from model DB?
> Thanks,
> Jack
>
|||Jack
You simply need to Right Click on the Model Database in SQL Server
Enterprise Manager and update the desired properties such as the Data File
and Log File sizes. To set the Default database location you need to Right
Click on the SQL Server instance in SQL Server Enterprise Manager and Select
the Database Settings Tab and set the Default Data and Log directories.
- Peter Ward
WARDY IT Solutions
"Jack" wrote:

> just clarification: change the default values of the database options for
> Model DB, so any newly created databases can use new value such as DB file
> location & size.
> Many thanks,
> "Jack" <chongh.hc@.gmail.com> wrote in message
> news:eKs4i%23P2FHA.3876@.TK2MSFTNGP09.phx.gbl...
>
>
|||Excellent!
thanks, Peter!
"P. Ward" <peter@.remove_online.wardyit.com> wrote in message
news:5039A552-9DB0-4C62-ACA1-24C85B045C2C@.microsoft.com...[vbcol=seagreen]
> Jack
> You simply need to Right Click on the Model Database in SQL Server
> Enterprise Manager and update the desired properties such as the Data File
> and Log File sizes. To set the Default database location you need to
> Right
> Click on the SQL Server instance in SQL Server Enterprise Manager and
> Select
> the Database Settings Tab and set the Default Data and Log directories.
>
> - Peter Ward
> WARDY IT Solutions
> "Jack" wrote:
sql

Friday, March 23, 2012

how to change model DB

Hi,
How to change model DB, so that new created DB can use file size & location
or other options copied from model DB?
Thanks,
Jackjust clarification: change the default values of the database options for
Model DB, so any newly created databases can use new value such as DB file
location & size.
Many thanks,
"Jack" <chongh.hc@.gmail.com> wrote in message
news:eKs4i%23P2FHA.3876@.TK2MSFTNGP09.phx.gbl...
> Hi,
> How to change model DB, so that new created DB can use file size &
> location or other options copied from model DB?
> Thanks,
> Jack
>|||Jack
You simply need to Right Click on the Model Database in SQL Server
Enterprise Manager and update the desired properties such as the Data File
and Log File sizes. To set the Default database location you need to Right
Click on the SQL Server instance in SQL Server Enterprise Manager and Select
the Database Settings Tab and set the Default Data and Log directories.
- Peter Ward
WARDY IT Solutions
"Jack" wrote:
> just clarification: change the default values of the database options for
> Model DB, so any newly created databases can use new value such as DB file
> location & size.
> Many thanks,
> "Jack" <chongh.hc@.gmail.com> wrote in message
> news:eKs4i%23P2FHA.3876@.TK2MSFTNGP09.phx.gbl...
> > Hi,
> >
> > How to change model DB, so that new created DB can use file size &
> > location or other options copied from model DB?
> >
> > Thanks,
> >
> > Jack
> >
>
>|||Excellent!
thanks, Peter!
"P. Ward" <peter@.remove_online.wardyit.com> wrote in message
news:5039A552-9DB0-4C62-ACA1-24C85B045C2C@.microsoft.com...
> Jack
> You simply need to Right Click on the Model Database in SQL Server
> Enterprise Manager and update the desired properties such as the Data File
> and Log File sizes. To set the Default database location you need to
> Right
> Click on the SQL Server instance in SQL Server Enterprise Manager and
> Select
> the Database Settings Tab and set the Default Data and Log directories.
>
> - Peter Ward
> WARDY IT Solutions
> "Jack" wrote:
>> just clarification: change the default values of the database options for
>> Model DB, so any newly created databases can use new value such as DB
>> file
>> location & size.
>> Many thanks,
>> "Jack" <chongh.hc@.gmail.com> wrote in message
>> news:eKs4i%23P2FHA.3876@.TK2MSFTNGP09.phx.gbl...
>> > Hi,
>> >
>> > How to change model DB, so that new created DB can use file size &
>> > location or other options copied from model DB?
>> >
>> > Thanks,
>> >
>> > Jack
>> >
>>

how to change model DB

Hi,
How to change model DB, so that new created DB can use file size & location
or other options copied from model DB?
Thanks,
Jackjust clarification: change the default values of the database options for
Model DB, so any newly created databases can use new value such as DB file
location & size.
Many thanks,
"Jack" <chongh.hc@.gmail.com> wrote in message
news:eKs4i%23P2FHA.3876@.TK2MSFTNGP09.phx.gbl...
> Hi,
> How to change model DB, so that new created DB can use file size &
> location or other options copied from model DB?
> Thanks,
> Jack
>|||Jack
You simply need to Right Click on the Model Database in SQL Server
Enterprise Manager and update the desired properties such as the Data File
and Log File sizes. To set the Default database location you need to Right
Click on the SQL Server instance in SQL Server Enterprise Manager and Select
the Database Settings Tab and set the Default Data and Log directories.
- Peter Ward
WARDY IT Solutions
"Jack" wrote:

> just clarification: change the default values of the database options for
> Model DB, so any newly created databases can use new value such as DB file
> location & size.
> Many thanks,
> "Jack" <chongh.hc@.gmail.com> wrote in message
> news:eKs4i%23P2FHA.3876@.TK2MSFTNGP09.phx.gbl...
>
>|||Excellent!
thanks, Peter!
"P. Ward" <peter@.remove_online.wardyit.com> wrote in message
news:5039A552-9DB0-4C62-ACA1-24C85B045C2C@.microsoft.com...[vbcol=seagreen]
> Jack
> You simply need to Right Click on the Model Database in SQL Server
> Enterprise Manager and update the desired properties such as the Data File
> and Log File sizes. To set the Default database location you need to
> Right
> Click on the SQL Server instance in SQL Server Enterprise Manager and
> Select
> the Database Settings Tab and set the Default Data and Log directories.
>
> - Peter Ward
> WARDY IT Solutions
> "Jack" wrote:
>

How to change from SQL Server Express to Database.mdf connection

Hi,

I've created a SQL Server Express Database that is used by an ASP.NET 2.0 application (developed using VWD Express).

I would like to be able to:

    Make changes to stored procedures, views and table structures while developing/testing ASP.NET application - which, ideally, needs a SQL Server Manager Studio Express connection and Upload my application and data to a database on a network - which, ideally, needs a direct Database.mdf connection.

I know that I need to change my connection string - and am able to achieve that with ease - but I'm not sure what the best way of switching between the two ways of attaching on the database side. I keep getting logon type problems etc.

Thanks very much.

Regards

Gary

Hi,

that should be normally straight forward using on of the user instances string for "attaching" the database to a instance temporarly (www.connectionstrings.com) Which error do you get while attaching ?

HTH, JEns Suessmeyer.

http://www.sqlserver2005.de

Wednesday, March 21, 2012

how to change db owner in SQL Server 2000

Hi,
we have created a new database in SQL Server 2000 and need
to change the database owner of the database to another
user.
Can someone help?
Thanks for reply.
Bodobodo
Please refer to BOL for sp_changedbowner.
> Hi,
> we have created a new database in SQL Server 2000 and need
> to change the database owner of the database to another
> user.
> Can someone help?
> Thanks for reply.
> Bodo|||Hi,
is it also possible to change dbo in the Enterprise
Manager, without having to go into SQL programming?
Thanks for reply.
Bodo
>--Original Message--
>bodo
>Please refer to BOL for sp_changedbowner.
>
>> Hi,
>> we have created a new database in SQL Server 2000 and
need
>> to change the database owner of the database to another
>> user.
>> Can someone help?
>> Thanks for reply.
>> Bodo
>
>.
>|||AFAIK, there is no GUI method to change the database owner. Howerver,
the T-SQL script to accomplish the task is fairly simple:
USE MyDatabase
EXEC sp_changedbowner 'MyDatabaseOwner'
GO
--
Hope this helps.
Dan Guzman
SQL Server MVP
--
SQL FAQ links (courtesy Neil Pike):
http://www.ntfaq.com/Articles/Index.cfm?DepartmentID=800
http://www.sqlserverfaq.com
http://www.mssqlserver.com/faq
--
"bodo" <bodobecker@.hotmail.com> wrote in message
news:00b601c36ff8$e7706060$a601280a@.phx.gbl...
> Hi,
> is it also possible to change dbo in the Enterprise
> Manager, without having to go into SQL programming?
> Thanks for reply.
> Bodo
> >--Original Message--
> >bodo
> >Please refer to BOL for sp_changedbowner.
> >
> >
> >
> >> Hi,
> >>
> >> we have created a new database in SQL Server 2000 and
> need
> >> to change the database owner of the database to another
> >> user.
> >>
> >> Can someone help?
> >>
> >> Thanks for reply.
> >>
> >> Bodo
> >
> >
> >.
> >|||Hi Dan,
sorry for asking you for help again - you know I am new to
SQL Server but I want to learn it.
Can you tell me where to find the interface where I can
type in the code you gave me?
Thanks for reply.
Bodo
>--Original Message--
>AFAIK, there is no GUI method to change the database
owner. Howerver,
>the T-SQL script to accomplish the task is fairly simple:
> USE MyDatabase
> EXEC sp_changedbowner 'MyDatabaseOwner'
> GO
>--
>Hope this helps.
>Dan Guzman
>SQL Server MVP
>--
>SQL FAQ links (courtesy Neil Pike):
>http://www.ntfaq.com/Articles/Index.cfm?DepartmentID=800
>http://www.sqlserverfaq.com
>http://www.mssqlserver.com/faq
>--
>"bodo" <bodobecker@.hotmail.com> wrote in message
>news:00b601c36ff8$e7706060$a601280a@.phx.gbl...
>> Hi,
>> is it also possible to change dbo in the Enterprise
>> Manager, without having to go into SQL programming?
>> Thanks for reply.
>> Bodo
>> >--Original Message--
>> >bodo
>> >Please refer to BOL for sp_changedbowner.
>> >
>> >
>> >
>> >> Hi,
>> >>
>> >> we have created a new database in SQL Server 2000 and
>> need
>> >> to change the database owner of the database to
another
>> >> user.
>> >>
>> >> Can someone help?
>> >>
>> >> Thanks for reply.
>> >>
>> >> Bodo
>> >
>> >
>> >.
>> >
>
>.
>

How to change db owner for SQL Server 2000 database

Our programmer has left the company and the tables and views were created with his credential as owner.
How do I change the ownership of all the tables and views using the stored procedure - sp_changedbowner?
Instead of typing the individual table and view name to change the db owner, is there a way to change the owner at once?select * from sysobjects where xtype='u'

The above command displays user tables. Get each user table name from sysobjects by using cursor or while loop pass the same as input parameter ot the sp_changedbowner

Try ....|||or from enterprise manager,right click on users and from opened users adjust ur adjustments
good luck|||

Quote:

Originally Posted by papayaya

Our programmer has left the company and the tables and views were created with his credential as owner.
How do I change the ownership of all the tables and views using the stored procedure - sp_changedbowner?
Instead of typing the individual table and view name to change the db owner, is there a way to change the owner at once?


hi dude have a look at this link http://support.microsoft.com/kb/275312|||use [currentdatabase]
go
sp_changedbowner 'yourusername', 'true'
go

This will change the owner of the current database to whatever username you want ( you could put sa in there ) and then remap any alias as well (that's the true).

// John Stone

Quote:

Originally Posted by papayaya

Our programmer has left the company and the tables and views were created with his credential as owner.
How do I change the ownership of all the tables and views using the stored procedure - sp_changedbowner?
Instead of typing the individual table and view name to change the db owner, is there a way to change the owner at once?

|||In SQL Server Management Studio 2005:
1/ Right Click on the Database node
2/Click Properties
3/Select Files
4/There would be a Owner Text Box, change the new Owner Name or browse and select the new Owner.

Shrimant Patel
&
Harith Patel

How to change data Dynamically in report services

Hi,
Please help me. I created a report and works fine but I am wondering how to change data dynamically. For example I have different data base and want to run the same report in different places I can't go and change the report each time. Any suggestion please Thanks in advance.

Not sure what you mean with different data base. Is the underlying schema always identical and just the data base server / name is different?

If yes, then various approaches for dynamic database connections in RS 2000 are
available:

* Use a custom data processing extension
http://msdn.microsoft.com/library/en-us/RSPROG/htm/rsp_prog_extend_dataproc_5c2q.asp

* Use the SOAP API by calling SetDataSourceContents:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rsprog/htm/rsp_ref_soapapi_service_lz_2ojd.asp

* Use the linked server functionality of SQL Server - but read the SQL Server documentation carefully about potential performance impacts.

* If the databases are on the same server, use a dynamic query text (i.e.
="select * from " & Parameters!DatabaseName.Value & "..table")

* If you're just toggling between two or three databases, you can publish the same report 3 times with 3 different names using 3 different data sources and write a main report that shows/hides the correct subreport based on whatever criteria you want.


In addition, native support (expression-based connection strings) is available in RS 2005: Finish the design of the datasets with a constant connection string and make sure everything works. Then, go back to the data tab and open the dataset/data source dialog and change the connection string to be an expression. Use string concatenation to plug in the parameter value. Here is an example of how the RDL would look for a parameter-based connection string:

<DataSources>
<DataSource Name="Northwind">
<ConnectionProperties>
<DataProvider>SQL</DataProvider>
<ConnectString>="data source=" &amp; Parameters!ServerName.Value
&amp; ";initial catalog=Northwind;"</ConnectString>
<IntegratedSecurity>true</IntegratedSecurity>
</ConnectionProperties>
</DataSource>
</DataSources>

<ReportParameters>
<ReportParameter Name="ServerName">
<DataType>String</DataType>
<Prompt>ServerName</Prompt>
</ReportParameter>
</ReportParameters>


You can also check this blog posting:
http://blogs.msdn.com/bwelcker/archive/2005/04/29/413343.aspx


-- Robert

|||Robert - How do I handle the design of the report if the underlying schema is not the same always . I posted a question today but I am repeating the same here

I am building a report which has 7 columns. Mon thru Sun. The header and data columns are dynamic

For ex the report looks like

Mon Tue Wed Thu Fri Sat Sun

-- - -- - --

2 2 4 2 4 5 6

0 7 6 7 9 4 2

The report header and data are dynamic. The seq of columns,data is not always the same. It could be Tue thru Mon., or Fri thru Thru...etc...

Please advice how to program this dynamic nature of the report

|||Hi Kumar
have you found any solution yet ? as i need similar functionality and wondering if you have a solution.
Thanks .|||

You should change the query so that instead of returning one column per day you "denormalize" it to return one day per row:

Day Count
-- --
Mon 2
Tue 2
Wed 4
...

In the report, you could then just group by the Day field (in a matrix), or use conditional aggregation if you choose a table layout: e.g. for the Monday column in the table you would use =Sum(iif(Fields!Day.Value = "Mon", Fields!Count.Value, 0))

-- Robert

How to change data Dynamically in report services

Hi,
Please help me. I created a report and works fine but I am wondering how to change data dynamically. For example I have different data base and want to run the same report in different places I can't go and change the report each time. Any suggestion please Thanks in advance.

Not sure what you mean with different data base. Is the underlying schema always identical and just the data base server / name is different?

If yes, then various approaches for dynamic database connections in RS 2000 are
available:

* Use a custom data processing extension
http://msdn.microsoft.com/library/en-us/RSPROG/htm/rsp_prog_extend_dataproc_5c2q.asp

* Use the SOAP API by calling SetDataSourceContents:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rsprog/htm/rsp_ref_soapapi_service_lz_2ojd.asp

* Use the linked server functionality of SQL Server - but read the SQL Server documentation carefully about potential performance impacts.

* If the databases are on the same server, use a dynamic query text (i.e.
="select * from " & Parameters!DatabaseName.Value & "..table")

* If you're just toggling between two or three databases, you can publish the same report 3 times with 3 different names using 3 different data sources and write a main report that shows/hides the correct subreport based on whatever criteria you want.


In addition, native support (expression-based connection strings) is available in RS 2005: Finish the design of the datasets with a constant connection string and make sure everything works. Then, go back to the data tab and open the dataset/data source dialog and change the connection string to be an expression. Use string concatenation to plug in the parameter value. Here is an example of how the RDL would look for a parameter-based connection string:

<DataSources>
<DataSource Name="Northwind">
<ConnectionProperties>
<DataProvider>SQL</DataProvider>
<ConnectString>="data source=" &amp; Parameters!ServerName.Value
&amp; ";initial catalog=Northwind;"</ConnectString>
<IntegratedSecurity>true</IntegratedSecurity>
</ConnectionProperties>
</DataSource>
</DataSources>

<ReportParameters>
<ReportParameter Name="ServerName">
<DataType>String</DataType>
<Prompt>ServerName</Prompt>
</ReportParameter>
</ReportParameters>


You can also check this blog posting:
http://blogs.msdn.com/bwelcker/archive/2005/04/29/413343.aspx


-- Robert

|||Robert - How do I handle the design of the report if the underlying schema is not the same always . I posted a question today but I am repeating the same here

I am building a report which has 7 columns. Mon thru Sun. The header and data columns are dynamic

For ex the report looks like

Mon Tue Wed Thu Fri Sat Sun

-- - -- - --

2 2 4 2 4 5 6

0 7 6 7 9 4 2

The report header and data are dynamic. The seq of columns,data is not always the same. It could be Tue thru Mon., or Fri thru Thru...etc...

Please advice how to program this dynamic nature of the report

|||Hi Kumar
have you found any solution yet ? as i need similar functionality and wondering if you have a solution.
Thanks .|||

You should change the query so that instead of returning one column per day you "denormalize" it to return one day per row:

Day Count
-- --
Mon 2
Tue 2
Wed 4
...

In the report, you could then just group by the Day field (in a matrix), or use conditional aggregation if you choose a table layout: e.g. for the Monday column in the table you would use =Sum(iif(Fields!Day.Value = "Mon", Fields!Count.Value, 0))

-- Robert

How to change Connectionstring in SQLCLR project?

Hi,

I have created a SQLCLR (database) using C#.. named SQLCLRtest

The Connection string is stored in SQLCLRtest.csproj file

here is code of csproj file

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<AssemblyOwner>
</AssemblyOwner>
</PropertyGroup>
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{c252feb5-a946-4202-b1d4-9916a0590387}">
<DatabaseConnection Name="Data Source=DBserver;Initial Catalog=TestDB;Integrated Security=True" Provider="{91510608-8809-4020-8897-FBA057E22D54}" ConnectionString="01000000D08C9DDF0115D1118C7A00C04FC297EB01000000A2744997FFD51E459D0421E51E830EF30000000002000000000003660000A8000000100000005B59ACF96DA2A587CBFA27595B0F245E0000000004800000A000000010000000BB1D5F562AC3FE7F56F8E57C36E0E7A4B0000000CE828F399233A389D95E2D99B2CAA64DE5F5A19EF0CBB716D195DF60EE38B58B0C07674E2F80538C02ED27200C79A71B0F6F9177E598089CDA95B8DDEEF966A958C6EDE4E72CABBC39941FEED534E3384EF3A4B4A51704726BF5D43F2C3C9BD674885B9675FECD86E54498ED9E1957FCD7DCF0CE8ED99C8529FD9234EB4E760FDD6819E3E42A7771E0A5B18452C01C13976C0DDDF1B5B87D75F0490762C6A004AD093A3DF9210F7D03371D67E4901EB51400000005557E36590040C06F796463ABFEC165D2E60750" />
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
</Project>

Problem:

I have an sp which start an external process, It is working at my local machine but does not work at remote server.

FACTS:

Local machine has SQLExpress (SQL version) while remote machine has SQL Enterprise ..

SQL service is running under the System Account at both machines..

I have enabled the Sql server Service to interact with desptop, so that it can start a process in GUI mode.

I thin there is something in connectionstring which does not allow the application to connect to server with appropriate rights.

How I can chage this setting .. is it possible to write this info manually..

Please, comments

Thanks

You should be able to change the connection string from the database tab in project properties. When you click on browse, It will allow you to choose from different existing connections or add a new reference.

Thanks,

-Vineet

|||

Muna,

Did Vineet's post solve your problem? The reply is correct to my knowledge.

Derek

Monday, March 19, 2012

how to change a report's(.rdl) Model

Hi!
I've created a report with Report Builder using a Model. I want to keep the same report, but I have to use another model (this model is almost the same as previous one, except that it has some extra tables).
I tried to change my report's model from Report Manager (Report_Name -> Properties -> Data Sources), but it didn't work.

Any suggestions?

Best regards.

One way I could change it was to open the report in Designer. On the data tab you can change the report model here. If your report was built in designer then you are all set. The problem is when your report was done in builder. Then there is no going back.

If any suggestion on a better way to do while still keeping the report as a report builder version I would love to hear it.

Thanks,

Rahul

|||

You can download the RDL file for a report builder report by looking at the properties for that report in Report Manager and clicking the Edit link. Then you can manually edit the RDL and change out the GUID for the old report model to be the GUID for the new report model. (Create a report with the new report model and then look at the RDL to see the GUID of the new report model.) Then you can click the Update link on the report properties and upload the modified RDL.

The only thing to be aware of is that if you're using a relational report model, the IDs for entities and fields are GUIDs. So if you built the new report model from scratch, the GUIDs for common entities and fields may be different.

|||

That worked great. I guess we still need to keep with our Visual Notepad stills.

Thanks,

Rahul

how to Catalog Deploy

i created catalog in my local folder to do full text search.now iam going to
deploy our application in the website.so can u let me know how we can
deploy the catalog from my local machine to web server.
Thanks and Regards,
K.Mohan
Mohan,
Actually, the steps are the same for deploying SQL Server based Full Text
Search (FTS) on your local server as it is on your server's website.
Although, you may want to use following T-SQL stored procedures vs. the FT
Indexing wizard:
use pubs
go
sp_fulltext_service 'clean_up'
go
sp_fulltext_database 'enable' -- --> NOTE: Only run this ONCE per database
!!!
go
-- To Create/Remove the Existing Full-Text Table Index, Catalog
-- If Full-Text Index exists, DROP that Index,
-- If Full-Text Index does not exist, CREATE that Index.
use pubs
go
IF OBJECTPROPERTY ( object_id('pub_info'),'TableHasActiveFulltextIndex ') = 1
BEGIN
print 'Table pub_info is Full-Text Enabled, dropping Full-Text Index &
Catalog...'
EXEC sp_fulltext_table 'pub_info', 'drop'
EXEC sp_fulltext_catalog 'PubInfo', 'drop'
END
ELSE IF OBJECTPROPERTY (
object_id('pub_info'),'TableHasActiveFulltextIndex ') = 0
BEGIN
print 'Table pub_info is NOT Full-Text Enabled, creating FT Catalog,
Index & Activating...'
EXEC sp_fulltext_catalog 'PubInfo', 'create'
EXEC sp_fulltext_table 'pub_info', 'create', 'PubInfo', 'UPKCL_pubinfo'
EXEC sp_fulltext_column 'pub_info', 'pub_id', 'add'
EXEC sp_fulltext_column 'pub_info', 'pr_info', 'add'
EXEC sp_fulltext_table 'pub_info', 'activate'
END
For more details, see Full Text Indexing using T-SQL from a Profiler Trace
http://spaces.msn.com/members/jtkane/Blog/cns!1pWDBCiDX1uvH5ATJmNCVLPQ!304.entry
Hope that helps!
John
SQL Full Text Search Blog
http://spaces.msn.com/members/jtkane/
"Mohan" <mohananu@.yahoo.com> wrote in message
news:%23CW$edRuFHA.1264@.TK2MSFTNGP12.phx.gbl...
>i created catalog in my local folder to do full text search.now iam going
>to deploy our application in the website.so can u let me know how we can
>deploy the catalog from my local machine to web server.
> Thanks and Regards,
> K.Mohan
>
|||You may be able to copy a built catalog to the web server. Have a look at
this kb article.
http://support.microsoft.com/default...b;en-us;240867
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Mohan" <mohananu@.yahoo.com> wrote in message
news:%23CW$edRuFHA.1264@.TK2MSFTNGP12.phx.gbl...
> i created catalog in my local folder to do full text search.now iam going
to
> deploy our application in the website.so can u let me know how we can
> deploy the catalog from my local machine to web server.
> Thanks and Regards,
> K.Mohan
>