sql-server

How do I migrate table schemas from one DB to another without damaging the data in the destination DB?

How do I migrate table schemas from one DB to another without damaging the data in the destination DB? I want to move my data from my deployed development copy to the live database and would like to run some scripts to do it. I need to upgrade the schema for some tables and create others. I figure right now that I'll have to check eac...

How to replace a string in a SQL Server Table Column

i have a table (SQL Sever, in this case) which references paths (UNC or otherwise), but now the path is going to change. In the path column, I have many records and I need to change just a portion of the path, but not the entire path. And - I need to change the same string to the new one, in every record. How can i do this with a simple...

Why do I get a Timeout Expired error running this query?

I'm running this query on SQL Server 2008 using ODBC. If I take out the last part (OR li.DATEGENERATED >= (...))) then I don't get the error... but I can run it in SSMS just fine. SELECT COUNT(*) FROM dbo.POITEMST li WHERE (? IS NULL OR li.DATEGENERATED >= ?) AND (? IS NULL OR (li.DATEGENERATED >= ( SELECT MAX(t.DATEGENERATED) F...

Error 1815 when backup up SQL08 DB

I’m trying to backup a SQL08 database to a target on a remote drive and keep ending up with error reason “1815”. This happens either when scripting the backup or using the task wizard GUI. It also occurs when attempting to use either UNC or a shared drive letter to the same path. Another machine on the network doesn’t have a problem back...

Delete only 500 rows from a table

Hi Friend, Can somebody please, help me with a query to delete only 500 rows from a table which has 20000 rows. Also has to be older than a particular date. Thanks for your help, Soofy ...

sql server 2008 express setup problem

Hi, I previously had sql server 2005 express and uninstalled it.. I also uninstalled any vs related programs and installed visual web developer 2008 express edition with SP1. now that I am trying to install sql server 2008, I am seing error messages like no other and leave that alone without any suggestions.. the latest one which I coul...

SQLServer Stored Procedure

Hi, I would like to hear if any of you have an idea to do the following: I have one table containing some cardefinitions [id][Company][Mode], this could e.g. be Audi 100, Ford Mustan etc. I then have another field which is a string containing both the car and the model, this could be "Ford Mustang 2.5T", I then need to find the correct I...

How to enable membership provider for sql server express database.

Hi, I am playing with ASP.NET MVC with visual webdeveloper express edtion 2008 and sql server express edition. I am creating a site that will use membership provider for that i want to use my own databse not the application services database. I have created my database in app_data folder but still I am not able to register it using aspn...

How can I make my old Dbase 2 progs run under SQL?

How can I make my old Dbase 2 progs run under SQL? I want to do two things. have my old Dbase progs run under windows with huge datasets on my personal computer (so it would have no internet need) and 2. Have my old dbase progs run from an sql server on the internet where I could log on form the internet and work the program and dat...

What .sdf files. How it is diffrent from .mdf files.Does it works with linq to Sql?

I am playing with wpf and when i have created database it is created with the .sdf files. I want to know details of .sdf files. How it is diffrent then the standard .mdf files and will they support linq to sql? Because i am not able to use it with linq files. ...

SQL Server's port is blocked

Developed a Windows application that remotely accesses an SQL Server online. However, the client's ISP blocks port 1433. What are the other options to connect to SQL Server from the windows app? ...

Windows App and SQL Server

What's the best practice for a windows app connecting to a SQL Server that is hosted in the internet? I'm currently using an IP based connection string with SQL authentication, nothing special. However, some clients cannot connect using port 1433 and I'm assuming that the whole approach has some security concerns. ...

SSRS get meta data of remote report

How can I retrieve the meta data such as Description, Modified/Create Dates etc from a Remote SSRS report. The report itself displays no problems in the ReportViewer control on the aspx page so I can access the report... there doesn't seem to be any properties for those values in the .ServerReport object... thanks heaps! ...

How do I get a filelist from the local filesystem in SQL Server 2005?

The title kind of says it, but I’ll elaborate a bit. I use SQL Server 2005, and I'm writing an export query that’ll return a list of users. Some users have profile images, some don’t. The profile image is not represented in the database, at all. There’s just a file on the filesystem, named [username].jpg. So what I need to do is to chec...

How to combine 2 bit columns

Hello, I am querying a database and I have 2 bit columns I need to combine (for this example if one is true the column must be true). Something like: Select col1 || col2 from myTable What is the easiest way of achieving this? ...

Issue with retrieving DateTime object using Sql

Given the date, 2009/04/30, in one of the rows I want to retrieve all dates <= 2009/04/30 and >= 2009/04/30. The sql statements are like this: select dateColumn from someTable where dateColumn <= '2009/4/30' select dateColumn from someTable where dateColumn >= '2009/4/30' The above 2 statements run but the first statement returns all...

integrated SQL-server authentication from untrusted domain

I really want to use SQL-server from a C#/.NET appliaction without using SQL-Server accounts or adding the affected computer to the same domain or to any domain at all or to use the same logon-name as the domain. Isn't there any way? Did someone try to do this using the MONO implementation of SSPI? ...

How do i convert hh:mm:ss to hh:mm in sql server?

How do i convert hh:mm:ss to hh:mm in sql server? select Count(Page) as VisitingCount,Page,CONVERT(VARCHAR(8),Date, 108) from scr_SecuristLog where Date between '2009-05-04 00:00:00' and '2009-05-06 14:58' and [user] in(select USERNAME from scr_CustomerAuthorities ) group by Page,Date order by [VisitingCount] asc...

How to find slowest queries

Using Sql Server 2005 Profiler, what events, columns, and filters do you trace to find your slowest queries and stored procedures? Slow = greater than N seconds, 10 for sake of argument. ...

How can I group by my columns in SQL?

How can I group by Time? I tried this, but it gives the error "Invalid column name 'Time'.": select Count(Page) as VisitingCount, CONVERT(VARCHAR(5), Date, 108) as [Time] from scr_SecuristLog where Date between '2009-05-04 00:00:00' and '2009-05-06 14:58' and [user] in (select USERNAME from scr_CustomerAuthorities) group by [Tim...