I have a view from which I am selecting three columns. Of these three columns, one of them contains the OS version.
I want to create an additional column in the result which checks the OS Version. If the OS Version is less than 5.1 it should return 'Bad', if it is greater than that it should return 'Good'.
Any ideas about how to add t...
I need to transfer data daily from SQL Server (2008) to SQL Server (2005). One of the servers is located at our web host so the data will be transferred over the Internet. On the same network I would use SSIS to transfer the data, but over the Internet this is not a secure option. Is there a secure way of achieving this?
...
How i will write multiserver Query in SQL2008?
...
When I run the query :
select count(*) from
(select idCover from x90..dimCover group by idCover having count(*) > 1)
I get the error :
Server: Msg 170, Level 15, State 1, Line 2
Line 2: Incorrect syntax near ')'
How do I formulate this query correctly?
I'm on SQL Server 2000
...
How do I formulate this query
update forge..dimInteg2
set duplicates =
(select count(*) from (select idCover
from x90..dimCover
group by idCover
having count(*) > 1))
where dimTable = 'dimCover'
to avoid this error
Line 6: I...
I want to select a row where the matching condition is What's.
How to write the Query?
I can't write like - "SELECT * FROM WHERE [TITLE] LIKE 'What's'..
What to do ?
...
How can I get the number of rows affected by an UPDATE query in a Stored Procedure (SQL Server 2005), as a resultset. e.g.
CREATE PROCEDURE UpdateTables
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
UPDATE Table1 Set Column = 0 WHERE Column IS N...
Hi ,
In a SQL View, I have 5 boolean variables and one int variable.
out of 5 boolean variables only one variable will be true for a single data row,
Task Type boolVerySmall Datestart TagName
Architecture Setup -- Doc Code True 1900-01-01 00:00:00.000 Design_09
idProject boolsmall boolM...
Hi,
i m using sql server 2005 with service pack-2.
When I connect sql server with by registering the remote server with IP, username and password. I have done all the neccessary setting for connecting remotely "SQL Server 2005 Surface Area Configuration".
i got following error while connection:
This version of Microsoft SQL Server M...
Hi i was wondering if anyone knows how i can calculate the difference between two tables in tsql. I dont mean finding which cells are different - i mean calulcating the numerical difference. eg - Table A has column1, column 2 and only one 1 row. A1 = 40, B1 = 30. Table B has column1, column 2 and only one 1 row. A1 = 25, B1 = 10. So how ...
Hello,
I've been writing some small maintenance/viewer tools that each connect to a SQLServer (2005) database via System.Data.SqlClient classes.
(C# - .NET 3.5 - Windows.Forms)
For each of these tools I had to write the UI and dialog to let the user choose the right db and server: I connect to my test-db, my colleague uses my tools to...
Does anyone know the best way to create a SqlCe (Compact 3.5) table based on the schema of a DataTable at runtime? I don’t want to have to formulate a “CREATE TABLE” statement based on all the different possible data-types, etc.
As a bonus – do you then know how to fill it directly from a datatable?
...
Summary: Where can I find a reference to SQL Server file version numbers?
Background: I'm moving a corporate website from a Win2003 Server with an install of SqlServer 2000 to a WinServer 2008 box with SqlServer 2008. I did the standard T-SQL "CREATE DATABASE" followed by "RESTORE DATABASE" commands and my database file imported, but I ...
I got an app running on my SQL Server that is starting to slow down on a specific task. I ran SQL Profiler and noticed that the
following query is taking an enormous (1-2 minutes) amount of time. I don't have access to the code to change the query.
Is there anything I can tune/change in the database? The PC10000 table in the statemen...
Hello,
I have a table of topics, topics might have an automatic publish date, I want to make SQL Server auto publishes them.
Previously I made it in code on each call to any method of the topics adapter, but I wanna make it automatically in SQL Server.
Can I?
It might be some kinda scheduled job or something like that.
I'm using SQL...
I have a table users which has a primary key userid and a datetime column pay_date.
I've also got a table user_actions which references users via the column userid, and a datetime column action_date.
I want to join the two tables together, fetching only the earliest action from the user_actions table which has an action_date later than...
In a SQL Server 2005 database, I have lots of tables like this Products table
ProductID (PK)
ProductCategoryID (IX)
Description
Price
ExpiryDate
BreakableYN
...where there is a primary key, a foreign key and then a bunch of other fields. Another characteristic of this type of table is that lots of queries only use the 2 ID fields (Pro...
Hi All, I'm developing an asp.net application with Database factory pattern which allows the application to support both Sql Server and Oracle. I've created an abstract class that has the methods common to Sql Server and Oracle, like the CreateConnection and CreateCommand methods. This class is implemented by SqlServer and Oracle classe...
I'm dealing with a legacy system where I need to identify some bad records based on a column with a data type of Float.
Good records have a value of...
1
2
1.01
2.01
Bad records are anything such as..
1.009999999999999
2.003423785643000
3.009999990463260
I've tried a number of select statements where I Convert to Decimal and cast ...
As a part of a scripted procedure I'm trying to programmatically update references to linked servers in stored procs. We have several references like this:-
SELECT foo, bar
FROM [Server].[Database].dbo.[Table]
Which I would like to translate to:-
SELECT foo, bar
FROM [Database].dbo.[Table]
I would like to do this entirely programma...