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

Thursday, March 29, 2012

Can I Insert/Update Large Text Field To Database Without Bulk Insert?

I have a web form with a text field that needs to take in as much as the user decides to type and insert it into an nvarchar(max) field in the database behind. I've tried using the new .write() method in my update statement, but it cuts off the text after a while. Is there a way to insert/update in SQL 2005 this without resorting to Bulk Insert? It bloats the transaction log and turning the logging off requires a call to sp_dboptions (or a straight-up ALTER DATABASE), which I'd like to avoid if I can.

You can't just use a plain old update statement and set the column = a parameter of the correct datatype?

|||

How do you indicate that a SqlParameter is of type nvarchar(max)? Any numeric length up to 4000 is easy, but beyond that I've come up empty.

|||

When I add a parameter to a command, I use the AddWithValue method instead of the Add method. That way I don't have to type in the datatype and the length, I just pass it text and it works.

It's possible that it will truncate on you using that method, but I've used it with ntext and long text values before

|||

cmd.Parameters.Add("@.Blobby",SqlDbType.Nvarchar)

or

cmd.Parameters.Add("@.Blobby",SqlDbType.Nvarchar,-1)

|||

cmd.Parameters.AddWithValue("@.Blobby",myTextBox.Text)

(or any other object's value instead of myTextBox)

|||

I normally don't recommend AddWithValue because it can cause some problems when it's unclear what the conversions (if any) should be. This comes into play when the result to be passed could possibly be a nvarchar or a more specific data type (integers, dates). Under certain circumstances, .NET decides to send the data to SQL Server as a nvarchar, and when it gets there, it realizes that it needs to be converted to a more specific data type, but the information needed to do the conversion correctly (because of culture formatting) isn't available on the server, or it uses the servers culture rather than the culture of the running page.

Using .Add with a specified datatype insures that the data conversion is done by .NET before sending the parameter on to SQL Server.

Can I hide data fields in a Chart?

I have a Bar/Line Chart with two data fields. Field #1 is displayed as a bar,
Field #2 a line. I would like to allow the user to choose via a parameter if
the line is displayed.
I tried the following expression for the Field:
=iif(Parameters!ShowTrend.Value=True,Fields!Trend.Value,False)
But rather than hiding the line, it makes all values zero with the line
still showing.
Is there some way to hide the line?
Thanks.You may want to try:
=iif(Parameters!ShowTrend.Value=True, Fields!Trend.Value, Nothing)
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"bill" <bill@.discussions.microsoft.com> wrote in message
news:745AF66D-CC9D-4D91-845C-FD4227C08E59@.microsoft.com...
> I have a Bar/Line Chart with two data fields. Field #1 is displayed as a
bar,
> Field #2 a line. I would like to allow the user to choose via a parameter
if
> the line is displayed.
> I tried the following expression for the Field:
> =iif(Parameters!ShowTrend.Value=True,Fields!Trend.Value,False)
> But rather than hiding the line, it makes all values zero with the line
> still showing.
> Is there some way to hide the line?
> Thanks.
>|||Show/hide is not supported in charts.
But why don't you try a dynamic series grouping and filter those series
groupings that you don't want show (the Grouping&Sorting dialog for every
chart grouping has a filter tab where you can define expressions to filter
data). This should also take care of the chart legend issue.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"bill" <bill@.discussions.microsoft.com> wrote in message
news:6B4516F9-D415-4522-838F-BCBAF0789F30@.microsoft.com...
> Thanks for the reply, but "Nothing" gives me the same results as "False"
...
> the line shows-up on bottom with zero values.
> I can get the effect of hiding (sort of) by setting color to transparent.
> But the data series still displays in the legend box.
> Is there no way to dynamically let the user specify what data elements
they
> want to show/hide on a chart?
> Bill
> "Robert Bruckner [MSFT]" wrote:
> > You may want to try:
> > =iif(Parameters!ShowTrend.Value=True, Fields!Trend.Value, Nothing)
> >
> > --
> > This posting is provided "AS IS" with no warranties, and confers no
rights.
> >
> >
> > "bill" <bill@.discussions.microsoft.com> wrote in message
> > news:745AF66D-CC9D-4D91-845C-FD4227C08E59@.microsoft.com...
> > > I have a Bar/Line Chart with two data fields. Field #1 is displayed as
a
> > bar,
> > > Field #2 a line. I would like to allow the user to choose via a
parameter
> > if
> > > the line is displayed.
> > >
> > > I tried the following expression for the Field:
> > >
> > > =iif(Parameters!ShowTrend.Value=True,Fields!Trend.Value,False)
> > >
> > > But rather than hiding the line, it makes all values zero with the
line
> > > still showing.
> > >
> > > Is there some way to hide the line?
> > >
> > > Thanks.
> > >
> > >
> >
> >
> >

can i have the same parameter 3 times for different results?

I have 3 list/tables/columns..which ever is the easiest. I want to have a
parameter for the user to pick YEAR1 YEAR2 YEAR3 from drop down lists.
The only problem is when i make the first parameter, it doesnt let me make
another one, since its basically the same as the first, When i tried to make
a new one and change the name, it doesnt work. I basically want to have the
same parameter 3 times, for 3 different years. Which will show the measure
for those three different years based on what the user choses from the drop
down.
Year 1 Year 2 Year3
1 1 1
1 3 2
2 3 2
3 2 2
4 5 3
5 2 2
6 1 1
It seems like it would be easy, if it was 2 or 3 different parameters, but
since im working off a Cube (ANALYSIS SERVICES) when i click the parameter
check box in the dataset for the three different tables, nothing shows up
but the first parameter i made. Why is this? and how do i get it to give me
3 drop down boxes with the same field, but different values, based on the
users choice'Should these years be interchangeable, or could you use Year1, Year1+1 and
Year1+2?
If you could let the years be grouped together, you could stick with your
first parameter.
You might be able to create a few named sets or something, to make the
second and third year parameter. Not sure how, though. (And can't access
cubes right now, so can't check it out.)
On a side note, I've just given up on the whole new way of doing cube
queries. I usually do it the old school way. :)
Kaisa M. Lindahl Lervik
"Tenchy" <Tenchy@.discussions.microsoft.com> wrote in message
news:5BDD6564-F147-4FF5-B837-CD2E17569436@.microsoft.com...
>I have 3 list/tables/columns..which ever is the easiest. I want to have a
> parameter for the user to pick YEAR1 YEAR2 YEAR3 from drop down
> lists.
> The only problem is when i make the first parameter, it doesnt let me make
> another one, since its basically the same as the first, When i tried to
> make
> a new one and change the name, it doesnt work. I basically want to have
> the
> same parameter 3 times, for 3 different years. Which will show the measure
> for those three different years based on what the user choses from the
> drop
> down.
>
> Year 1 Year 2 Year3
> 1 1 1
> 1 3 2
> 2 3 2
> 3 2 2
> 4 5 3
> 5 2 2
> 6 1 1
> It seems like it would be easy, if it was 2 or 3 different parameters, but
> since im working off a Cube (ANALYSIS SERVICES) when i click the parameter
> check box in the dataset for the three different tables, nothing shows up
> but the first parameter i made. Why is this? and how do i get it to give
> me
> 3 drop down boxes with the same field, but different values, based on the
> users choice'
>

Tuesday, March 27, 2012

can i grant all privilege to user?

it is possible to grant all privilege (CRUD) to specified table to user. But, now, i want to grant all privilege (CRUD) of all tables, views, sp, ... of database to the user. is it possible?

regards,

Yes you can try the link below for SQL Server object permissions. It can get complex but the link below can get you started. You have the option of doing it with T-SQL or with GUI with Management Studio. Hope this helps.

http://msdn2.microsoft.com/en-us/library/ms188371.aspx

|||Now, i assign a role(db_owner) to the user. Because i don't know the different permissions of the different role, i just assign as db_owner. In my case, the only needed is DDL, CRUD DML, stored procedure. That's all. So, is there any other more suitable role. As i can't find the way that assign all these privilege only one command, i just assign a role. I don't know whether is it good or not.

Any idea?|||

You have two options dbcreator and db_ddladmin roles both are less than dbo and may do what you need because a of service pack3 in SQL Server 2000 dbcreator cannot change ownership of a database. The links below will help with more details. Hope this helps.

http://msdn2.microsoft.com/en-us/library/ms175892.aspx

http://msdn2.microsoft.com/en-us/library/ms189121.aspx

|||thx for ur kindness.|||I am glad I could help.sql

can i force disconnection from a stored proc ?

inside a stored proc
that validates the user,
can i force to disconnect ?
atte,
Hernn Castelo
SGA - UTN - FRBA
The only way I know of to force a disconnect is to raise an error with a
severity of 20 or higher. However, that requires that the login is a member
of the sysadmin role. Not a good idea, generally, to put everyone in that
role! Can't you just RETURN if the user isn't validated properly?
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
"Hernn Castelo" <bajopalabra@.hotmail.com> wrote in message
news:OZZ$grmzEHA.2012@.TK2MSFTNGP15.phx.gbl...
> inside a stored proc
> that validates the user,
> can i force to disconnect ?
> --
> atte,
> Hernn Castelo
> SGA - UTN - FRBA
>
|||Yes, it is possible with the Kill Spid command
Execute sp_who to get a report on valid SPID values. Use @.@.SPID to display
the value for the current session.
This example shows how to terminate SPID 10.
KILL 10
"Hernn Castelo" <bajopalabra@.hotmail.com> schreef in bericht
news:OZZ$grmzEHA.2012@.TK2MSFTNGP15.phx.gbl...
> inside a stored proc
> that validates the user,
> can i force to disconnect ?
> --
> atte,
> Hernn Castelo
> SGA - UTN - FRBA
>
|||And in addition to the sysadmin problem, try killing your own process and
see what happens:
Server: Msg 6104, Level 16, State 1, Line 1
Cannot use KILL to kill your own process.
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
"Johan Koopmans" <koopmans.johan@.hccnet.nl> wrote in message
news:ecMX39mzEHA.1452@.TK2MSFTNGP11.phx.gbl...
> Yes, it is possible with the Kill Spid command
> Execute sp_who to get a report on valid SPID values. Use @.@.SPID to display
> the value for the current session.
> This example shows how to terminate SPID 10.
> KILL 10
|||You need to be a member of sysadmin to run KILL...
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
"Johan Koopmans" <koopmans.johan@.hccnet.nl> wrote in message
news:ecMX39mzEHA.1452@.TK2MSFTNGP11.phx.gbl...
> Yes, it is possible with the Kill Spid command
> Execute sp_who to get a report on valid SPID values. Use @.@.SPID to display
> the value for the current session.
> This example shows how to terminate SPID 10.
> KILL 10
>
|||Define validate and disconnect. I have my own definition.
Do you have English speaking people near you?
Jeff
"Hernn Castelo" <bajopalabra@.hotmail.com> wrote in message
news:OZZ$grmzEHA.2012@.TK2MSFTNGP15.phx.gbl...
> inside a stored proc
> that validates the user,
> can i force to disconnect ?
> --
> atte,
> Hernn Castelo
> SGA - UTN - FRBA
>
|||thanks for the replies
yes...you are right ...it is a bad idea
and not very useful
atte,
Hernn Castelo
SGA - UTN - FRBA
"Hernn Castelo" <bajopalabra@.hotmail.com> escribi en el mensaje
news:OZZ$grmzEHA.2012@.TK2MSFTNGP15.phx.gbl...
> inside a stored proc
> that validates the user,
> can i force to disconnect ?
> --
> atte,
> Hernn Castelo
> SGA - UTN - FRBA
>

can i force disconnection from a stored proc ?

inside a stored proc
that validates the user,
can i force to disconnect ?
atte,
Hernn Castelo
SGA - UTN - FRBAThe only way I know of to force a disconnect is to raise an error with a
severity of 20 or higher. However, that requires that the login is a member
of the sysadmin role. Not a good idea, generally, to put everyone in that
role! Can't you just RETURN if the user isn't validated properly?
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
--
"Hernn Castelo" <bajopalabra@.hotmail.com> wrote in message
news:OZZ$grmzEHA.2012@.TK2MSFTNGP15.phx.gbl...
> inside a stored proc
> that validates the user,
> can i force to disconnect ?
> --
> atte,
> Hernn Castelo
> SGA - UTN - FRBA
>|||Yes, it is possible with the Kill Spid command
Execute sp_who to get a report on valid SPID values. Use @.@.SPID to display
the value for the current session.
This example shows how to terminate SPID 10.
KILL 10
"Hernn Castelo" <bajopalabra@.hotmail.com> schreef in bericht
news:OZZ$grmzEHA.2012@.TK2MSFTNGP15.phx.gbl...
> inside a stored proc
> that validates the user,
> can i force to disconnect ?
> --
> atte,
> Hernn Castelo
> SGA - UTN - FRBA
>|||And in addition to the sysadmin problem, try killing your own process and
see what happens:
Server: Msg 6104, Level 16, State 1, Line 1
Cannot use KILL to kill your own process.
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
--
"Johan Koopmans" <koopmans.johan@.hccnet.nl> wrote in message
news:ecMX39mzEHA.1452@.TK2MSFTNGP11.phx.gbl...
> Yes, it is possible with the Kill Spid command
> Execute sp_who to get a report on valid SPID values. Use @.@.SPID to display
> the value for the current session.
> This example shows how to terminate SPID 10.
> KILL 10|||You need to be a member of sysadmin to run KILL...
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
--
"Johan Koopmans" <koopmans.johan@.hccnet.nl> wrote in message
news:ecMX39mzEHA.1452@.TK2MSFTNGP11.phx.gbl...
> Yes, it is possible with the Kill Spid command
> Execute sp_who to get a report on valid SPID values. Use @.@.SPID to display
> the value for the current session.
> This example shows how to terminate SPID 10.
> KILL 10
>|||Define validate and disconnect. I have my own definition.
Do you have English speaking people near you?
Jeff
"Hernn Castelo" <bajopalabra@.hotmail.com> wrote in message
news:OZZ$grmzEHA.2012@.TK2MSFTNGP15.phx.gbl...
> inside a stored proc
> that validates the user,
> can i force to disconnect ?
> --
> atte,
> Hernn Castelo
> SGA - UTN - FRBA
>|||thanks for the replies
yes...you are right ...it is a bad idea
and not very useful
atte,
Hernn Castelo
SGA - UTN - FRBA
"Hernn Castelo" <bajopalabra@.hotmail.com> escribi en el mensaje
news:OZZ$grmzEHA.2012@.TK2MSFTNGP15.phx.gbl...
> inside a stored proc
> that validates the user,
> can i force to disconnect ?
> --
> atte,
> Hernn Castelo
> SGA - UTN - FRBA
>

can i force disconnection from a stored proc ?

inside a stored proc
that validates the user,
can i force to disconnect ?
--
atte,
Hernán Castelo
SGA - UTN - FRBAThe only way I know of to force a disconnect is to raise an error with a
severity of 20 or higher. However, that requires that the login is a member
of the sysadmin role. Not a good idea, generally, to put everyone in that
role! Can't you just RETURN if the user isn't validated properly?
--
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
--
"Hernán Castelo" <bajopalabra@.hotmail.com> wrote in message
news:OZZ$grmzEHA.2012@.TK2MSFTNGP15.phx.gbl...
> inside a stored proc
> that validates the user,
> can i force to disconnect ?
> --
> atte,
> Hernán Castelo
> SGA - UTN - FRBA
>|||Yes, it is possible with the Kill Spid command
Execute sp_who to get a report on valid SPID values. Use @.@.SPID to display
the value for the current session.
This example shows how to terminate SPID 10.
KILL 10
"Hernán Castelo" <bajopalabra@.hotmail.com> schreef in bericht
news:OZZ$grmzEHA.2012@.TK2MSFTNGP15.phx.gbl...
> inside a stored proc
> that validates the user,
> can i force to disconnect ?
> --
> atte,
> Hernán Castelo
> SGA - UTN - FRBA
>|||And in addition to the sysadmin problem, try killing your own process and
see what happens:
Server: Msg 6104, Level 16, State 1, Line 1
Cannot use KILL to kill your own process.
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
--
"Johan Koopmans" <koopmans.johan@.hccnet.nl> wrote in message
news:ecMX39mzEHA.1452@.TK2MSFTNGP11.phx.gbl...
> Yes, it is possible with the Kill Spid command
> Execute sp_who to get a report on valid SPID values. Use @.@.SPID to display
> the value for the current session.
> This example shows how to terminate SPID 10.
> KILL 10|||You need to be a member of sysadmin to run KILL...
--
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
--
"Johan Koopmans" <koopmans.johan@.hccnet.nl> wrote in message
news:ecMX39mzEHA.1452@.TK2MSFTNGP11.phx.gbl...
> Yes, it is possible with the Kill Spid command
> Execute sp_who to get a report on valid SPID values. Use @.@.SPID to display
> the value for the current session.
> This example shows how to terminate SPID 10.
> KILL 10
>|||Define validate and disconnect. I have my own definition.
Do you have English speaking people near you?
Jeff
"Hernán Castelo" <bajopalabra@.hotmail.com> wrote in message
news:OZZ$grmzEHA.2012@.TK2MSFTNGP15.phx.gbl...
> inside a stored proc
> that validates the user,
> can i force to disconnect ?
> --
> atte,
> Hernán Castelo
> SGA - UTN - FRBA
>|||thanks for the replies
yes...you are right ...it is a bad idea
and not very useful
--
atte,
Hernán Castelo
SGA - UTN - FRBA
"Hernán Castelo" <bajopalabra@.hotmail.com> escribió en el mensaje
news:OZZ$grmzEHA.2012@.TK2MSFTNGP15.phx.gbl...
> inside a stored proc
> that validates the user,
> can i force to disconnect ?
> --
> atte,
> Hernán Castelo
> SGA - UTN - FRBA
>sql

Sunday, March 25, 2012

Can I download SQL Server User Interface for free?

I have a purchased product that contains a SQL Server database. I was hoping to access the database with a SQL Server front-end, however I don't have a separate licensed copy of SQL Server. Is there a way I can obtain a free copy of the user interface for
a SQL Server DB?
I am guessing that you are running on MSDE. Perhaps you will find MSDE =
manager useful:
http://www.whitebearconsulting.com/Utilities.htm
--=20
Keith
"AFG" <anonymous@.discussions.microsoft.com> wrote in message =
news:42647C63-C881-4F78-B7E4-1017DE296CEA@.microsoft.com...
> I have a purchased product that contains a SQL Server database. I was =
hoping to access the database with a SQL Server front-end, however I =
don't have a separate licensed copy of SQL Server. Is there a way I can =
obtain a free copy of the user interface for a SQL Server DB?
|||You can use Visual Studio .Net to see the UI. I think you can use Enterprise Manager to see the MSDE, too.
|||If you do not have a licensed version of SQL Server you cannot legally use
teh utilities that come with SQL Server.
Rand
This posting is provided "as is" with no warranties and confers no rights.
|||look into "Toad For MS SQL Server"
http://www.toadsoft.com/toadss.html
not a bad tool and it's free
Greg Jackson
PDX, Oregon

Can I download SQL Server User Interface for free?

I have a purchased product that contains a SQL Server database. I was hoping
to access the database with a SQL Server front-end, however I don't have a
separate licensed copy of SQL Server. Is there a way I can obtain a free cop
y of the user interface for
a SQL Server DB?I am guessing that you are running on MSDE. Perhaps you will find MSDE =
manager useful:
http://www.whitebearconsulting.com/Utilities.htm
--=20
Keith
"AFG" <anonymous@.discussions.microsoft.com> wrote in message =
news:42647C63-C881-4F78-B7E4-1017DE296CEA@.microsoft.com...
> I have a purchased product that contains a SQL Server database. I was =
hoping to access the database with a SQL Server front-end, however I =
don't have a separate licensed copy of SQL Server. Is there a way I can =
obtain a free copy of the user interface for a SQL Server DB?|||You can use Visual Studio .Net to see the UI. I think you can use Enterprise
Manager to see the MSDE, too.|||If you do not have a licensed version of SQL Server you cannot legally use
teh utilities that come with SQL Server.
Rand
This posting is provided "as is" with no warranties and confers no rights.|||look into "Toad For MS SQL Server"
http://www.toadsoft.com/toadss.html
not a bad tool and it's free
Greg Jackson
PDX, Oregon

Can I download SQL Server User Interface for free?

I have a purchased product that contains a SQL Server database. I was hoping to access the database with a SQL Server front-end, however I don't have a separate licensed copy of SQL Server. Is there a way I can obtain a free copy of the user interface for a SQL Server DB?I am guessing that you are running on MSDE. Perhaps you will find MSDE =manager useful:
http://www.whitebearconsulting.com/Utilities.htm
-- Keith
"AFG" <anonymous@.discussions.microsoft.com> wrote in message =news:42647C63-C881-4F78-B7E4-1017DE296CEA@.microsoft.com...
> I have a purchased product that contains a SQL Server database. I was =hoping to access the database with a SQL Server front-end, however I =don't have a separate licensed copy of SQL Server. Is there a way I can =obtain a free copy of the user interface for a SQL Server DB?|||You can use Visual Studio .Net to see the UI. I think you can use Enterprise Manager to see the MSDE, too.|||If you do not have a licensed version of SQL Server you cannot legally use
teh utilities that come with SQL Server.
Rand
This posting is provided "as is" with no warranties and confers no rights.|||look into "Toad For MS SQL Server"
http://www.toadsoft.com/toadss.html
not a bad tool and it's free
Greg Jackson
PDX, Oregon

Tuesday, March 20, 2012

Can I change a datasource's properties at report execution time?

I will be running reports on a shared database server. The database server
supports one main application with many environments for different user
groups. Each groupsâ' data is kept in a different database instance.
I want to deploy my reports in a single location on the shared database
server to simplify installing reporting services and deploying reports.
When a user requests a on-demand report I want the report to pull the data
from the correct SQL Server instance.
Can I to change the reportâ's shared datasource â'Connection Stringâ' to the
userâ's database instance. I will be using SOAP to invoke the reports.
Are there other ways to accomplish my intentions?
I am using SQL Server 2000 Reporting Services Developer Edition with SP1 and
SQL Server 2000 Standard Edition with service packs 1, 2, 3, and 3a applied.Hi,
You may want to use 'SetReportDataSources' to switch between datasources.
More information about this method can be found from the MSDN site:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSPROG/htm/
rsp_prog_soapapi_intro_0dnq.asp
Sincerely,
William Wang
Microsoft Online Partner 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.
--
>Thread-Topic: Can I change a datasource's properties at report execution
time?
>thread-index: AcUz8ztCgxbpG2rJQdCyH/tlSmdIXw==>X-WBNR-Posting-Host: 192.85.47.1
>From: =?Utf-8?B?dGV4YXMzNDYw?= <texas3460@.noemail.nospam>
>Subject: Can I change a datasource's properties at report execution time?
>Date: Mon, 28 Mar 2005 16:07:01 -0800
>Lines: 17
>Message-ID: <26693252-7562-4848-9FD1-9D529F3D40F9@.microsoft.com>
>MIME-Version: 1.0
>Content-Type: text/plain;
> charset="Utf-8"
>Content-Transfer-Encoding: 8bit
>X-Newsreader: Microsoft CDO for Windows 2000
>Content-Class: urn:content-classes:message
>Importance: normal
>Priority: normal
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
>Newsgroups: microsoft.public.sqlserver.reportingsvcs
>Path: TK2MSFTNGXA03.phx.gbl
>Xref: TK2MSFTNGXA03.phx.gbl microsoft.public.sqlserver.reportingsvcs:46323
>NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
>X-Tomcat-NG: microsoft.public.sqlserver.reportingsvcs
>I will be running reports on a shared database server. The database
server
>supports one main application with many environments for different user
>groups. Each groupsâ' data is kept in a different database instance.
>I want to deploy my reports in a single location on the shared database
>server to simplify installing reporting services and deploying reports.
>When a user requests a on-demand report I want the report to pull the data
>from the correct SQL Server instance.
>Can I to change the reportâ's shared datasource â'Connection Stringâ'
to the
>userâ's database instance. I will be using SOAP to invoke the reports.
>Are there other ways to accomplish my intentions?
>I am using SQL Server 2000 Reporting Services Developer Edition with SP1
and
>SQL Server 2000 Standard Edition with service packs 1, 2, 3, and 3a
applied.
>

Monday, March 19, 2012

Can I add user and passw to my OLAP ConnectionString?

Hi all,
I have written a custom assembly that works fine in preview mode, but when I deploy the report I get the '#Error' message instead of the output.
I have copied the assembly to the bin folder of Reportserver, placed it in the GAC and even edited the policyfiles.

Any help would be very appriciated,

Thanks in advance

public static class SimCardBuyer
{
public static string ReturnBuyer(string Seller, string PeriodeCode, string ComDevice)
{
string connstring = "PROVIDER=MSOLAP;DATA SOURCE=srv03-gc-10;INITIAL CATALOG=Invoicing";
AdomdConnection conn = new Microsoft.AnalysisServices.AdomdClient.AdomdConnection(connstring);
//Create a new string builder to store the results
System.Text.StringBuilder result = new System.Text.StringBuilder();
//Connect to the local server
using (conn)
{
conn.Open();
//Create a command, using this connection
AdomdCommand cmd = conn.CreateCommand();
cmd.CommandText = @."SELECT NON EMPTY { [Measures].[InvoiceAmount] } ON COLUMNS, NON EMPTY { ([Buyer].[Company].[Company].ALLMEMBERS ) }
DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM
( SELECT ( { [Com Device].[Com Device].[" + ComDevice + @."] } ) ON COLUMNS FROM
( SELECT ( { [Invoice].[Period Code].[" + PeriodeCode + @."] } ) ON COLUMNS FROM
( SELECT ( { [Seller].[Company].[" + Seller + @."] } ) ON COLUMNS FROM [Invoicing])))
WHERE ( [Seller].[Company].[" + Seller + @."], [Invoice].[Period Code].[" + PeriodeCode + @."], [Com Device].[Com Device].[" + ComDevice + @."] )";

//Execute the query, returning a cellset
CellSet cs = cmd.ExecuteCellSet();
//Output the column captions from the first axis
//Note that this procedure assumes a single member exists per column.
TupleCollection tuplesOnRows = cs.Axes[1].Set.Tuples;
if (tuplesOnRows.Count > 1)
{
for (int row = 0; row < tuplesOnRows.Count - 1; row++)
{
result.Append(tuplesOnRows[row].Members[0].Caption);
result.Append(" / ");
}
result.Append(tuplesOnRows[tuplesOnRows.Count - 1].Members[0].Caption);
}
else if (tuplesOnRows.Count == 1)
{result.Append(tuplesOnRows[0].Members[0].Caption);}
else{result.Append(Seller);}
conn.Close();
return result.ToString();
}
}

Dear readers,

I have solved the problem above, but now I get an error with the Connectionstring.
I'm getting the next error now:


Either the user, NL01\SRV03-GC-10$, does not have access to the Invoicing database, or the database does not exist.
NL01\SRV03-GC-10$ is not a user in my system, so I'm stunned with this strange error.

I would appriciate any reply on this.

regards.

Sunday, March 11, 2012

Can I access sql 2000 from machine having sql2005

Dear All,

I am developing a network application in asp.net. The database is in local machine having sql 2005. But the user database is already existent. So I am accessing that database which is sql2000. does it give any problem while connecting from sql2005 machine to sql2000. If yes it is giving me error as follows:

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: TCP Provider, error: 0 - No connection could be made because the target machine actively refused it.)

connection string is :

"Data Source=192.168.1.16,1433;Network Library=DBMSSOCN;Initial Catalog=mycatalog;User ID=myuserid;Password=mypwd;"

Please correct me if I am wrong.

Thanks and Regards.

Fazal

This indicates that your TCP/IP was not enabled or your sql server was not listening on the appropriate port.

|||

Go to "Microsoft SQL Server 2005" in programm files => onfiguration Tools =>SQL Server Surface Area Configuration =>first option=>Remote Connections

and here allow remote connection = Use both TCP/IP and name pipes => OK

After that you must restart SQL Server 2005 in order to apply the modification and try againa

Popa IUlia

_____________________

MCP.MCAD.MCSD

Can groups be driven by parameters

I have a simple report grouped by Quarter (with quarterly totals) and
then by Month (with monthly totals).
I would like to give the user the option to select the grouping they
would like to see. If they select a 'Monthly' parameter, is there a way
to ignore the quarterly group?
Currently:
Month,year col1_total col2_total
Month,year col1_total col2_total
Month,year col1_total col2_total
Quarter col1_total col2_total
Month,year col1_total col2_total
Month,year col1_total col2_total
Quarter col1_total col2_total
Report total col1_total col2_total
I would like to not show the "Quarter" line if they select Monthly.
Can this be done with parameters?Michael wrote:
> I have a simple report grouped by Quarter (with quarterly totals) and
> then by Month (with monthly totals).
> I would like to give the user the option to select the grouping they
> would like to see. If they select a 'Monthly' parameter, is there a
> way to ignore the quarterly group?
> Currently:
> Month,year col1_total col2_total
> Month,year col1_total col2_total
> Month,year col1_total col2_total
> Quarter col1_total col2_total
> Month,year col1_total col2_total
> Month,year col1_total col2_total
> Quarter col1_total col2_total
> Report total col1_total col2_total
> I would like to not show the "Quarter" line if they select Monthly.
> Can this be done with parameters?
You can use an expression on the visibility of the group and reference
your parameter. If the parameter equals 'Monthly', set the visibility
to false, else set the visibility to true.

Thursday, March 8, 2012

Can connect to sqlexpress but not the DB ?


whenever i try and choose the database i wish to work with like below. I end up with an error message about the user not being associated with a trusted sql server connection

cnStr = @."Data Source=server\SQLEXPRESS;Initial Catalog=sqldata;User ID=blah\me";

same with this one

cnStr = @."Data Source=STOCKYARD\SQLEXPRESS;Initial Catalog=DB;Trusted_Connection=Yes;";

i figured this was all permission based so i kept dorking around with security adding my user name to anything i could find, and also went through and dozen or so connection strings and found when i take out the DB name that i can open a connection.... as the code below works...

cnStr = @."Data Source=Server\SQLEXPRESS;Trusted_Connection=Yes;";

cn.Open();

I plan on importing another database so how will i later on choose between the two, i notice i can create logins only at the security for the sqlexpress and not for my database? did i mess up how i created the database?
i have added my username and given permissions to the security for the database i wish to connect to, but is there another step im missing? i would keep trucking but i would like to have multiple DB on the sql express and pick and choose at the code level, maybe im misunderstanding what the catalog should include or i can change the connections database at another point?

You need to have specific permissions in a database given to a Database User, and that user needs to be Associated with a Server Login. My guess is that you don't quite have things connected together correctly yet. Check ou this BOL topic that helps lay out how Windows Users, SQL Logins and Database Users all fit together.

Once you have things associated together, you should be able to work in a database.

Mike

|||

You cannot use "User ID=blah\me". If you are trying to use your domain account, just use "Trusted_Connection=Yes". User ID is used for SQL Authentication, and you cannot specify a domain account.

You must have login permission for the "Initial Catalog=DB", otherwise, you won't be able to login. Logins are for server and user id is for database. You can more inside here: http://builder.com.com/5100-6388-5055543.html

some quote:

<<<<While logins belong to servers, users belong to databases. A user ID identifies a particular user of
a particular database. Also, users are specific to databases—that is, user Fred in the Northwind database
is not the same as user Fred in the pubs database, although both Freds may be associated with the same login.>>>>>

Saturday, February 25, 2012

Can anyone make a suggestion?

the "View Report" button - Can it be place at a fixed position so that
the user sees to press it instead of having to scroll to the right?
ThanksYou can open a window using javascript and play with window's size. The
toolbar controls will wrap.
Just a suggestion.
"Hoa" <hn.hoanguyen@.gmail.com> wrote in message
news:1128089846.201541.180790@.g14g2000cwa.googlegroups.com...
> the "View Report" button - Can it be place at a fixed position so that
> the user sees to press it instead of having to scroll to the right?
> Thanks
>|||Thank you, Oleg. I will give it a try.

Can anyone help with waittype 0x0044?

Hi,

I wonder if anyone can shed any light on the following as i just can't
explain it.

A user is running an update on a 500m+ row table setting a column
value, computing its value from another column in the table. It's now
been running for 23hours.

The server is Itanium 64, enterprise 2005, SAN based storage and it
usually handles anything with this volume quite quickly, probably
about 30 mins or so.

There is nothing else running currently although overnight batches,
backups etc have been running within the last 23 hours.

In sysprocess it showing the following :-

spid kpid blocked waittype waittime
lastwaittype waitresource
52 5236 0 0x0044 30
PAGEIOLATCH_EX 6:13:1754732

the process seems to stay in this waittype for a few secnds and then
goes to a 0x0000 and then back into this one again. I can see from the
IO counter that IO is increasing and also looking at the current IO i
see the following so presume the query is still working :-

select
database_id,
file_id,
io_stall,
io_pending_ms_ticks,
scheduler_address
from sys.dm_io_virtual_file_stats(NULL, NULL)t1,
sys.dm_io_pending_io_requests as t2
where t1.file_handle = t2.io_handle

gives results :-

613151115052100x0000000008624080

I just can't explain why it is so slow when nothing else is ruuning.

Anyone have any ideas on what i can check on?

Thanks

Ian.ianwr (ianwrigglesworth@.yahoo.co.uk) writes:

Quote:

Originally Posted by

A user is running an update on a 500m+ row table setting a column
value, computing its value from another column in the table. It's now
been running for 23hours.


Would the update cause the rows to grow? For instance, if this is
a new column that was added as nullable, and is now being populated?
In that case the table will need to grow, and could take some time.
Not the least if the data file has to grow as well.

Quote:

Originally Posted by

There is nothing else running currently although overnight batches,
backups etc have been running within the last 23 hours.
>
In sysprocess it showing the following :-
>
spid kpid blocked waittype waittime
lastwaittype waitresource
52 5236 0 0x0044 30
PAGEIOLATCH_EX 6:13:1754732


In sys.dm_exec_requests there is a wait_type which is likely to be
more informative than 0x0044.

Quote:

Originally Posted by

Anyone have any ideas on what i can check on?


Obviously a

SELECT COUNT(*) FROM tbl (NOLOCK) WHERE col <expected value

will you some progress information.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||Hi Erland,

Thanks for the view to use, unfortunately when i arrived this morning
the task had stopped and took about 29 hours to run.

Going to keep an eye on things and check out the san as well today,
Thanks for the info anyway, if it happens again i'll repost

Thanks

Ian,

Can anyone help me on this ?

I got this error when i try to see a webpage on my server. What should i do ?

Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed.

Hi,

It seems this thread is discussing this issue with solutions.

Friday, February 24, 2012

Can any please tell me how to make a user to see sql jobs.

Can any please tell me how to make a user to see sql jobs.
I know sys admins can see the jobs, but i want to give access to a user who
is not sys admin.
Thanks
Raju
Hi
If they are the owner of the job they will be able to see the job details,
but will mean that they can execute them as well. You may want to write your
own procedure to view the information.
John
"Raju" <npraju1@.hotmail.com> wrote in message
news:Oxr0p0AsFHA.2596@.TK2MSFTNGP09.phx.gbl...
> Can any please tell me how to make a user to see sql jobs.
> I know sys admins can see the jobs, but i want to give access to a user
> who
> is not sys admin.
> Thanks
> Raju
>

Can any please tell me how to make a user to see sql jobs.

Can any please tell me how to make a user to see sql jobs.
I know sys admins can see the jobs, but i want to give access to a user who
is not sys admin.
Thanks
RajuHi,
Setup a SQL Agent proxy account.
From books online:-
When sp_help_job is invoked by a user who is a member of the sysadmin fixed
server role, sp_help_job will be executed under the security context in
which the SQL Server service is running. When the user is not a member of
the sysadmin group, sp_help_job will impersonate the SQL Server Agent proxy
account, which is specified using xp_sqlagent_proxy_account. If the proxy
account is not available, sp_help_job will fail. This is true only for
Microsoft Windows NT 4.0 and Windows 2000. On Windows 9.x, there is no
impersonation and sp_help_job is always executed under the security context
of the Windows 9.x user who started SQL Server.
Thanks
Hari
SQL Server MVP
"Raju" <npraju1@.hotmail.com> wrote in message
news:OSEJk0AsFHA.3720@.TK2MSFTNGP14.phx.gbl...
> Can any please tell me how to make a user to see sql jobs.
> I know sys admins can see the jobs, but i want to give access to a user
> who
> is not sys admin.
> Thanks
> Raju
>|||Hari,
Thank you for the response.
I tried the method, but the user can't see the list of jobs on the EM.
I want the user to stop/start the jobs, but i don't want to make him sys
admin.
Can you please help?
Thanks
Raju
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:ee7%23B1PsFHA.3080@.TK2MSFTNGP15.phx.gbl...
> Hi,
> Setup a SQL Agent proxy account.
> From books online:-
> When sp_help_job is invoked by a user who is a member of the sysadmin
fixed
> server role, sp_help_job will be executed under the security context in
> which the SQL Server service is running. When the user is not a member of
> the sysadmin group, sp_help_job will impersonate the SQL Server Agent
proxy
> account, which is specified using xp_sqlagent_proxy_account. If the proxy
> account is not available, sp_help_job will fail. This is true only for
> Microsoft Windows NT 4.0 and Windows 2000. On Windows 9.x, there is no
> impersonation and sp_help_job is always executed under the security
context
> of the Windows 9.x user who started SQL Server.
> Thanks
> Hari
> SQL Server MVP
> "Raju" <npraju1@.hotmail.com> wrote in message
> news:OSEJk0AsFHA.3720@.TK2MSFTNGP14.phx.gbl...
>|||It won't work. When sp_help_job is executed, if a user is
not a member of the sysadmins role, they can only view jobs
they own. The proxy account doesn't come into play here.
Ownership is checked in sp_help_job that which calls
sp_get_composite_job_info. If the executing user doesn't
pass the ownership, sysadmin check, the job won't be
displayed. And if run from query analyzer, you won't get any
results back. There is no supported way to do what you want
with SQL Server 2000. One option is to add the users to the
TargetServerRole in msdb but this is not supported and the
permissions of users added to this role will vary depending
on what service pack is installed.
-Sue
On Wed, 7 Sep 2005 12:27:39 -0700, "Raju"
<npraju1@.hotmail.com> wrote:

>Hari,
>Thank you for the response.
>I tried the method, but the user can't see the list of jobs on the EM.
>I want the user to stop/start the jobs, but i don't want to make him sys
>admin.
>Can you please help?
>Thanks
>Raju
>
>"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
>news:ee7%23B1PsFHA.3080@.TK2MSFTNGP15.phx.gbl...
>fixed
>proxy
>context
>