Selective Objects

Oct 20, 2007

I'm in the current mode of migration from WIn2k and I 'm trying to setup user where they are only allowed access to one table.

If I grant thenm read /write access to the db they can obviously see all of the db due to the size of the db I do not wish to go down the root of denying every table as there is over 100. Is there an easier way??

View 4 Replies


ADVERTISEMENT

Selective ORDER BY?

Apr 6, 2008

Hi. I have a SQL statement currently ending with "ORDER BY sc.TypeID, sc.ObjetID DESC"where the TypeID can be of value 1,2,3,4,5,6,7,8, 9 and 10. What I would like to achieve is to selectively order the datas by TypeID, meaning in this case that I want ALL the TypeID of value "1" to come first and then all the rest ("2" and higher) un-ordered. This is important that the rest remains unordered by their TypeID as I only want them to be ordered by their ID (ObjetID DESC). Is that possible? If yes how?Thank you.Francis

View 4 Replies View Related

Selective Restore

Feb 3, 2004

Hello all,
Is there a way to do a selective restore? I need to create a dev db and the prod backup is 17 gig and I have a space crunch on the server. My idea was to restore the complete backup and subsequently shrink the db size after truncating data in tables which are not frequently used? Is that a good idea. Any help will be appreciated.

Thanks in advance!

View 1 Replies View Related

BCP Selective Export

Jan 10, 2006

Hi,

I need to be able to export from an existing database, all fields with a certain column id. I have been pointed in the direction of bcp, however I am having difficulty finding the right syntax.

Thanks,

D.

(P.S. MSSQL 2000 Server)

View 6 Replies View Related

Selective Update

Mar 6, 2007

I have
table T2
id amount ss
1142
2151
3162
4172



table T3


idamount ss
131
142
251
362
472
481
491



I run
UPDATE t2, t3 SET t2.amount = t3.amount
WHERE t2.id1=t3.id and t3.ss=1;

T2 becomes

ID1amount ss
132
251
3162
492


but I want t2 to be

ID1amount ss
132
251
3162
4 82
how can I do that?
Thanks

View 4 Replies View Related

Selective Replication

Feb 6, 2007

Is it possible to use replication for inserts and updates only for some tables and inserts updates and deletes on others. I want to be able to delete data from the source database but not my replicated database. Does anyone know of a way to use replication to facilite this?

Thanks for any input you can provide.

View 5 Replies View Related

Putting Names Of Objects To Control-flow Loop Creating Objects

Dec 27, 2006

please help newbieI need to create a lot of objects the same type (let's say: schemas)I wish to use paramerized block in loop to do so.- how to put names of my objects to such control-flow?belss you for help

View 5 Replies View Related

Selective Comparisonv In Where Clause

Jun 13, 2002

I was trying to use the case statement in where clause so that the comparison (> , <, =) can be made depending upon the value of the local variable @fl.



PLease tell me how to do that. Or suggest me how can I make selective comparison (<,>,=) in where clause depending upon a local variable. Please note that I donot want to use if/else satement and write select statement everytime based on the local variable as in that case the code length will be huge. Please suggest me a coensized query.


SQL that I queried:

use pubs
go

declare @fl int

select fl = 3

select * from titles
where case fl when 1 then price > 90
when 2 then price < 90
when 3 then price = 90
end

The following error is given

Server: Msg 170, Level 15, State 1, Line 7
Line 7: Incorrect syntax near '>'.

View 2 Replies View Related

Selective Data Transfer

Oct 25, 2000

Can I transfer data from one database to the other for only selected records

pls help
thanks
sunthar

View 1 Replies View Related

Restore Selective Tables?

Jun 1, 2004

HI,
Is it possible in SQL Server to restore Databases partially?
In the sense, I want to backup just 2 tables from a database & restore them, instead of having to take a backup of the entire database & restore the entire database.

One way to do would be to export data & then importing data for only those selective tables, but I dont want to do that, bcause that would probably take more time & can be error prone.

Thanks
Raman.

View 4 Replies View Related

Selective Row Copy Between Tables

Sep 13, 2007

I need to 'copy' selective (filtered) rows from table 'A' to table 'B' on a regular basis, but only if they do not exist in table 'B'.
If rows get deleted from table 'A' they must remain table 'B'. If rows change in table 'A' (unlikely) they should be update in table 'B'

What feature of SQL should I be using?
- triggerering a stored procedure on Insert
- replication
- SSIS

View 1 Replies View Related

Selective Filtering Of Rows

Nov 13, 2006

Hi.

I am using Visual Studio 2005 professional and SQL Server 2005 Express Edition.

I am having a bit of an issue at the moment with my project. I have a large SQL server database (over 600,000 rows of data decoded from a text datafile and stored by my C# program) where I need to select a series of distinct rows.

I have a datacolumn of varchar(10) called UID which is assigned to every row in my database. It's not a unique code so it can happen several times. By selecting a specific UID code, I can narrow down my selection to a specific range of rows (which are incremental in order). This range will contain many names.

What I want to do is find a UID which will have one of two names. I have so far done this:

SELECT DISTINCT F1.UID FROM MyDataBase F1
INNER JOIN MyDataBase F2 ON
F1.LineIndex < F2.LineIndex AND
F1.UID = F2.UID AND
F1.Names IN (Bob', 'John', 'Peter', 'Sarah', 'Anne', 'Stewart', 'David', 'Alan', 'Linda') AND
F2.Names IN ('Bob', 'John', 'Peter', 'Sarah', 'Anne', 'Stewart', 'David', 'Alan', 'Linda')

This will return any UID which contains at least two of these names. The LineIndex ensures that the comparison doesn't happen on the same row of data (it's a column set to type int with IDENTITY(1,1) which is also my PRIMARY KEY). This is partially what I want, the selection of UID rows which will have at least two names from the list. Also, the same name will never appear twice in the same UID list.

Now, the problem I am facing is that I want a select a UID range with names in the order I have specified, so if I want a UID list where the names I want are Peter and Linda, I only want to return a set of UID rows where Peter appears earlier in the returned rows than Linda.

It is possible that other UIDs have the same names, but in reverse order, starting Linda, Alan, David etc...John, Bob. I would want to discard these entries.

Can anyone please give me any hints as to how I could get around this?

Thanks in advance,

Sean

View 5 Replies View Related

Selective Row Group Display...

Mar 31, 2008

I've got a report linking to a SSAS cube. It has 2 row groups Region and Country. The Country group is a subset of the Region group and works fine, it collapses and expands ok.

Now, due to a boss who doesn't like the way this looks, I have to find another way to display it. I was wondering if it is possible to have a report parameter that could be selected and the appropriate column grouping be displayed depending on the value.

i.e. User selects Report Parameter value 'Region' and the Region row group becomes visible, the Country group becomes invisible. The exact opposite happening if the user selects Country.

I can't find any obvious way to do this. Any ideas?

Rob

View 1 Replies View Related

SQL Server 2012 :: Select Data From XML - Objects Within Objects?

Nov 20, 2013

passing serialised objects to a stored procedure for the purpose of data inserts. I see this as being a way to handle multiple row inserts efficiently.

However, in my limited use of XML data I am not so sure how to link the data when I have a dependency on another "object" within the serialised XML.

Below is a code snippet showing what I have so far.

The first insert statement works fine - but how to retrieve the identifier created by the DB - I want to use an SQL statement that finds the record in the table based on the XML representation (of the PluginInfo), allowing me to insert the ConfigurationInfo with the correct reference to the PluginInfo

DECLARE @Config NVARCHAR(MAX)
DECLARE @Handle AS INT
DECLARE @TransactionCount AS INT
SELECT @Config = '
<ConfigurationDirectory >
<ConfigurationInfo groupKey="Notifications" sectionKey="App.Customization.PluginInfo"

[code]....

View 1 Replies View Related

Selective Updates For Rows Where A Col = A Col In Another Table

Sep 5, 2000

Hi,

I am trying to do selective updates for rows where a column matches a column in another table. I want to do something like this, only 'this' does not work, and nothing else I could think of (I tried joins also) worked. What am I missing? I hope this explanation makes sense.

UPDATE queryresultsmodel SET queryresultsmodel.tableforcedoutdate = getdate()
Where Exists (Select tablename from queryresultsmodel q inner join orphanul o on q.tablename = o.name)

Thanks for any help,

Judith

View 1 Replies View Related

Selective Updates Based On User

Nov 27, 2007

We have a Table that contains a schedule. The schedule has certain pieces of information that are required to be updated by certain members of the
organization, specifically Shift, Start Date, and Line. Each record also has a column for the customer that it is for.

The schedule has a Column, [CSR] which lists the name of the person who is responsible for updating it. Format of that is domainnamejohndoe

What we would like to do is block domainnamejohndoe from being able to update or insert on any of the records that he is not responsible for.

So if he attempts to change the shift for example, it denies the change and possible pops up an error indicating that the change was blocked because he is not the responsible party.

Input in this is through a query which views the table data in MS Access. It cannot be moved to a Form without some serious redesign, so I cannot put the block in there. I assumed that this could be blocked with a Trigger that checks the [CSR] column, matches it to the logged in user through the suser_sname(suser_sid()) and then either allows or denies the update.

So is this a viable idea, or should I explore the move to an input form and make the change there in MS Access via VBA.

At first we started with just an audit trail, but I started to think that the audit trail would be needed only for records that should be allowed to be changed and that we should deny changes to those who are not allowed to make them.

Below is the audit trail trigger, I figure that the change should occur somewhere within that first IF statement, or make the first IF the second, and the first should be the permission check.

At this point I am stuck as to how to block the updates. I tried using Deny but that was not working. Filtering the results by only showing the logged in user their records is not an option as they need visibility to the entire schedule.

This is for SQL 2000 SP4/Windows 2000 SP4


CREATE TRIGGER audit_mschange
ON dbo.T_PP_Table_2
FOR update AS
IF (UPDATE([Start Dt]) OR Update(shift) or Update
(comments)
or Update(status) or Update (line))
BEGIN

INSERT INTO T_MS_RB_AUDIT

(ord_no,line_tank_old,line_tank_new,shift_old,shif t_new,comments_old,comments_new,status_old,status_ new,trx_dt,trx_username,
start_dt_old,start_dt_new)

SELECT ins.[PP Ord No],
del.line,ins.line,
del.shift,ins.shift,
del.comments,ins.comments,
del.status, ins.status,
getdate(),
suser_sname(suser_sid()),
del.[Start Dt],
ins.[Start Dt]
FROM inserted ins, deleted del
WHERE ins.[PP Ord No]=del.[PP Ord No] AND
ins.autonumber=del.autonumber AND
(ins.status <> del.status OR ins.[Start Dt] <>
del.[Start Dt] or ins.status <> del.status
or ins.comments <> del.comments or ins.line <>
del.line )
END

View 11 Replies View Related

SQL 2012 :: SSRS Run Selective Pages

Jun 26, 2015

Say I have a report with 3 pages, each page has a different dataset and takes some processing time.

is it possible to give the user the option to just run the first page say if thats all they need?

Reduce the processing time of the report to only that that is necessary?

View 2 Replies View Related

Selective Rows Returned From Select

Jan 25, 2006

Hi,

I have a problem that I would like help with.

I have to write an SQL Server 2000 stored procedure that returns rows from a table (a SELECT with an ORDER BY). A front end system calls the stored procedure and displays the returned rows. If there is more than one screen's worth of data (ie more than 20 rows returned from the table) then there is a requirement that the stored procedure only returns the rows for the screen ie, for screen 1 I need to return rows 1-20, for screen2 I need to return rows 21-40, screen 3 = rows 41-60.

The screen number will be passed into the stored procedure so I can work out what rows to return, the only problem is how can I tell SQL Server to only select the required rows (ie, say rows 21 to 40 from the returned rows). I can't see any arguments that allow selective rows to be returned (apart from TOP).

Any ideas??

Regards,

Chris

View 3 Replies View Related

Secure/selective Data Access

Jul 23, 2005

Dear netters,We are looking to build a SQL Server database that will be hooked up toa Web server (WebLogic or a .NET).The database will house data for multiple customers, and therequirement is to have no customer see other customer data. Web serverwill be responsible for authenticating users (ids and passwords will bemaintained there/possibly stored in the database, but will not beactual database logins) -- and establishing pooled connections to thedatabase, using some sort of a proxy login.Ideally, we do not want to have the database itself visible to "theworld", it should reside behind a firewall, and be accessible throughthe Web server, which will do all authentication and routing.We want to have either tables or views defined in such a way that:1. Users can only see their own data and NEVER can see anybody else's.2. Users' access to the database is logged (this includes updates aswell as queries).3. We would like to provide some sort of a reporting mechanism -- whereusers can form their own queries. So, something like a Crystal or anAccess front end, that users are typically familiar with... The problemis that this requires users having direct access to the database (?),and opens up tables (unless, there is a way to create parameterizedviews that will always restrict access to a subset of records).Any advice on how to best implement this is greatly appreciated.Thank you in advance!

View 4 Replies View Related

Selective Replication Of DELETE Transactions

Jul 19, 2006

I am beginning design for a project to maintain an on-line archive of historical data for a production database, and then truncate old, rarely-used data from the production database. I am considering a method whereby we (A) replicate data changes from the production database to an archive database and (B) truncate old data from the production database according to predetermined business rules.

I am trying to determine whether SQL Server merge or transactional replication can be used to accomplish the replication portion of this requirement.

Given this scenario, there are two types of modifications that are made to the production database: (1) application inserts, deletes and updates which should be replicated, and (2) truncation deletes (as described in "B", above) which should not be replicated.

My question is: Will I be able to control the replication process such that application deletes are replicated, but "truncation" deletes are not? Could static row filters somehow be used to accomplish this?

View 6 Replies View Related

Selective String Search Against DateTime Field

Jun 9, 2008

Hi all.

I have been banging my head against a brick wall with this for a couple of days now. I am wrighting a custom front end for one of our SQLServer DB's and need to run a select agains the DateTime Field. The field Format is [DD/MM/YYYY HH:MM:SS]. I am tring to get the select to pull all the records on a set date only (keeping the time available but not selecting against it) so that the brass can see at what time on a given day an action was performed. Problem is, the way the programing software works, I can only build the SQL using string information. I have tried CONVERT and CAST both ways (converting the date to varchar and converting the string to date and also converting them both at the same time). Everything that I have tried returns an empty data set when used with the WHERE LIKE criteria (oh yeah, I'm also using LIKE % wildecards to retrive all the times against a specific date) but does populate when no filter is applied.

This is where my SQL is at just now:

SELECT Files.FileID, Useres.UserName, FileStatusLog.StatusCode, FileStatusLog.StatusDate
FROM (Files INNER JOIN FileStatusLog ON Files.FileID = FileStatusLog.FileID) INNER JOIN Users ON FileStatusLog.UserID = Users.UserID
WHERE (((CONVERT(varchar(10), FileStatusLog.StatusDate,103) LIKE '%{variable}%'));

This also returns an emtpy data set when the LIKE is replaced with ='{exact date entry in format: DD/MM/YYYY}', but does return the full table when the WHERE is removed and also when the LIKE is set to just a bare '%' with no other filter values.

Because of the fact that the results are returned when LIKE '%' is used I am not even sure if it is the CONVERT that is causing the problem. I have even tried assigning the escape character manualy to '+' incase the / values of the date in the LIKE variable where escaping other characters. Needless to say this did not make life any better.

As you may have noticed already SQL is not exactly my strong suit, but no one else here even knows what it is, never mind what it's used for, so I got droped with the task. Also - The DB was created by a third party so I have no write permissions to the DB.

Any help with this would be greatly appreciated as it's gotten personal now

Thaks in advance for any assistance

View 6 Replies View Related

SQL 2012 :: How To Do Selective Read Of File Stored In File Table

Jul 2, 2015

I have a filetable that contains a binary file. I need to do a selective read of the file stored in the file table. I can write a C# CLR function that will open the file, read n bytes the from a starting byte. Or I can write a SQL statement that reads the stream in the filetable into a VARBINARY variable using SUBSTRING beginning at the starting byte (offset from 1) for the same n bytes.

Both give me the same result. However, the SQL statement takes considerably longer to read. I know there is overhead in reading through SQL (interpreted language), but the difference in performance is substantial, and I can only attribute this performance degradation if SQL first tries to "load" the entire stream before it identifies the portion of the stream that it needs to read beginning at the starting byte offset.

I wonder if this is the case or if there is another option to read a stream from a filetable directly through SQL queries that is more efficient.

View 3 Replies View Related

OLE Objects

Aug 27, 2001

Hi, there,

I use VB to make an dll file and register on my local PC, then use sp_OACreate to create OLE object on local SQL server, it works fine. But when I register that dll on other SQL server, it dosen't work, anybody have idea about this? Thank you.

Tony

View 1 Replies View Related

How To Use Objects??

Jul 17, 2000

I see these type of objects in Books on Online. I was just wondering
if anyone knows how to use these objects, seems to have lot of good
information. Could these objects be called in VB?

--------------------------------
CreateDate Property (SQL-DMO)
The CreateDate property indicates the date and time the referenced SQLServer object was created.

Applies To
Database Object Table Object
DBObject Object TransactionLog Object
Default Object Trigger Object
Rule Object View Object
StoredProcedure Object


Syntax
object.CreateDate

Part Description
object Expression that evaluates to an object in the Applies To list


Remarks
The string returned is formatted by using the locale setting of the workstation.

Data Type
String

Modifiable
Read-only

Prototype (C/C++)
HRESULT GetCreateDate(SQLDMO_LPBSTR pRetVal);
--------------------------------------------------------

View 1 Replies View Related

Sys.objects

Sep 21, 2007



Anyone know how to grant a user to see all data in sys.objects view?

Thanks.

View 1 Replies View Related

Sys.objects

Sep 21, 2007



Anyone know how to grant a user (who is not a sa) to see all data in sys.objects view?

Thanks.

View 1 Replies View Related

COM Objects Under 64-bit?

Jan 25, 2007

Hi everyone,
 
Primary platform is Framework 2.0 under 32-bit
Production platform will be Framework 2.0 under 64-bit.
 
I'm concerned about what object should I use in order to launch DTS 2000/7.0 from our .Net service.
 
Currently it tested fine from a 32-bit environment (sql server 2005 as backend).
 
Reference: "Microsoft DTSPackage Object Library"
Physical file:  dtspkg.dll
 
My wonder,  is there any limitation when it's gonna to work on 64-bit?
 
Generally speaking, any limitation/issue/drawback for COM objects under 64 bit??
In my project properties appears Any CPU, x86, x64. I've got now Any CPU.
 
Thanks for your advices,
 
 

View 13 Replies View Related

Closing ADO Objects

Apr 4, 2007

I know it's "best practice" to dispose ado.net objects, but does it make a big difference if just the connection is closed? In other words, is the code below good enough or should the DataAdapter & Command be explicitly closed?using (SqlConneciton  cn = new SqlConnection(connstr)){ SqlDataAdapter da = new SqlDataAdapter(sql,cn);DataSet ds = new DataSet();da.Fill(ds); SqlCommand cmd = new SqlCommand(someOtherSql,cn);cmd.ExecuteNonQuery();  } 

View 2 Replies View Related

Objects In SQL Server

Jun 16, 2008

Hi,
I am a Database called "Cache"  user and in it and when creating a new table I can create a column of type Object.
So basically, I can create an object eg. Address that have the following items StreetNo, StreetName, PCode somewhere in my database; then create a table called eg. Employees that have a column called EmployeeAddress of type Address (as my Address Object). Can this be done in SQL Server!?
 
 
Thanks. 

View 4 Replies View Related

Managed Objects

Mar 21, 2006

Hello people :-)I'm doing some development work with Visual Studio 2005 and SQLServer 2000. My SQL DB is running on a Windows 2000 Server box in the office, and I'm doing the development on my XPPro workstation. Now I've been trying to connect to the Win2000 box though VS and although I can see the server and the DB when I hit ok I get this error"The SQL server specified by these connection propertise does not support managed objects"What the heck does that mean?any help would be great :-)

View 1 Replies View Related

Protecting Objects From Even The SA

Feb 22, 2001

I am currently writing a VB app based around a SQLserver2000 database. I have used stored procedures wherever possible to select/update/delete data. I am planning to distribute this app and wonder whether there are any tricks out there for encrypting/setting security so that even the SA account would be unable to read my stored procedures, but obviously be able to execute them?

There are two scenarios - one is where I want to let someone borrow a laptop just for a few days for a demo. Presumably I just give them an unprivileged user account without interactive logon possibilities, by which I mean Enterprise Manager and the other SQLserver Client tools [can I do this?] and control all access from the app.

The other scenario is when the app is purchased and I no longer have control of the SQL Server nor the SA account.

Any pointers would certainly be very useful indeed. Thanks.

View 1 Replies View Related

Export Objects

Jan 2, 2002

Hi all, I know we can use DTS package to export or import objects from one db to another. Now I need to write a procedure that will perform similar functionality. Any thoughts on this? Thank you!

View 2 Replies View Related

Transfer/Objects

Jul 26, 2000

Hi,
I am in the process of upgrading database in sql server 6.5 to 7.0.
For that i am following one computer upgrade.
For creating dev environment in my computer i am using Transfer/Objects in 6.5
for transferring database from remote(production) computer to my computer.

Do i need only to transfer Userdatabase alone or do i need to Transfer Master and other ?
Or Is it better to restore dump ?


Thanks

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved