Showing posts with label via. Show all posts
Showing posts with label via. Show all posts

Monday, March 26, 2012

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

Monday, March 12, 2012

How to capture Error Messages in script

I know how to capture the error number using @.@.ERROR, but I don't know how
to capture the actual text. It is easy to do so via an application that uses
a database driver (BDE, ADO .NET etc...), but I just want to capture the
error text in SQL script and log it to a table.
Please Note:
'select description from master.dbo.sysmessages' alone is not sufficientThe current version of SQL Server does not provide a method to get error
message text in Transact-SQL. This functionality is planned for SQL 2005,
though.
Hope this helps.
Dan Guzman
SQL Server MVP
"GMG" <nospam@.nospam.com> wrote in message
news:eRXqGcYjFHA.3448@.TK2MSFTNGP10.phx.gbl...
>I know how to capture the error number using @.@.ERROR, but I don't know how
> to capture the actual text. It is easy to do so via an application that
> uses
> a database driver (BDE, ADO .NET etc...), but I just want to capture the
> error text in SQL script and log it to a table.
> Please Note:
> 'select description from master.dbo.sysmessages' alone is not sufficient
>

Friday, March 9, 2012

How to call report via url in RSReportHost.exe

I am calling my reports via URL, but it presents the report in IE with the url so the users might change the parameters value in IE addressbar. but i see RSReportHost.exe does'nt show the url at all.

Is it possible to show or call a report via URL using RSReportHost.exe

I am using VS 2003 with SQL RS 2005, i don't have a reportviewer control available to use.

Please help guys.

Thank you fery much.

RSReportHost is a desktop application designed for debugging reports. So, the short answer to your question is no. Moreover, URL access is not a very secure way to request reports. The Report ViewerASP.NET control does a reasonable job to hide the parameter values during reposts but it is not foolproof as well. Regardless of the fact that you don’t use the ASP.NET Report, RS 2005 URL addressability uses it behind the scenes by redirecting the user to the ReportViewer.aspx page. So, one way to mitigate the security risk with parameters is to request the report without parameters and rely on the Report Viewer to handle them. Stricter security requirements may require the web application to handle the parameters on the server side.

|||

Thank you very much Teo.

But VS 2003 does'nt have a reportviewer to use with RS 2005.

Microsoft only released the viewer with vs 2005.

I have a very big project fully developed using vs 2003 and lot of state and federal construction projects are using the tool. and also we have integrated third party controls which specifically uses framework 1.1. i don't have an open option to switch to vs 2005 soon might have to wait until all the migration related issues gets cleared.

my current options are to use render webservices to load reports via pdf streams. which i am using. are there any other methods available using vs 2003 and sql rs 2005 please help.

Thank you once again. i read about you on google a lot.

|||

Just to clarify, I was referring to the server ReportViewer.aspx page which the user is automatically redirected to with URL addressability. So, if the user clicks on a URL link which points to a report (e.g. http://localhost/reportserver?%2fAdventureWorks+Sample+Reports%2fCompany+Sales&rs:Command=Render) , the server will redirect her to that page which uses the ReportViewer ASP.NET Report Viewer control behind the scenes. Therefore, you don’t have to upgrade to VS.NET 2005 at all.

|||

Thks Teo, But the problem with URL is the users can manipulate the url parameters by themselves in the IE address bar. I don't want the users manipulate the url's.

|||

True. You have different options to address this depending on the security risk.

1. If you think that hacking the report URL goes beyond the skills of your users, you may be fine with the ReportViewer parameter hiding.

2. You can use the user identity (User!UserID) to filter the parameter available values and/or report data (row-level security).

3. You can configure the Report Server to be accessable from your application server only and not directly from the end users.

4. You can use a trusted account between your application server and Report Server. All report requests will go under this account and you will secure the report catalog accordingly. These security policies will prevent the end users from requesting reports directly.

How to call functions via ODBC

Hello.

How can I call some functions on MSDE when working in Access (.mdb) that is
connected to MSDE via ODBC linked tables ? Especially
in-line functions, that I would like to use as recordset for my forms and
reports.
Can I call in-line functions using ADO ? I tried, but it seems that only
stored procedures are allowed (adCmdStoredProc)...

Thanks.Hi

Inline functions are not intended to be called directly. You are not using
them correctly. You can not call it via ODBC, ADO, ADO.NET or Query
Analyzer.

In Inline function should be called as part of a select statement or stored
procedure. SQL Server BOL shows how they should be used.

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/

"Zlatko Mati" <zlatko.matic1@.sb.t-com.hr> wrote in message
news:d3ua9b$icu$1@.ss405.t-com.hr...
> Hello.
> How can I call some functions on MSDE when working in Access (.mdb) that
> is connected to MSDE via ODBC linked tables ? Especially
> in-line functions, that I would like to use as recordset for my forms and
> reports.
> Can I call in-line functions using ADO ? I tried, but it seems that only
> stored procedures are allowed (adCmdStoredProc)...
> Thanks.

How to call an image via code behind

I'm running ssrs 2005 and want to write a function in the code in the page
something like this:
Public Shared Function ShowImage(val as integer) AS Image
IF val = 4 Then
Return apply.png
ELSE
Return nothing
END IF
End Function
Where apply.png is an image in the report project folder (source=external)
How can I do this?
--
moondaddy@.newsgroup.nospamI found a solution.
Basically, if a condition is true then I want to display the image. so I
put the following iff function in the images visibility property's hidden
section.
=IIF(Fields!VP_qpcCap.Value = 4,False,True)
I suppose if I had more complex logic, I could run a function in the code
behind and have it return true or false. then call that function in the
visibility property's hidden section.
"moondaddy" <moondaddy@.newsgroup.nospam> wrote in message
news:%23MMR56TPIHA.4740@.TK2MSFTNGP02.phx.gbl...
> I'm running ssrs 2005 and want to write a function in the code in the page
> something like this:
> Public Shared Function ShowImage(val as integer) AS Image
> IF val = 4 Then
> Return apply.png
> ELSE
> Return nothing
> END IF
> End Function
> Where apply.png is an image in the report project folder (source=external)
> How can I do this?
>
> --
> moondaddy@.newsgroup.nospam
>|||On Dec 12, 11:44 pm, "moondaddy" <moonda...@.newsgroup.nospam> wrote:
> I found a solution.
> Basically, if a condition is true then I want to display the image. so I
> put the following iff function in the images visibility property's hidden
> section.
> =IIF(Fields!VP_qpcCap.Value = 4,False,True)
> I suppose if I had more complex logic, I could run a function in the code
> behind and have it return true or false. then call that function in the
> visibility property's hidden section.
> "moondaddy" <moonda...@.newsgroup.nospam> wrote in message
> news:%23MMR56TPIHA.4740@.TK2MSFTNGP02.phx.gbl...
>
> > I'm running ssrs 2005 and want to write a function in the code in the page
> > something like this:
> > Public Shared Function ShowImage(val as integer) AS Image
> > IF val = 4 Then
> > Return apply.png
> > ELSE
> > Return nothing
> > END IF
> > End Function
> > Where apply.png is an image in the report project folder (source=external)
> > How can I do this?
> > --
> > moonda...@.newsgroup.nospam- Hide quoted text -
> - Show quoted text -
1. Add an Image object to your Report
2. Set the Value expression to "=Code.ShowImage( Fields!
VP_qpcCap.Value )
3. Change the ShowImage function to return a String
4. Change the Return line to Return "apply.pjm" (put it in double
quotes)
-- Scott