Showing posts with label user. Show all posts
Showing posts with label user. Show all posts

Monday, March 26, 2012

how to change query that runs report programmatically

I have a report that will display certain records based on the user that logs in. I need to be able to change the query the report uses programmatically. I havent had any luck trying to find how to do this online. If anyone can help me that would be great.
--
Posted using Wimdows.net NntpNews Component -
Post Made from http://www.SqlJunkies.com/newsgroups Our newsgroup engine supports Post Alerts, Ratings, and Searching.Please look into BOL for "Using Dynamic Queries"
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"SqlJunkies User" <User@.-NOSPAM-SqlJunkies.com> wrote in message
news:OtGrybSkEHA.2668@.TK2MSFTNGP10.phx.gbl...
>I have a report that will display certain records based on the user that
>logs in. I need to be able to change the query the report uses
>programmatically. I havent had any luck trying to find how to do this
>online. If anyone can help me that would be great.
>
> --
> Posted using Wimdows.net NntpNews Component -
> Post Made from http://www.SqlJunkies.com/newsgroups Our newsgroup engine
> supports Post Alerts, Ratings, and Searching.

how to change permission via t-sql

Hello,
I have a database that has about 50 tables. I have a user group assigned
to the database. I want them to be able to insert/update but not delete. The
only way I have seen is to go into the table permissions and change the
permissions. Is there an easier way via t-sql? Thanks in advance.
JakeRun this, verify that the output will do what you want and then execute the
output:
SELECT 'GRANT INSERT, UPDATE ON ' + TABLE_NAME + ' TO YourUserGroup' FROM
INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'base table'
--
Keith
"Jake" <rondican@.hotmail.com> wrote in message
news:uyD6ueAoEHA.1456@.TK2MSFTNGP10.phx.gbl...
> Hello,
> I have a database that has about 50 tables. I have a user group
assigned
> to the database. I want them to be able to insert/update but not delete.
The
> only way I have seen is to go into the table permissions and change the
> permissions. Is there an easier way via t-sql? Thanks in advance.
> Jake
>|||Keith,
Thanks very much for the info
"Keith Kratochvil" <sqlguy.back2u@.comcast.net> wrote in message
news:efMdMqAoEHA.2588@.TK2MSFTNGP12.phx.gbl...
> Run this, verify that the output will do what you want and then execute
the
> output:
> SELECT 'GRANT INSERT, UPDATE ON ' + TABLE_NAME + ' TO YourUserGroup' FROM
> INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'base table'
> --
> Keith
>
> "Jake" <rondican@.hotmail.com> wrote in message
> news:uyD6ueAoEHA.1456@.TK2MSFTNGP10.phx.gbl...
> > Hello,
> >
> > I have a database that has about 50 tables. I have a user group
> assigned
> > to the database. I want them to be able to insert/update but not delete.
> The
> > only way I have seen is to go into the table permissions and change the
> > permissions. Is there an easier way via t-sql? Thanks in advance.
> >
> > Jake
> >
> >
>

how to change permission via t-sql

Hello,
I have a database that has about 50 tables. I have a user group assigned
to the database. I want them to be able to insert/update but not delete. The
only way I have seen is to go into the table permissions and change the
permissions. Is there an easier way via t-sql? Thanks in advance.
Jake
Run this, verify that the output will do what you want and then execute the
output:
SELECT 'GRANT INSERT, UPDATE ON ' + TABLE_NAME + ' TO YourUserGroup' FROM
INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'base table'
Keith
"Jake" <rondican@.hotmail.com> wrote in message
news:uyD6ueAoEHA.1456@.TK2MSFTNGP10.phx.gbl...
> Hello,
> I have a database that has about 50 tables. I have a user group
assigned
> to the database. I want them to be able to insert/update but not delete.
The
> only way I have seen is to go into the table permissions and change the
> permissions. Is there an easier way via t-sql? Thanks in advance.
> Jake
>
|||Keith,
Thanks very much for the info
"Keith Kratochvil" <sqlguy.back2u@.comcast.net> wrote in message
news:efMdMqAoEHA.2588@.TK2MSFTNGP12.phx.gbl...
> Run this, verify that the output will do what you want and then execute
the
> output:
> SELECT 'GRANT INSERT, UPDATE ON ' + TABLE_NAME + ' TO YourUserGroup' FROM
> INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'base table'
> --
> Keith
>
> "Jake" <rondican@.hotmail.com> wrote in message
> news:uyD6ueAoEHA.1456@.TK2MSFTNGP10.phx.gbl...
> assigned
> The
>
sql

How to change or make new user on a SQL server 2000

How to change or make new user on a SQL server 2000Lookup sp_adduser in BOL.
--
Ray Higdon MCSE, MCDBA, CCNA
--
"Fernand" <fernand_77@.hotmail.com> wrote in message
news:3f7d3c32$0$58702$e4fe514c@.news.xs4all.nl...
>|||Actually for SQL 2k you should be using
sp_grantlogin to add a new login and
sp_grantdbaccess to add a new user... Both of these can be done easily in
SQL Enterprise Manager as well.
"Fernand" <fernand_77@.hotmail.com> wrote in message
news:3f7d3c32$0$58702$e4fe514c@.news.xs4all.nl...
>|||Wayne's right, BOL states sp_adduser is there for
backwards compatability...sorry about that.
Ray Higdon MCSE, MCDBA, CCNA
>--Original Message--
>Actually for SQL 2k you should be using
>sp_grantlogin to add a new login and
>sp_grantdbaccess to add a new user... Both of these can
be done easily in
>SQL Enterprise Manager as well.
>"Fernand" <fernand_77@.hotmail.com> wrote in message
>news:3f7d3c32$0$58702$e4fe514c@.news.xs4all.nl...
>>
>
>.
>|||I am new in SQL.
Where i find the SQL Enterprise Manager.
"Wayne Snyder" <wsnyder@.computeredservices.com> schreef in bericht
news:%23yPrkiaiDHA.3832@.tk2msftngp13.phx.gbl...
> Actually for SQL 2k you should be using
> sp_grantlogin to add a new login and
> sp_grantdbaccess to add a new user... Both of these can be done easily in
> SQL Enterprise Manager as well.
> "Fernand" <fernand_77@.hotmail.com> wrote in message
> news:3f7d3c32$0$58702$e4fe514c@.news.xs4all.nl...
> >
> >
>

How to change or alter a user defined data type?

Hi all,
I already read this: http://vyaskn.tripod.com/administration_faq.htm#q12
and it's ok for the table/columns but I can NOT drop my user defined data
type using sp_droptype because it's already used in some Stored procs :(
Is there a solution WITHOUT a "delete & re-create" of these stored procs ?
Lilian.This example should demonstrate how to swap out the type. Note that the
rename affects tables, but not stored procs (so you won't have to recompile
your procedures, just hope they don't get called during the brief period
where the type doesn't exist).
-- originally, we create a datatype called fax,
-- and made it able to accept 32 characters
EXEC sp_addType 'fax', 'VARCHAR(32)'
GO
-- so we created a table that uses this datatype
CREATE TABLE dbo.foobar0
(
[fax] fax
)
GO
-- and a simple stored procedure as well
CREATE PROC dbo.foobar1
@.fax fax
AS
BEGIN
DECLARE @.fax2 fax
END
GO
-- now, we realize that fax numbers on
-- jupiter can contain 64 characters, so we
-- have to increase the size of the UDT
-- but we can't just alter the type, and we
-- can't drop it and re-create it either, without
-- altering or dropping / re-creating tables,
-- stored procedures, etc. that use the UDT
-- but we can use a little rename trick to
-- create an interim UDT that meets our needs
-- first, rename the existing UDT. This will
-- change table definitions but it will not alter
-- the text for a procedure / function
EXEC sp_rename 'fax', 'oldfax', 'USERDATATYPE'
GO
-- let's just make sure that it affected our table
-- but not our procedure:
EXEC sp_help foobar0
EXEC sp_helptext foobar1
GO
-- okay, now let's add the larger fax UDT back
-- into the system
EXEC sp_addtype 'fax', 'VARCHAR(64)'
GO
-- alter any tables / views that reference the old
-- fax UDT
ALTER TABLE foobar0 ALTER COLUMN [fax] fax
GO
-- now we should be able to drop the interim
-- UDT:
EXEC sp_droptype 'oldfax'
GO
-- (now let's clean up my silly example)
DROP TABLE dbo.foobar0
DROP PROCEDURE dbo.foobar1
EXEC sp_droptype 'fax'
GO
"Lilian Pigallio" <lpigallio@.nospam.com> wrote in message
news:#pSUDo9PDHA.2036@.TK2MSFTNGP10.phx.gbl...
> Hi all,
> I already read this: http://vyaskn.tripod.com/administration_faq.htm#q12
> and it's ok for the table/columns but I can NOT drop my user defined data
> type using sp_droptype because it's already used in some Stored procs :(
> Is there a solution WITHOUT a "delete & re-create" of these stored procs
?
> Lilian.
>|||Sorry, you will have to recompile stored procedures that use the datatype as
in/out parameters, but not those that only use the type for local
variables...|||Very interesting...but do you "recompile" a stored proc by script ?
"Aaron Bertrand - MVP" <aaron@.TRASHaspfaq.com> wrote in message
news:elXMq29PDHA.2676@.TK2MSFTNGP10.phx.gbl...
> Sorry, you will have to recompile stored procedures that use the datatype
as
> in/out parameters, but not those that only use the type for local
> variables...
>

How to change name of filter in Report Builder

Hi

Im creating a filter in Report Builder with a start date and an end date. That is I want the user to able to choose a dateinterval. How do I change the label shown in the report for the interval. I want it to say Startdate and Enddate not what I have in my Sql server

Thanks

/Stefan

This is not supported directly. However, you can create a custom field in your report that simply references the field you want to filter on, name the custom field whatever you want, and then filter on that. The name of the report parameter will be the name of the custom field.|||Would be nice if it did this for you when you rename a parameter in the editor, cant see the reason for this function otherwise?

How to change name of filter in Report Builder

Hi

Im creating a filter in Report Builder with a start date and an end date. That is I want the user to able to choose a dateinterval. How do I change the label shown in the report for the interval. I want it to say Startdate and Enddate not what I have in my Sql server

Thanks

/Stefan

This is not supported directly. However, you can create a custom field in your report that simply references the field you want to filter on, name the custom field whatever you want, and then filter on that. The name of the report parameter will be the name of the custom field.|||Would be nice if it did this for you when you rename a parameter in the editor, cant see the reason for this function otherwise?

Friday, March 23, 2012

how to change licensing modes

I installed SQL 2K on a per user basis and now want to change that to a per
processor licensing mode. Cant seem to do that change from Control Panel and
do now wish to reinstall .. Is there a way ?http://www.tkdinesh.com/faq/ans/license.html
"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:#szsZX#pDHA.1496@.TK2MSFTNGP11.phx.gbl...
> I installed SQL 2K on a per user basis and now want to change that to a
per
> processor licensing mode. Cant seem to do that change from Control Panel
and
> do now wish to reinstall .. Is there a way ?
>

Wednesday, March 21, 2012

how to change default 'dbo' login info

Hi all,
sql server 2000.
I took over a database which has the system default
user: 'dbo' login as one of the consultants' name who left
the company already.
How can I change the login back to normal which should be
under 'sa'?
I tried to delete it and recreate 'dbo' for this database,
the system won't let me. I try to modify anything
on 'dbo', the system won't let me.
Help...
JJHi,
Does that user owns any object, if yes use the sp_changeobjectowner
procedure to change the owner to dbo. After that
use sp_changedbowner procedure to change the dbo to sa.
Thanks
Hari
MCDBA
"JJ Wang" <anonymous@.discussions.microsoft.com> wrote in message
news:103901c3dfc1$e3c226e0$a101280a@.phx.gbl...
> Hi all,
> sql server 2000.
> I took over a database which has the system default
> user: 'dbo' login as one of the consultants' name who left
> the company already.
> How can I change the login back to normal which should be
> under 'sa'?
> I tried to delete it and recreate 'dbo' for this database,
> the system won't let me. I try to modify anything
> on 'dbo', the system won't let me.
> Help...
> JJ|||JJ
dbo is a user name, not a login name. Every db must have that user, so you
can't delete it. It is mapped to a LOGIN name in the master database and you
can change the mapping quite easily using the stored procedure
sp_changedbowner. There is no need to do anything with objects owned by
'dbo' user. Objects now owned by the user dbo will still be owned by dbo
after you change its mapping to point to the 'sa' login.
--
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"JJ Wang" <anonymous@.discussions.microsoft.com> wrote in message
news:103901c3dfc1$e3c226e0$a101280a@.phx.gbl...
> Hi all,
> sql server 2000.
> I took over a database which has the system default
> user: 'dbo' login as one of the consultants' name who left
> the company already.
> How can I change the login back to normal which should be
> under 'sa'?
> I tried to delete it and recreate 'dbo' for this database,
> the system won't let me. I try to modify anything
> on 'dbo', the system won't let me.
> Help...
> JJ

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 collation on MODEL ?

I have a 2005 SP1 server with the wrong server collation.
All user databases on this server have the right collation.
I am getting collation conflict errors when I use temp tables.
I believe this is because tempdb is created based on "model", and model has
the server collation.
I have tried to change the "model" collation using ALTER DATABASE, but I get
the error message "Cannot alter the database 'model' because it is a system
database.
"
How can I force tempdb to have a specific collation, instead of the same
collation as the server collation?> How can I force tempdb to have a specific collation, instead of the same
> collation as the server collation?
You have to rebuild the system databases, as you cannot have different collations across the system
databases. This is done using the SETUP program in 2005. This is described in
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/instsql9/html/df40c888-691c-4962-a420-78a57852364d.htm.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Pat" <pat@.online.nospam> wrote in message
news:B4BB3864-D003-426A-9860-CC2FC80D0E06@.microsoft.com...
>I have a 2005 SP1 server with the wrong server collation.
> All user databases on this server have the right collation.
> I am getting collation conflict errors when I use temp tables.
> I believe this is because tempdb is created based on "model", and model has
> the server collation.
> I have tried to change the "model" collation using ALTER DATABASE, but I get
> the error message "Cannot alter the database 'model' because it is a system
> database.
> "
> How can I force tempdb to have a specific collation, instead of the same
> collation as the server collation?|||Hi Pat,
Thank you for your posting!
I agreed with Tibor. You need to rebuild the system database.
Also, here is an article for your reference.
325335 How to transfer a database from one collation to another collation
in SQL Server
http://support.microsoft.com/default.aspx?scid=kb;EN-US;325335
Hope this will be helpful!
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================This posting is provided "AS IS" with no warranties, and confers no rights.|||The doc mentions that all service packs and hotfixes are lost when rebuilding
the system databases, and need to be re-applied.
We have SP1 and several hotfixes, this sounds like a lot of work for just
changing the collation.
"Tibor Karaszi" wrote:
> > How can I force tempdb to have a specific collation, instead of the same
> > collation as the server collation?
> You have to rebuild the system databases, as you cannot have different collations across the system
> databases. This is done using the SETUP program in 2005. This is described in
> ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/instsql9/html/df40c888-691c-4962-a420-78a57852364d.htm.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Pat" <pat@.online.nospam> wrote in message
> news:B4BB3864-D003-426A-9860-CC2FC80D0E06@.microsoft.com...
> >I have a 2005 SP1 server with the wrong server collation.
> > All user databases on this server have the right collation.
> >
> > I am getting collation conflict errors when I use temp tables.
> > I believe this is because tempdb is created based on "model", and model has
> > the server collation.
> >
> > I have tried to change the "model" collation using ALTER DATABASE, but I get
> > the error message "Cannot alter the database 'model' because it is a system
> > database.
> > "
> >
> > How can I force tempdb to have a specific collation, instead of the same
> > collation as the server collation?
>|||> We have SP1 and several hotfixes, this sounds like a lot of work for just
> changing the collation.
Yep, that is why I always advocate to be very careful when selecting the collation during
installation.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Pat" <pat@.online.nospam> wrote in message
news:DFA53097-0EB5-4125-A9EC-E0EF157212D9@.microsoft.com...
> The doc mentions that all service packs and hotfixes are lost when rebuilding
> the system databases, and need to be re-applied.
> We have SP1 and several hotfixes, this sounds like a lot of work for just
> changing the collation.
> "Tibor Karaszi" wrote:
>> > How can I force tempdb to have a specific collation, instead of the same
>> > collation as the server collation?
>> You have to rebuild the system databases, as you cannot have different collations across the
>> system
>> databases. This is done using the SETUP program in 2005. This is described in
>> ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/instsql9/html/df40c888-691c-4962-a420-78a57852364d.htm.
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://www.solidqualitylearning.com/
>>
>> "Pat" <pat@.online.nospam> wrote in message
>> news:B4BB3864-D003-426A-9860-CC2FC80D0E06@.microsoft.com...
>> >I have a 2005 SP1 server with the wrong server collation.
>> > All user databases on this server have the right collation.
>> >
>> > I am getting collation conflict errors when I use temp tables.
>> > I believe this is because tempdb is created based on "model", and model has
>> > the server collation.
>> >
>> > I have tried to change the "model" collation using ALTER DATABASE, but I get
>> > the error message "Cannot alter the database 'model' because it is a system
>> > database.
>> > "
>> >
>> > How can I force tempdb to have a specific collation, instead of the same
>> > collation as the server collation?
>>|||"Pat" wrote:
> I have a 2005 SP1 server with the wrong server collation.
> All user databases on this server have the right collation.
> I am getting collation conflict errors when I use temp tables.
> I believe this is because tempdb is created based on "model", and model has
> the server collation.
> I have tried to change the "model" collation using ALTER DATABASE, but I get
> the error message "Cannot alter the database 'model' because it is a system
> database.
> "
> How can I force tempdb to have a specific collation, instead of the same
> collation as the server collation?
In addition to the other replies to your query, there may be another way to
do this.
If you create a new temporary table in a stored procedure, use the good
collation.
example:
Create Table #Status
(
State nvarchar(128) collate database_default
)
This might be a good solution if there are not too many places where
temporary tables are created.
hope this helps.
kind regards,
Bart.sql

Monday, March 19, 2012

how to change "Default language for user" for Instance name? (with regedit or other method

Hi all,
how to change "Default language for user" for Instance name? (with regedit
or other method?)
I want to change other language for my default language for user option
programaticly (in setup program)
ThanxAt the instance level you use sp_configure 'default language' specifying the
langid you want (this value can be obtained from the syslanguages table in
master)
--
HTH,
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
"Asking" <asking@.ispro.net.tr> wrote in message
news:OybHe5moGHA.3808@.TK2MSFTNGP03.phx.gbl...
> Hi all,
> how to change "Default language for user" for Instance name? (with regedit
> or other method?)
> I want to change other language for my default language for user option
> programaticly (in setup program)
>
> Thanx
>|||Thank you very much
"Asking" <asking@.ispro.net.tr> wrote in message
news:OybHe5moGHA.3808@.TK2MSFTNGP03.phx.gbl...
> Hi all,
> how to change "Default language for user" for Instance name? (with regedit
> or other method?)
> I want to change other language for my default language for user option
> programaticly (in setup program)
>
> Thanx
>

Monday, March 12, 2012

How to cancel report?

Hi,
I have an application with RS reports. When user runs a report, I want to
have a button Cancel Report. I can find the jobID for this report and cancel
it, but cursor on IE is still an hourglass and green circle with the text
"Report is being generated" are still in the center of the browser. Is there
any way to let RS know that it should stop to do everything for this session
because current job is already cancelled?
Maybe I even can get some feedback from RS that it is cancelled and I can
suppress my Cancel button?
Any suggestions?
Thanks.
Victor
P.S. If Microsoft guys will read this: Are we going to have in the future
Cancel button?
Thanks.Anybody... Anything...
"Victor" wrote:
> Hi,
> I have an application with RS reports. When user runs a report, I want to
> have a button Cancel Report. I can find the jobID for this report and cancel
> it, but cursor on IE is still an hourglass and green circle with the text
> "Report is being generated" are still in the center of the browser. Is there
> any way to let RS know that it should stop to do everything for this session
> because current job is already cancelled?
> Maybe I even can get some feedback from RS that it is cancelled and I can
> suppress my Cancel button?
> Any suggestions?
> Thanks.
> Victor
> P.S. If Microsoft guys will read this: Are we going to have in the future
> Cancel button?
> Thanks.
>

How to call talbe/SP from Linked server with out database and user

Dear Friends,
Usually we call tabal and SP like given below.
select * from [linkedserver].[database].[dbo].[TableName]
EXEC [linkedserver].[database].[dbo].usp_storedprocedure
but I like to all with out database and username.
I tryed like below
select * from [linkedserver]...[TableName]
OR
select * from [linkedserver]..[user].[TableName]
It's gives error
Server: Msg 7313, Level 16, State 1, Line 1
Invalid schema or catalog specified for provider 'MSDASQL'.
OLE DB error trace [Non-interface error: Invalid schema or catalog
specified for the provider.].
Please help me to achive this.
Thasks and regards,
Rajesh
On Wed, 14 Sep 2005 07:57:08 -0700, Rajesha wrote:

>Dear Friends,
>Usually we call tabal and SP like given below.
> select * from [linkedserver].[database].[dbo].[TableName]
> EXEC [linkedserver].[database].[dbo].usp_storedprocedure
>but I like to all with out database and username.
>I tryed like below
>select * from [linkedserver]...[TableName]
>OR
>select * from [linkedserver]..[user].[TableName]
>It's gives error
>Server: Msg 7313, Level 16, State 1, Line 1
>Invalid schema or catalog specified for provider 'MSDASQL'.
>OLE DB error trace [Non-interface error: Invalid schema or catalog
>specified for the provider.].
>Please help me to achive this.
>Thasks and regards,
>Rajesh
Hi Rajesh,
You can't leave out the databasename. A linked server might hold more
than one database, so you have to specify that part.
I believe that you can leave out the owner, but I'm not sure, and I
can't test that right now. However, it is recommended that you always
include the owner. This helps SQL Server find the object more quickly,
and it helps reduce the number of recompiles.
Best, Hugo
(Remove _NO_ and _SPAM_ to get my e-mail address)

Friday, March 9, 2012

How to call Reporting Service

I am not sure how to do it. Please help.
I am trying to call a report I did in REporting Service 2005. I have a web
form where user will go and make selection parameter liek Employee name,
start and End Date.
How I can pass this parameter from my web Form to Reporting Service
Thanks
TanweerSimplist thing to do is to start with URL integration. If you have VS 2005
there is a reportviewer webform control (and a winform control) that is very
good and I highly recommend using it. I am using the Winform version of the
control. Search on URL in Books OnLine.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Tanweer" <Tanweer@.discussions.microsoft.com> wrote in message
news:E58A9D53-7BF6-4E13-B60D-113EB0D2DFEA@.microsoft.com...
>I am not sure how to do it. Please help.
> I am trying to call a report I did in REporting Service 2005. I have a web
> form where user will go and make selection parameter liek Employee name,
> start and End Date.
> How I can pass this parameter from my web Form to Reporting Service
> Thanks
> Tanweer

How to call just once for multiple report....

Hi all,
I will have to make it possible for one administrator to see one hundred
user's report in just one time.
What I have done is that I just embedded the module which was passing the
parameter to sql reporting server in C# programming code by using looping
statement .
However,if it is the only way, consequently I will have to call sproc as
many as user's count. What it means the performance will be very poor.
I am really curious to hear that. Please could you give me any comment on it?Have another report, fetch for all users and group by user.

Friday, February 24, 2012

How to build this query

Hi,
Please Help me to build this query.

I have got a "User" Table
-------
UserID UserName
-------

1 Tuffy

Another Table "Groups" Table
-------
GroupID GroupName
-------
1 Manager
2 Employee
3 Sales

I have got a "UserGroup" Table HOLDING ID'S as Foreign key.
The data in the TABLE is like this

-------
UserID GroupID
-------
1 1(Manager from "Group" Table
1 2(Employee)
1 3(Sales)
2 2(Employee)
2 3(Sales)
-------

Now when a user logged in The Groups have to be returned as a string that contains pipe separated Group names
for example "Manager|Employee|Sales|"

So if User 1 log in I need something like that
UserID (1)-->"Manager|Employee|Sales|"

Please help me how to write this query.

RegardsTo do this you can do it as -

declare @.roles varchar(100)

SET @.roles = ''

SELECT @.roles = @.roles + '|' + GroupName
FROM UserGroup JOIN GROUPS ON UserGroup.GroupID = Groups.GroupID
Where UserID = @.userID --PAssed userID to the stored procedure

SET @.roles = @.roles + '|'

SELECT @.roles|||...although this will give you a starting and ending pipe.

You might also try:


declare @.roles varchar(200)

SELECT @.roles = COALESCE('|'+G.Groupname, G.GroupName)
FROM UserGroup UG
INNER JOIN GROUPS G ON UG.GroupID = G.GroupID
WHERE UG.UserID = @.userID

SELECT @.Roles


...or simply create @.roles as an output parameter and you won't need to perform that final SELECT.|||Thanks a lot guys. I really appreciate this.
Is there any way of getting the UserID AS WELL

The select query should return

UserID, Groups(Pipe seperated)

The Example I mentioned above, according to that example, the return should be

UserID, Groups
---------
1, Manager|Employee|Sales|
----------------

Many, Many Thanks and Regards|||pjmcb -

How are you going to get one row with all the groupnames with your SQL? I tried it and it just gets the first record.

Am I missing something here?

Thanks,

AP|||No, it was I who was missing something.

Try:


declare @.roles varchar(200)

SELECT @.roles = COALESCE(@.roles+'|'+G.Groupname, G.GroupName)
FROM UserGroup UG
INNER JOIN GROUPS G ON UG.GroupID = G.GroupID
WHERE UG.UserID = @.userID

SELECT @.Roles


With the big difference being in the COALESCE parameter:
COALESCE(@.roles+'|'+G.Groupname, G.GroupName)
instead of
COALESCE('|'+G.Groupname, G.GroupName).

Sorry. My mistake, Was typing quickly. I still haven't tested it yet, but this should work for you...

Sunday, February 19, 2012

How to build application

Dear Sir/ Madam,

I used to use the clients/server application in two tier, but now i thinks the two tier of application is cannot support for the user as well.

That's why we try to build the three tier system in SQL Server. In our first time, we cannot build it at all and we don't know how to do it.

Is it SQL Server support three tier system?

If SQL Server can support, How can we build it?

I hope you will reply me soon.

Ratana Ky
Cambodia.

Tongue TiedRatana,

Take a look at this web site and spend some time witching the following webcasts. The presenter shows how easy it become to create n-tier applications. He also gives you a link to source code.

http://www.microsoft.com/events/series/teched2005.mspx

MSDN Webcast: ASP.NET 2.0: Overview of ASP.NET 2.0 (Part 1 of 2) (Level 300)

MSDN Webcast: ASP.NET 2.0: Overview of ASP.NET 2.0 (Part 2 of 2) (Level 300)


HTH
-w|||This question is pretty generic, like how to build a car. The answer is yes. You can do a web search for terms "three tier architecture sql server" to find articles on the subject.

How to build an expression for a textbox?

Can I build an expression on a textbox with a "Sql Select" statement based
on the dataset? There is a parameter user selected on the dropdown and it
generates a dataset from the store procedure. This parameter is used on a
subquery for this dataset in the store procedure and it will return with the
records containing other parameter IDs. However I need to assign a record on
a textbox and require to filter out the record with the same parameterID
user selected in the dropdown. Thanks.
Eg. Parameters!Person.Value=2 selected in the dropdown
Recordset: SearchName
PersonID LName FName
1 Doe John
2 Doe Peter
3 Doe Jane
I need to assign the the name Doe, Peter on a textbox.If I understand correctly, you just want to use the data from the result set
that is returned from the data set.
If you go to the text box where you want to add the expression, right-click
that box, and click on the 'Expression' option.
In the Expression builder you can click the expansion (+) button next to
Fields, then select the Last Name, and click the insert button. Then in the
expression box, type a string that would add a comma, then finish by adding
the first name field to the expression box.
The result in the Expression box would look something like:
=Fields!LName.Value + ", " + Fields!FName.Value
Give that a try and see what happens.
"Paul" wrote:
> Can I build an expression on a textbox with a "Sql Select" statement based
> on the dataset? There is a parameter user selected on the dropdown and it
> generates a dataset from the store procedure. This parameter is used on a
> subquery for this dataset in the store procedure and it will return with the
> records containing other parameter IDs. However I need to assign a record on
> a textbox and require to filter out the record with the same parameterID
> user selected in the dropdown. Thanks.
> Eg. Parameters!Person.Value=2 selected in the dropdown
> Recordset: SearchName
> PersonID LName FName
> 1 Doe John
> 2 Doe Peter
> 3 Doe Jane
> I need to assign the the name Doe, Peter on a textbox.
>
>

How to browse the history login detail of sqlserver?

Hi all,
I want to ask how to browse the history login detail of
sqlserver.eg:login user name , client ip and login time
thx.Hi
SQL server does not store it, unless you log it specifically though code
into a table.
If you have full auditing on, you can see the date and time of a specific
login (success or failure).
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/
"zlf" <zlfcn@.hotmail.com> wrote in message
news:Oj$X$xOLFHA.1916@.TK2MSFTNGP12.phx.gbl...
> Hi all,
> I want to ask how to browse the history login detail of
> sqlserver.eg:login user name , client ip and login time
> thx.
>|||Thank you for your help
"Mike Epprecht (SQL MVP)" <mike@.epprecht.net> ะด?:uGD9k3OLFHA.1176@.TK2MSFTNGP12.phx
.gbl...
> Hi
> SQL server does not store it, unless you log it specifically though code
> into a table.
> If you have full auditing on, you can see the date and time of a specific
> login (success or failure).
> 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/
> "zlf" <zlfcn@.hotmail.com> wrote in message
> news:Oj$X$xOLFHA.1916@.TK2MSFTNGP12.phx.gbl...
>