sql-server

sql server table partioning- is this correct?

read many sites, guides, etc note :- cannot test what i am asking as do not have two computers :) so asking.. table partitioning simply means that the table is logically divided, such that a particular range is handled by a particular partition only there by reducing load and also allowing parallelism. there is a mention of partitions...

What's wrong with my SQL? (find a "previous" record)

My SQL-Query should return a previous record(Claim). Previous means that it has a different primary key (idData), an equal SSN_Number and an earlier Received_Date. The problem is that the Received_Date could be equal so I have to look for another column. The priority should be the same as the Sort-Order. What am I doing wrong, because th...

Delete records within Instead Of Delete trigger

I want to have an instead of delete trigger so that I can get text field values out of the table row that's being deleted to preserve those fields when the actual delete occurs. For some reason I can't pull them from the Deleted table in a standard Delete trigger (SQL errors out). Is there a way to do an actual delete within in an "inst...

.NET coding setup with needed to install SQL Server ? (VS2010 + Linqpad)

I was thinking of the minimum software I can install on my new dev machine. Has anyone tried codeing with just VS2010/Linqpad? The SQL Server is on another machine so then I would only need SSMS.. but then I think linqpad could replace that + help me with Linq queries.. But the problem seems to be I won't be able to CREATE SQL USERS w...

Develop both SQL Server 2008 and SQL Server 2008R2 reports on same dev box

We have a large real-estate of existing SSRS 2008 reports that we are still maintain in production. However we are evaluating SSRS 2008r2 and would like to start developing reports that take advantage of the new features such as shared datasets etc. The problem is that AFAIK installing the tools for 2008R2 upgrades the Visual Studio 200...

SQL Server: why are sizes of different backups the same?

I am running a script every day (only 2 days so far) to back up my database: sqlcmd -E -S server-hl7\timeclockplus -i timeclockplus.sql move "C:\Program Files\Microsoft SQL Server\MSSQL.2\MSSQL\Backup\*.*" w:\ Why is it that backups from two different dates have the SAME EXACT size in bytes?? I know for a fact that the database was de...

Error when Saving into SQL Server

So here is the error... An error occurred while saving the Panel. System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index at System.ThrowHelper.ThrowArgumentOutOfRangeException() at System.Collections.Generic.List`1.get_Item(Int...

use uniqueidentifider as primary key

Is it a good idea? would the use of it slow down my database compared to an integer field as primary key? ...

Building the Business Rule Engine using SQL SERVER

Hi, I have a requirement to build a Business Rule Engine. I use the SQL SERVER 2005. The business rules are massive, like 2000 pages long. eg. If col1 = 'xyz' then populate col2 otherwise not. if col3 = 'abc' and col4 = 'def' then col5 = 'ghy' etc. etc. So, I think we can't just write all those rules in if else condition in a proc...

run sql query from two tables with where clause from one table

I want to get records from one table based on a record from another table. They both have SSN fields and I want to link them by SSN. Here is a rough example what I want to get: SELECT SUM(Table1.Payments) FROM Table1 WHERE Table1.SSN = Table2.SSN AND Table2.City = 'New York' I want to get the sum of the payments by a variable...

SQL Server 2008 log file size is large and growing quickly

Most of the time users will hit the database to read news. There are very few number of queries executed under transactions. 95% of the database hits would be for read-only purposes. My database log files size is growing 1 GB per day. Even if I shrink the database, the log file size is not decreasing. What could be the reason for growi...

filter dataview by user id using sharepoint desinger 2007

i don't know if i can explain this good. i want to add a data view in my wss3 site using the sharepoint designer. this dataview has the vacation days of an employee. now by using windows authentication my user log in to the wss3 site. the employee open a page where he can view his vacation days. now i want that dataview to show the ...

stored proc recursion in SQL Server

I have a situation where I want to have a stored proc returning a table that calls itself recursively as part of its calculation. Unfortunately SQL Server is having none of this and gives me an error along the lines of both being unable to declare a cursor that already exists and about not being able to nest and insert exec statement....

Design Strategy: Query and Update data across 2 different databases

Hi We have a requirement in which we need to query data across 2 different databases ( 1 in SQL Server and other in Oracle). Here are the scenarios which need to be implemented: Query: Get the data from one database and match for values in other Update: Get the data from one database and update the objects in other Technology that...

two triggers on insert of same table

Here is one very interesting problem. I am using SQL Server 2008. I have two triggers on one common table say 'CommonTable'. one trigger is on update and other one is on insert/update/delete. In first trigger "Trigger1", I do the checks/rollback sometime change the new inserted value based on business logic. here is sample code - CR...

Insert record only if record does not already exist in table

I'm wondering if there is a way to insert a record into a table only if the table does not already contain that record? Is there a query that will do this, or will I need a stored procedure? ...

Open report link URL in new window in SSRS does not work

I am running SQL Server 2008 R2 Reporting Services in SharePoint 2010 integrated mode. I am trying to set the action (navigation) for a text box to go to a URL and open an new window and ultimately pass a parameter to it. However, I am not even able to open a simple URL in a new window. This is what I have been trying for the expression:...

UPDATE records in a table except the TOP 1 record

Hi All, I have business scenario as We will get all the data to the database including the duplicates If we have any duplicated in a table take the most recent record from duplicates on perticular key by making all the remaining deplicate records flag to 'X' While processing to the next level filter the extraction by flag != 'X' so we...

SQL Server - what permission need to open for view a table schema in a linked server

After creating a linked server on SSMS 2008, how should I see linked server table schema? Should I change any permission on remote SQL Server? Also, what commands can check those permissions for all accounts? Thanks. EDIT: running on SQL Server 2000. ...

SQL Server 2008 cannot define decimal type with 4 decimal places?

I am using SQL Server 2008 express, any reason?? however, if i convert to decimal(6,4) is work. e.g. Select CONVERT(decimal(6,4),'1.1234'); thanks you. ...