How would you go about implementing record level security in SQL Server?
EDIT:
I've a requirement to restrict data based on user's privileges. Lets say I've a table of Contacts. I should be able to restrict the set of data that a user can see. Hope this helps :-)
...
Hi there,
Does anyone know of a way to see the SQL that would be generated by a migration (preferably without actually running the migration)?
Thanks!
...
I am trying to alter a table in SQL server with a script. In the past I have always done this kind of thing through a GUI, but now I need to generate a script to do it for customers.
I have an SQL Server database table that is like this:
MyTable
-------
ColA int NOT NULL
ColB int NOT NULL
ColC int NOT NULL
ColD VARCHAR(100)
The pri...
I recently found the following article:
http://www.tsqltutorials.com/with-common-table-expressions.php
The article doesn't list which version of SQL server this became available in. Does this work in SQL Server 2000 and if not what is the earliest version that it is usable in?
Update: I did try a quick test and the test doesn't work...
I normally use fully-explicit transactions in my stored procs (BEGIN TRANSACTION .... COMMIT). I just ran across an old one that instead uses "CHECKPOINT" at certain places in the code.
This won't do the same thing, right?? Even if the database is in simple mode, the whole thing will still run as one big transaction, even with a bunch o...
I am just starting to use XML within SQL Server 2008. I have the data in the XML, but I am having a hard time finding good examples of querying the data. Can someone point me to a good place to start? For example, I would want to find all rows within SQL server that contain a certain criteria within the XML like all rows where the XML...
Hey guys,
I am trying to use the Contains operator. It works fine with test data eg.
WHERE CONTAINS(file,'"*ash*"')
However, I want to get the keyword from a TextBox using something like CONTAINS(file,'"*@key*"'), but this doesnt seem to work. Any suggestions please.
Thanks
...
I have got a normalized transactional database. I am setting up a data warehouse for reporting purposes. Are there any tools which will automatically make de-normalization suggestions? Or something to automate database changes in that manner?
...
I'd like to know your experience(s) with replacing SQL Server cursors in existing code, or how you took a problem that a procedural guy would use a cursor to solve, and did it set-based.
What was the problem the cursor was used to solve? How did you replace the cursor?
...
Hi there
What is best approach of joining 2 tables from different Database? In my situation, I have a development database that has postfix such as _DEV while on the production has _PROD.
The issue is that if I join these 2 tables I have to reference a full database name such as DB1_DEV.dbo.table1 INNER JOIN DB2_DEV.dbo.table100
Work ...
Is there a way to get a value of a local variable specified by its name dynamically in SQL Server SP?
declare @foo int
declare @bar int
declare @variable_name varchar(10)
set @variable_name = '@foo'
print -- magic happens here - how to print the value of the variable
-- which name is stored in @variable_name, in this case @foo
...
We are in the process of a multi-year project where we're building a new system and a new database to eventually replace the old system and database. The users are using the new and old systems as we're changing them.
The problem we keep running into is when an object in one system is dependent on an object in the other system. We've b...
When using Sql Server to store and manage the SessionState, is the session data stored in the database using encryption?
When I look at the data in the ASPNet database, the data in the "SessionItemLong" in the ASPStateTempSessions columns appears to be hexadecimal data. Is this data being encrypted before being stored in the database? ...
How can i resolve a hostname in t-sql? a 2000 compatible method is preferred. Although something that works on 2005/2008 would also be helpful.
eg. If i have the hostname stackoverflow.com i want to return 69.59.196.211
...
i am trying to create a table with a row where id=0 but the identity insert column starts at 1,1 so all following use the identity insert
i have to execute
DBCC CHECKIDENT ('Foo', RESEED, 0);
after i manually insert (using a script) to get the next row to have id=1
is there another way to get id=0 for my first row which is from the i...
Hi guys
This is a sample of the data that I have.
-ID- -Rank- -Type- -Status- -Amount-
1142474 2 Under Offer Approved 23
1148492 1 Present Current 56
1148492 2 Under Offer Approved 3
2273605 1 Present Current 24
Where the ID is the same I only want the record with the highest rank. So the end result of the query....
Can I create a java stored procedure in MS SQL Server 2005 like in Oracle or DB2?
...
I am running a bunch of database migration scripts. I find myself with a rather pressing problem, that business is waking up and expected to see their data, and their data has not finished migrating. I also took the applications offline and they really need to be started back up. In reality "the business" is a number of companies, and th...
In MS SQL Server, the Database Properties dialog has the "View Connection Properties" link over on the left. Clicking that brings the "Connection Properties" dialog with properties of the current connection, such as Authentication Method, Network Protocol, Computer Name, etc...
Is there a way to get that information programmatically by ...
How to Get a Min and Max column value for the Modified date
I want to select top and bottom column value for the particular date.
Table:
**DATE** **MODIFIED DATE** **VALUE**
03:02:2009 04:02:2009 100
03:02:2009 04:02:2009 200
03:02:2009 04:02:2009 400
04:02:2009 05:02:2009 150
04:02:2009 05:02:2009 200
04:02:2009 05:02:2...