Hello,
I've deleted some records from a table in a Sql Server db. Now the Ids go from 101 to 1200. I want to delete the records again, but I want the id's to go back to 102. Is there a way to do this in Sql Server?
...
I'd like to be able to run an already parameterized query from within the SSMS:
select name
from aTable
where id = @id
I know that other IDEs (e.g. TOAD) allow for parameter binding - is this available in SSMS 2008?
Thanks!
...
In a SQL Server 2005 database I'm working on this query:
select *
from foo
join bar on bar.x = foo.x
join baz on baz.y = foo.y
where foo.x = 1000
has a vastly different and faster query plan than the following parameterized version.
declare @p0 int
set @p0 = 1000
select *
from foo
join bar on bar.x = foo...
I want to create a product catalog that allows for intricate details on each of the product types in the catalog. The product types have vastly different data associated with them; some with only generic data, some with a few extra fields of data, some with many fields that are specific to that product type. I need to easily add new pr...
Hi,
Im very new to SQL but need to write a query to do the following.
Using MS SQL Server 2005.
Profile DefinitioninProfile Definition
------ ------------------- ----------
ProfileID DefinitionID DefinitionID
ProfileType ProfileID ...
I have a case where i need to translate (lookup) several values from the same table. First way I wrote it, was using subqueries:
SELECT
(SELECT id FROM user WHERE user_pk = created_by) AS creator,
(SELECT id FROM user WHERE user_pk = updated_by) AS updater,
(SELECT id FROM user WHERE user_pk = owned_by) AS owner,
[name]
FRO...
I have a simple SQL script that I execute manually from Visual Studio. It is a data generation script so I expect it to take a couple of minutes to run. But I get the following error.
Timeout expired. The timeout period
elapsed prior to completion of the
operation or the server is not
responding.
I don wan't to change any gl...
I need to create a background job that processes a table looking for rows matching on a particular id with different statuses. It will store the row data in a string to compare the data against a row with a matching id.
I know the syntax to get the row data but i have never tried comparing 2 rows from the same table before? How is it do...
SSRS version is SQL 2005 x64 sp2 on Windows 2003 x64 sp2 and IIS 6
Clients run IE 6 on a mixture of Win2k sp4 and WinXP sp3
reports are accessed through the standard SSRS html viewer
As the title suggests my issue is that, in SSRS reports which use toggle buttons to control visibility of sections, the graphics for the toggle buttons w...
Hi, I have this SQL Job (in SQL Server 2005) that creates a backup every six(6) hours, the backup's filename is based on the timestamp so that it will create a unique filename(dbname_yyyymmddhhmmss.bak), Now my question is, How would I know using xp_cmdshell if the file is three day old and based on my script I want to delete backup(.bak...
I want to create a one off backup of a database that I can then restore on my local machine. I do not want to have any impact on the current media set. I see an option "Back up to new media set, and erase all existing backup sets". What I really want is "Bak up to new media set".
...
Specifically, Sql Server 2005/T-Sql. I have a field that is mostly a series of two characters, and they're all supposed to be upper case but there's some legacy data that predates the current DB/System, and I need to figure out which records are in violation of the upper casing covenant.
I thought this would work:
select * from tbl wh...
Has anyone tried using it and can say if it's well implemented?
-- Assaf (who spent the last few weeks getting increasingly frustrated with MySQL's deficient implementation of OpenGIS functions and is now considering switching to MSSQL)
...
We have a scenario
One Main e-commerce website - currently attracting a lot of visitors.
Three sub "brand specific" sites which will hang off this site - each of these sites will potentiall have the same level of traffic over time.
The client requires order processing for each brand site to happen in one place (i.e. one backoffice).
...
What is the best/most efficient way to store old dates (pre-1753) in SQL Server 2005? I am not concerned with storing times - just dates. SQL Server's datetime data type can only hold dates back to January 1, 1753. The MSDN documentation states that there are date and datetime2 data types, but SQL Server Management Studio does not seem t...
I need to connect to a MS SQL Server on Windows from PHP running on Red Hat Enterprise Linux 4. I have installed FreeTDS and I can connect to the database using the tsql command.
My current PHP does not have the mssql functions/extension.
My question is, how do I set up the mssql extension without rebuilding PHP?
Is there a prebuilt pa...
I am using VSTS 2008 with both the developer and database editions installed. I have the DB edition GDR installed (version 9.0.31124). We have several places in code that we reference linked servers (DB2 mainframe, iSeries, and SQL Server). One such example is this code that we have in a store procedure:
SELECT VendorID
INTO #tmp...
How do you raise a SQL Server error event (similar to RAISERROR) from within a SQL CLR routine?
...
I am no longer able to graphically see tables, server or databases in Visual Studio 2008. If I open previously created datasets all I see is the XML as if I had selected view code instead of designer, I have also lost my server explorer window and when I try to re-add it from tools --> connect to server or database nothing happens.
Noth...
I'm in the process of moving SQL server to a separate machine. Currently we are running our web server and sql server on the same box. So we have a production server with IIS and SQLServer and then a separate development server that mirrors this setup.
When it comes to our asp.net control's app.config and web site's web.config, this h...