sql-server-2005

Create db Synonyms that include login credentials

Hey there I'd like to create a synonym on a local db that points to a db on the web that's only accessible with a user name and password. Is there a way to set up a synonym for that kind of situation? I would be very grateful for an example if this is even possible... Thanks ...

Cannot connect to MDF file using VS 2008 Server explorer

Hi, as mentioned in title. Another details: file is in on my hard drive in App_Data directory I have Microsoft SQL Server 2005 on my localhost installed (full, not Express edition) When I try to connect to file using Server explorer Microsoft SQL Server Database File I get an error: network-related or instance-specific error occ...

Precision of SQL Getdate?

I am experimenting with a program that inserts data into an SQL 2005 Server database (on XP SP3) at high rate of speed. (This is for collecting timing data so I can evaluate different aspects of my design). My basic set up involves inserting a data into a table like the following (and using an SP that just specifies the payload field...

How to perform a select in a single statement?

I have a Sql Server 2005 table with following data: idHearing is the primary key (identity), idCase is a foreign key that may duplicate. StartDate and StartTime specify the date and time of the event - both fields are of DateTime type (for whatever reason these are separate fields). All StartDate data has a time of 12:00:00. All St...

Modify FindAll function to a DoesExist function in SQL Server

I have the following recursive function: ALTER FUNCTION [dbo].[ListAncestors] ( @Id int ) RETURNS TABLE As RETURN ( WITH cte As ( SELECT UserId, ManagerId, Forename, Surname FROM dbo.Users WHERE Use...

Any merit to preloading data into memory?

We have a database on a server with enough RAM to hold the entire db. Is there any merit and/or drawbacks to preloading the data into memory after a long period of inactivity? Other factors during this nightly process: Balance data are recreated from another app/database/server. Indexes and stats get refreshed full backup to disk then ...

Transaction in VS2008 and SQL Server 2005 Stored Procedure

If I'm already using transactions in my stored procedure, is it feasible to use transactions in VS 2008 to call the procedure multiple times? What I am trying to do is re-use my insert single record stored procedure which already uaes transactions. I want to insert multiple records using this insert single record stored procedure, and r...

It's possible to assign at variable a value returned from exec @sql???

i need thing like set @var= exec calculate 'param' are this true ...

Accessing a SQL Server 2008 Express Database Using TCP/IP

VS 2010 comes with SQL 2008 Express, and upgrades existing project's databases to SQL 2008 as well (please correct me if im wrong!) - however, I now have a problem - I need to simulate a hosting situation on my PC, where a desktop application connects using TCP/IP to the SQL 2008 database. Problems 1. The database as created in VS 2010 ...

SQL Server Enable Active Directory User

I work at a college a change to policy is Students windows accounts are now disabled upon creation and are only enabled upon them passing a test. Don't ask So I can easily modify my DSADD with -disabled yes However I need to enable them when they pass the test. I obtain the test results from a sql server so is it possible to enable the...

Sql srver 2005 time conversion from american to indian time

Can you tell me how to convert the american time to indian time. Just give me the function that converts the american time to Indian time. The time difference is 11.5 hours ...

SQL Constraint IGNORE_DUP_KEY on Update

I have a Constraint on a table with IGNORE_DUP_KEY. This allows bulk inserts to partially work where some records are dupes and some are not (only inserting the non-dupes). However, it does not allow updates to partially work, where I only want those records updated where dupes will not be created. Does anyone know how I can support I...

Are there any advantages to use varchar over decimal for Price and Value

I was arguing with my friend against his suggestion to store price, value and other similar informations in varchar. My point of view are on the basis of Calculations will become difficult as we need to cast back and forth. Integrity of the data will be lost. Poor performance of Indexes Sorting and aggregate functions will also need c...

How to register assembly in Net Framework 4.0

I have an net assembly that was originally written in framework 1.1. I have complied this with a framework 4.0 and need to put in the GAC There is no Framework configuration tool (Administrative Tools/Microsoft .Net Framework n.n Configuration any longer. How do I view/Manage Framewok 4.0 GAC assemblies. I am using this assembly with S...

Is it possible to query the system databases in SQL server without using the names?

When doing a query over several databases in SQL server (2005+) I find it sometimes necesary to exclude the system database (master, model, tempdb, msdb and distribution) Is there any OTHER way to filter these besides where name not in (''master', 'model', 'tempdb', 'msdb', 'distribution') I've looked at sys.databases and master.dbo...

SSIS incorrect datatype at Excel destination from SQL database 2005

I'm hoping someone can help me, I've explored google to death and I just can't seem to find the answer. I'm new to using SSIS, so I don't know if this is possible...I am exporting data from SQL server database to an Excel file, which works well but it exports all numeric as string. I then have to go in a manually convert it to numbers....

How to add a identity column that is unique per grouping.

Say I have 2 columns Product Product_Cat ------- ----------- Cat 0 Dog 0 Potatoes 2 Carrots 2 Laundry 1 Bird 0 I want to add on a 3rd identity column but I want the numbering to be unique per Product_Cat So the output would look like Product Product_Cat Cat_Ident ------- ---------...

Unique Index Error when creating non-unique index - SQL Server

I trying to and a non-unique index to a table table in SQL Server 2005. I am getting the following error when I try to create it. Msg 1505, Level 16, State 1, Line 1 The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name 'dbo.oe_pick_ticket' and the index name 'idx_pick_ticket_popup_wmms...

Analysis Server Properties using MDX

hello Friends How can I return Analysis Services properties which is stored in the XML using MDX?? ...

Error - SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.

i have an app written for 2008. We are using linq to entities. We've now had to switch the DB to 2005. I am getting the following error on linq SELECT queries: Error - SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM. The offending line is: DateOfBirth = ((s.Date_Of_Birth == null) || (s.Date...