sql-server

Is it possible to use relative paths for SSIS packages dtsConfig files?

I am trying to make our SQL Server Integration Services packages as portable as possible and the one thing that is preventing that is that the path to the config is always an absolute path, which makes testing and deployment a headache. Are there any suggestions for making this more manageble? Another issue is when another developer get...

SQL user can only run proc, but that proc can do anything

In SQL Server 2005, I want a user, called LimitedUser, to only be able to run one proc: GRANT EXEC ON [usp_RunETL] TO [LimitedUser] However, that proc needs to be able to do everything -- UPDATE, DELETE, INSERT, EXEC.. everything. How do I do that without having to give all those permissions to LimitedUser? ...

Can SQL Server 2005 Express perform full backups?

I need some help for executing my planned backup strategy. My database is about 1 gig in size. I want to perform a full backup once per week, and incremental every hour. Is all of this built into SQL Server 2005 Express? Is it possible to roll over the backups so I only keep 1 months of backups? Meaning the full weekly backup has 1 ...

What's the best zero (near zero?) administration relational database for a windows desktop app: Access, SQLite, SQL Server, other?

We don't need multiuser. Just relational. Our app currently uses Access but Access isn't exactly zero-administration because it's prone to corruption. Is SQLite rock, rock solid, pure zero-administration? Or...is there a way to configure SQL Server as a desktop engine so that it is pure zero admin? Or...is there some othe...

INSERT vs INSERT INTO

I have been working with TSQL in MSSQL for some time now and somehow whenever I have to insert data into a table I tend to use syntax INSERT INTO myTable <something here> I understand that keyword INTO is optional here and I do not have to use it but somehow it grew into habit in my case. My question is: Are there any implications...

What is the best way to compare .NET performance vs. VB 6 performance at a customer site?

Two questions: Can someone point me to unbiased data that compares .NET performance to VB 6 performance? I have searched but it is surprisingly difficult to find. What is the best way to compare .NET performance to VB 6 performance as an app behaves at a customer's site? We have a WindowsForms, client-server app (written for 2.0, upg...

Hierarchical Queries in SQL Server 2005

Way back when I was working in an Oracle shop I took the CONNECT_BY for granted. Now I'm stuck working with SQL Server 2005 and have some nasty object hierarchies. Specifically, we have a self referencing table where all child records have a column with their parent's id. Currently we have a view that maps children to levels in the hi...

Is it possible to change SQL user-defined data type?

I have a bunch of tables using user-defined data type for PK column. Is it possible to change this type Using SQL Server 2005? ...

Document/Image Database Repository Design Question

Question: Should I write my application to directly access a database Image Repository or write a middleware piece to handle document requests. Background: I have a custom Document Imaging and Workflow application that currently stores about 15 million documents/document images (90%+ single page, group 4 tiffs, the rest PDF, Word an...

Forgot SQL Server Password

I installed SQL Server 2005 sometime ago and forgot the administrator password I set during setup. How can I connect to SQL server now? EDIT: I think I only allowed Sql Server Authentication. Login with integrated security also does not work. ...

Why does a SSRS report time out when the Stored Procedure it is based on returns results within a few seconds?

I have a report that renders data returned from a stored procedure. Using profiler I can catch the call to the stored procedure from the reporting services. The report fails stating the report timed out yet I can execute the stored procedure from SSMS and it returns the data back in five to six seconds. Note, in the example test run o...

SQL Server 2005: Wrapping Tables by Views - Pros and Cons

Background I am working on a legacy small-business automation system (inventory, sales, procurement, etc.) that has a single database hosted by SQL Server 2005 and a bunch of client applications. The main client (used by all users) is an MS Access 2003 application (ADP), and other clients include various VB/VBA applications like Excel a...

Peer to peer replication in SQL Server 2005/08

Has anyone had any experience in setting up peer to peer replication using SQL Server 2005 or 2008? Specifically, I'm interested in whether other options/alternatives where considered and why P2P replication was ultimately chosen. If you have used P2P replication: Did you encounter any issues during synchronization and was it easy to...

Using SQL Server 2008 Geography types with nHibernate's CreateSQLQuery

I am trying to issue a SQL update statement with nHibernate (2.0.1GA) like this: sqlstring = string.Format("set nocount on;update myusers set geo=geography::Point({0}, {1}, 4326) where userid={2};", mlat, mlong, userid); _session.CreateSQLQuery(sqlstring).ExecuteUpdate(); However I receive the following error: 'geography@p0' is not a ...

Implementing a SQL Server 2008 User-defined function in managed code for geocoding

The goal: To create a .NET dll i can reference from inside SQL Server where i can pass in an address & get back a geocode string that i can stick into a geography data type as a POINT using STPointFromText() in t-SQL. I'm using Virtual Earth, I signed up for a developer account which gave me access to virtual earth staging servers. I'...

Headache getting php and sql server 2005 to run together

Below is the code that i cannot get to work. I know i have established a connection to the database but this returns nothing. What am i doing wrong? $result = "SELECT * FROM images WHERE path = ?"; $params = array("blah"); $row = sqlsrv_query($conn, $result, $params); $finished = sqlsrv_fetch_array($row); if($finished) { echo "blach"...

Preventing Users from Working on the Same Row

I have a web application at work that is similar to a ticket working system. Some users enter new issues. Other workers choose and resolve issues. All of the data is maintained in MS SQL server 2005. The users working to resolve issues go to a page where they can view open issues. Because up to twenty people can be looking at this page ...

Should I still see the query hit in SQL Profiler?

I am currently building a web site and I just implemented SqlCacheDependency using LinqToSQL like so. public IQueryable<VictoryList> GetVictoryList() { string cacheKey = HttpContext.Current.User.Identity.Name + "victoryCacheKey"; IQueryable<VictoryList> cachednews = (IQueryable<VictoryList>)HttpCont...

SQL Server Reporting Services Custom Page Layouts

Would it be possible to define layouts depending on the report type? ie. The layout size for PDFs would be different from the web layout. Let's say we publish the report to the web. The user has the option of exporting this custom report to PDF. We want to be able to specify how the report should look like when exported to PDF. ...

How do I create a recursive query in MSSQL 2005?

Let's say I have the following table: CustomerID ParentID Name ========== ======== ==== 1 null John 2 1 James 3 2 Jenna 4 3 Jennifer 5 3 Peter 6 5 Alice 7 5 Steve 8 1 Larry I want to retrieve in one query all th...