Showing posts with label drop. Show all posts
Showing posts with label drop. Show all posts

Thursday, March 29, 2012

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 20, 2012

can I change owner of replicated tables?

can I change the owner of tables that are part of a merge replication
without effecting that replication? or will I need to drop all replication,
change owners, then re-setup replication?
any info is appreciated. Thanks.
no you can't and this will cause major problems.
The best thing to do is to drop your publication, drop the tables on the
subscriber and recreate it.
"djc" <noone@.nowhere.com> wrote in message
news:%23UZcu%23OZEHA.1000@.TK2MSFTNGP12.phx.gbl...
> can I change the owner of tables that are part of a merge replication
> without effecting that replication? or will I need to drop all
replication,
> change owners, then re-setup replication?
> any info is appreciated. Thanks.
>
|||ok. thanks.
Hillary,
are you familiar with the merge repl problems mentioned by Kestutis
Adomavicius in post titled: 'cannot remove repl... cannot delete database'?
If so could you offer some more insight into that and the questions I had in
reply to him?
Thanks... your other posts have helped me out a lot.
"Hilary Cotter" <hilaryk@.att.net> wrote in message
news:OAIF8ZPZEHA.212@.TK2MSFTNGP11.phx.gbl...
> no you can't and this will cause major problems.
> The best thing to do is to drop your publication, drop the tables on the
> subscriber and recreate it.
> "djc" <noone@.nowhere.com> wrote in message
> news:%23UZcu%23OZEHA.1000@.TK2MSFTNGP12.phx.gbl...
> replication,
>
|||I have been able to repro the problem with the conflict tables that Kestutis
has pointed out. You get this error when dropping replication and it is
simple to fix.
Kestutis (quite brilliantly I might add) has found some problems with the
merge replication stored procedures which may or may not cause problems. The
conflict table dropping is definately related to this problem which Kestutis
has fixed.
I have successfully implemented a central publisher with 60 subscribers
using non dbo table owners. This replication solution was relatively
maintenance free for the two years I was working on it. So, it is not a show
stopping problem, but what problems might occur is unknown. What will happen
in a future service pack is also unknown.
I have forwarded Kestutis's fixed replication stored procedures to a contact
of mine at Microsoft - with credit to Kestutis of course. Hopefully
Microsoft will implement Kestutis's suggestions.
Hilary Cotter
Looking for a book on SQL Server replication?
http://www.nwsu.com/0974973602.html
"djc" <noone@.nowhere.com> wrote in message
news:%23ZV2u1PZEHA.2456@.TK2MSFTNGP10.phx.gbl...
> ok. thanks.
> Hillary,
> are you familiar with the merge repl problems mentioned by Kestutis
> Adomavicius in post titled: 'cannot remove repl... cannot delete
database'?
> If so could you offer some more insight into that and the questions I had
in
> reply to him?
> Thanks... your other posts have helped me out a lot.
>
> "Hilary Cotter" <hilaryk@.att.net> wrote in message
> news:OAIF8ZPZEHA.212@.TK2MSFTNGP11.phx.gbl...
>

Saturday, February 25, 2012

can anyone help me regarding tool

hi
is there any tool to write stored procedure
i have long queries to write instead of that i want a tool or editor where i can click or drag and drop to write procedure
i make my work to complete faster
if any please tell me the site to download
thanx
bye
ramesh

Hi Ramesh,
Maybe is this something your looking for:
http://www.softcities.com/Lattice.SPGen-Stored-Procedure-Generator/download/16114.htm
or
http://www.freevbcode.com/ShowCode.asp?ID=3412
I never used these programs but i just did a search on google for you.
mgg

Friday, February 24, 2012

can alter table drop multiple columns

i tried to run this script:
ALTER TABLE RDKCOCUS
DROP COLUMN [Administration Executive],
DROP COLUMN [Administrator],
DROP COLUMN [Auditor],
DROP COLUMN [Chairman],
DROP COLUMN [Chief Executive Officer],
DROP COLUMN [Chief Financial Officer],
DROP COLUMN [Chief Operating Officer],
DROP COLUMN [Co-Chairman/Vice Chairman],
DROP COLUMN [Controller],
DROP COLUMN [Corporate Communications Executive],
DROP COLUMN [Corporate Secretary],
DROP COLUMN [Data Processing Executive],
DROP COLUMN [Director],
DROP COLUMN [Executive Director],
DROP COLUMN [Executive Vice President],
DROP COLUMN [Finance Executive],
DROP COLUMN [General Counsel],
DROP COLUMN [Human Resources Executive],
DROP COLUMN [Manager],
DROP COLUMN [Marketing Executive],
DROP COLUMN [Officer],
DROP COLUMN [Operations Executive],
DROP COLUMN [Owner],
DROP COLUMN [Partner],
DROP COLUMN [Plant Manager],
DROP COLUMN [President],
DROP COLUMN [Principal],
DROP COLUMN [Publisher],
DROP COLUMN [Purchasing Agent],
DROP COLUMN [Sales Executive],
DROP COLUMN [Senior Vice President],
DROP COLUMN [Telecommunications Executive],
DROP COLUMN [Treasurer],
DROP COLUMN [Vice President]
and i got the error, incorrect syntax near keyword drop
so i tried this script instead:
ALTER TABLE RDKCOCUS
DROP COLUMN [Administration Executive]
and it worked. so i guess my question is, do i really have to rerun the
script for every columnlist them one after another spereated by comma's
example
CREATE TABLE doc_exe ( column_a INT, column_a_un int, colC int)
GO
select * from doc_exe
GO
ALTER TABLE doc_exe DROP COLUMN column_a_un,colC
GO
select * from doc_exe
GO
drop table doc_exe
GO
http://sqlservercode.blogspot.com/|||tyty
"SQL" <denis.gobo@.gmail.com> wrote in message
news:1136924539.257435.5670@.f14g2000cwb.googlegroups.com...
> list them one after another spereated by comma's
> example
> CREATE TABLE doc_exe ( column_a INT, column_a_un int, colC int)
> GO
> select * from doc_exe
> GO
> ALTER TABLE doc_exe DROP COLUMN column_a_un,colC
> GO
> select * from doc_exe
> GO
> drop table doc_exe
> GO
> http://sqlservercode.blogspot.com/
>|||Cool. I didn't realize that this would work :)
----
Louis Davidson - http://spaces.msn.com/members/drsql/
SQL Server MVP
"Arguments are to be avoided: they are always vulgar and often convincing."
(Oscar Wilde)
"SQL" <denis.gobo@.gmail.com> wrote in message
news:1136924539.257435.5670@.f14g2000cwb.googlegroups.com...
> list them one after another spereated by comma's
> example
> CREATE TABLE doc_exe ( column_a INT, column_a_un int, colC int)
> GO
> select * from doc_exe
> GO
> ALTER TABLE doc_exe DROP COLUMN column_a_un,colC
> GO
> select * from doc_exe
> GO
> drop table doc_exe
> GO
> http://sqlservercode.blogspot.com/
>|||Use drop column followed by a list of fields, seperated by commas. Dont
repeat the drop column keywords for each column.
ALTER TABLE RDKCOCUS
DROP COLUMN [Administration Executive],
[Administrator],
[Auditor],
[Chairman],....
"Abraham Andres Luna" <abe@.rdk.com> wrote in message
news:uy2OKKiFGHA.2708@.TK2MSFTNGP11.phx.gbl...
> i tried to run this script:
> ALTER TABLE RDKCOCUS
> DROP COLUMN [Administration Executive],
> DROP COLUMN [Administrator],
> DROP COLUMN [Auditor],
> DROP COLUMN [Chairman],
> DROP COLUMN [Chief Executive Officer],
> DROP COLUMN [Chief Financial Officer],
> DROP COLUMN [Chief Operating Officer],
> DROP COLUMN [Co-Chairman/Vice Chairman],
> DROP COLUMN [Controller],
> DROP COLUMN [Corporate Communications Executive],
> DROP COLUMN [Corporate Secretary],
> DROP COLUMN [Data Processing Executive],
> DROP COLUMN [Director],
> DROP COLUMN [Executive Director],
> DROP COLUMN [Executive Vice President],
> DROP COLUMN [Finance Executive],
> DROP COLUMN [General Counsel],
> DROP COLUMN [Human Resources Executive],
> DROP COLUMN [Manager],
> DROP COLUMN [Marketing Executive],
> DROP COLUMN [Officer],
> DROP COLUMN [Operations Executive],
> DROP COLUMN [Owner],
> DROP COLUMN [Partner],
> DROP COLUMN [Plant Manager],
> DROP COLUMN [President],
> DROP COLUMN [Principal],
> DROP COLUMN [Publisher],
> DROP COLUMN [Purchasing Agent],
> DROP COLUMN [Sales Executive],
> DROP COLUMN [Senior Vice President],
> DROP COLUMN [Telecommunications Executive],
> DROP COLUMN [Treasurer],
> DROP COLUMN [Vice President]
>
> and i got the error, incorrect syntax near keyword drop
> so i tried this script instead:
> ALTER TABLE RDKCOCUS
> DROP COLUMN [Administration Executive]
> and it worked. so i guess my question is, do i really have to rerun the
> script for every column
>|||I remember reading somewhere that you can drop multiple objects in 1
shot
Like this
CREATE TABLE doc_exe1 ( name INT)
GO
CREATE TABLE doc_exe2 ( name INT)
GO
DROP TABLE doc_exe1,doc_exe2
I just tried it with columns and it seems to work

Can Add/update/drop column sql statements in one store procedure?

I have a batch sql statments to add column NewCol into TableA, then update
NewCol at this TableA, then drop column NewCol from TableA. I have no proble
m
to run them as individual sql statment with GO after each statment. But when
I tried to put these sql statements into one store procedure, each time when
compile or run the store procedure, I got error 'Invalid column name'. I
guess column NewCol is not there at beginning. So Can I put Add/update/drop
column in one store procedure?
alter procedure xash
AS
-- other sql regarding to this TableA --
--alter add column--
alter table TableA add NewCol varchar(1) null
-- update new column--
Update TableA
set NewCol= 'Y'
--other operation related this table and new column--
--drop column --
alter table TableA drop COLUMN NewCol
GOYou have to commit the work at each step before the next step can see
it. There is lots of overhead for this.
I have to ask why you are doing this. Instead of having physical
storage hold your computed values, wouldn't it be better to simply have
a VIEW with the computed column in it? Also why do you want to use
VARCHAR(1); think about it.
CREATE VIEW FilteredFoobar (..)
AS
SELECT ..., CASE WHEN <<test here>> THEN 'Y' ELSE 'N' END AS new-col
FROM Foobar, ..
WHERE ..;|||On 13 Apr 2005 16:18:15 -0700, --CELKO-- wrote:

> Also why do you want to use VARCHAR(1); think about it.
You know, it would be nice if SQL implementations could just throw an error
message if you try to create a VARCHAR(1) column. :)

Thursday, February 16, 2012

Can a parameter act like an Access Combo box?

Hi - Is it possible to configure an SSRS parameter drop down to act like an
Access combo box? The user wants the drop down to auto-complete. Right now,
if the user types "P", the drop down goes to the first item that starts with
P, but then if he types "C", the drop down goes to the first item that starts
with C instead of going to the first item that starts with "PC".
--
Thanks,
JeffIam afraid no.
Amarnath
"Jeff Stroope" wrote:
> Hi - Is it possible to configure an SSRS parameter drop down to act like an
> Access combo box? The user wants the drop down to auto-complete. Right now,
> if the user types "P", the drop down goes to the first item that starts with
> P, but then if he types "C", the drop down goes to the first item that starts
> with C instead of going to the first item that starts with "PC".
> --
> Thanks,
> Jeff

Can a DROP TABLE statement be rolled back?

I'm interested in finding out if its possible to rollback a DROP TABLE
statement if it is inside a transaction that fails.
For some reason, I dont think it is but would like have someone confirm.
Thanks!
JohnnyNevermind my question. The answer is YES, it can be rolled back provided the
transaction is not comitted. My bad.
"Johnny" wrote:

> I'm interested in finding out if its possible to rollback a DROP TABLE
> statement if it is inside a transaction that fails.
> For some reason, I dont think it is but would like have someone confirm.
> Thanks!
> Johnny|||HI,Johnny,
U cannot rollback the drop table or delete command except if u execute
it if u use transaction number or savepoint.
As u execute the drop table a checkpoint occurs and the transaction is
commited by default.
U can aslo recover it if u have backup.
for my information on rollback
read books on line
hope this helps u
from
killer|||What you are saying is not true with Explicit transactions, which is the typ
e
of transaction I am referring to.
You can rollback a transaction (using BEGIN TRANSACTION & explicitly ended
with a COMMIT or ROLLBACK statement) as long as the transaction is not
committed. That is the whole point of transactions. Deletes, inserts, etc.
can all be rolled back provided the transaction has not been comitted.
Read the "BEGIN TRANSACTION (Transact-SQL) " topic in books online to learn
more.
"doller" wrote:

> HI,Johnny,
> U cannot rollback the drop table or delete command except if u execute
> it if u use transaction number or savepoint.
> As u execute the drop table a checkpoint occurs and the transaction is
> commited by default.
> U can aslo recover it if u have backup.
> for my information on rollback
> read books on line
> hope this helps u
> from
> killer
>|||You are right Johnny
The drop command is allowed inside a transaction only if the ddl in tran
option to sp_dboption is set to true
To set ddl in tran to true, enter:
sp_dboption database_name,"ddl in tran", true
you can found more information about that reviewing the next url:
*http://manuals.sybase.com/onlineboo...r />
iew/53001
regards
"Johnny" wrote:
[vbcol=seagreen]
> What you are saying is not true with Explicit transactions, which is the t
ype
> of transaction I am referring to.
> You can rollback a transaction (using BEGIN TRANSACTION & explicitly ended
> with a COMMIT or ROLLBACK statement) as long as the transaction is not
> committed. That is the whole point of transactions. Deletes, inserts, etc.
> can all be rolled back provided the transaction has not been comitted.
> Read the "BEGIN TRANSACTION (Transact-SQL) " topic in books online to lear
n
> more.
> "doller" wrote:
>|||There is no 'ddl in tran' database option in Microsoft SQL Server. Since
Johnny posted his question to a Microsoft SQL Server forum, chances are that
he is using MSSQL instead of Sybase.
DDL is always allowed within a transaction in Microsoft SQL Server. An
explicit or implicit transaction must be started in order to issue a COMMIT
or ROLLBACK. DDL can't be explicitly rolled back in autocommit mode.
Autocommit, explicit and implicit transactions are described in the Bools
Online <tsqlref.chm::/ts_ta-tz_2x2y.htm>.
Hope this helps.
Dan Guzman
SQL Server MVP
"Dan Hernandez" <DanHernandez@.discussions.microsoft.com> wrote in message
news:DAD308E2-D898-4C40-B811-AAE8C8CA74F1@.microsoft.com...[vbcol=seagreen]
> You are right Johnny
> The drop command is allowed inside a transaction only if the ddl in tran
> option to sp_dboption is set to true
>
> To set ddl in tran to true, enter:
> sp_dboption database_name,"ddl in tran", true
> you can found more information about that reviewing the next url:
> *http://manuals.sybase.com/onlineboo.../>
tView/53001
>
> regards
>
> "Johnny" wrote:
>

Can a DROP TABLE statement be rolled back?

I'm interested in finding out if its possible to rollback a DROP TABLE
statement if it is inside a transaction that fails.
For some reason, I dont think it is but would like have someone confirm.
Thanks!
Johnny
Nevermind my question. The answer is YES, it can be rolled back provided the
transaction is not comitted. My bad.
"Johnny" wrote:

> I'm interested in finding out if its possible to rollback a DROP TABLE
> statement if it is inside a transaction that fails.
> For some reason, I dont think it is but would like have someone confirm.
> Thanks!
> Johnny
|||HI,Johnny,
U cannot rollback the drop table or delete command except if u execute
it if u use transaction number or savepoint.
As u execute the drop table a checkpoint occurs and the transaction is
commited by default.
U can aslo recover it if u have backup.
for my information on rollback
read books on line
hope this helps u
from
killer
|||What you are saying is not true with Explicit transactions, which is the type
of transaction I am referring to.
You can rollback a transaction (using BEGIN TRANSACTION & explicitly ended
with a COMMIT or ROLLBACK statement) as long as the transaction is not
committed. That is the whole point of transactions. Deletes, inserts, etc.
can all be rolled back provided the transaction has not been comitted.
Read the "BEGIN TRANSACTION (Transact-SQL) " topic in books online to learn
more.
"doller" wrote:

> HI,Johnny,
> U cannot rollback the drop table or delete command except if u execute
> it if u use transaction number or savepoint.
> As u execute the drop table a checkpoint occurs and the transaction is
> commited by default.
> U can aslo recover it if u have backup.
> for my information on rollback
> read books on line
> hope this helps u
> from
> killer
>
|||You are right Johnny
The drop command is allowed inside a transaction only if the ddl in tran
option to sp_dboption is set to true
To set ddl in tran to true, enter:
sp_dboption database_name,"ddl in tran", true
you can found more information about that reviewing the next url:
*http://manuals.sybase.com/onlinebook...TextView/53001
regards
"Johnny" wrote:
[vbcol=seagreen]
> What you are saying is not true with Explicit transactions, which is the type
> of transaction I am referring to.
> You can rollback a transaction (using BEGIN TRANSACTION & explicitly ended
> with a COMMIT or ROLLBACK statement) as long as the transaction is not
> committed. That is the whole point of transactions. Deletes, inserts, etc.
> can all be rolled back provided the transaction has not been comitted.
> Read the "BEGIN TRANSACTION (Transact-SQL) " topic in books online to learn
> more.
> "doller" wrote:
|||There is no 'ddl in tran' database option in Microsoft SQL Server. Since
Johnny posted his question to a Microsoft SQL Server forum, chances are that
he is using MSSQL instead of Sybase.
DDL is always allowed within a transaction in Microsoft SQL Server. An
explicit or implicit transaction must be started in order to issue a COMMIT
or ROLLBACK. DDL can't be explicitly rolled back in autocommit mode.
Autocommit, explicit and implicit transactions are described in the Bools
Online <tsqlref.chm::/ts_ta-tz_2x2y.htm>.
Hope this helps.
Dan Guzman
SQL Server MVP
"Dan Hernandez" <DanHernandez@.discussions.microsoft.com> wrote in message
news:DAD308E2-D898-4C40-B811-AAE8C8CA74F1@.microsoft.com...[vbcol=seagreen]
> You are right Johnny
> The drop command is allowed inside a transaction only if the ddl in tran
> option to sp_dboption is set to true
>
> To set ddl in tran to true, enter:
> sp_dboption database_name,"ddl in tran", true
> you can found more information about that reviewing the next url:
> *http://manuals.sybase.com/onlinebook...TextView/53001
>
> regards
>
> "Johnny" wrote:

Tuesday, February 14, 2012

Can a dataset in reporting services return multiple datatables

Hi.

I am trying to access data from a stored procedure that returns data in form of multiple data tables. But when i drop this stored procedure in my rdl report, it just shows me the first data table returned by stored procedure.

I want to know that is there any way that I can view all the data tables returned by my stored procedure, or this is not possible in reporting services 2005.

This is not supported by SSRS 2005. You may be able make this work programatically i.e. build your own component to process multipe result sets.