I have created the SQL script below that creates four tables and inserts data into the tables to demonstrate my question (I hope this helps!).
This problem arose because originally this data was stored in a single table of 400 columns and it got very unmanageable so I wanted to find a better way to store the parameters:
use master
G...
Consider a classic ASP site running on IIS6 with a dedicated SQL Server 2008 backend...
Scenario 1:
Open Connection
Do 15 queries, updates etc all through the ASP-page
Close Connection
Scenario 2:
For each query, update etc, open and close the connection
With connection pooling, my money would be on scenario 2 being the most effec...
How can i trasform a microsoft sql server report service in web application or something that i can access on the net?
thanks to all that would help me
...
I have a few columns in a table that are added to my publication articles.
When a change on a column that is not included in replication occurs, it still seems to update the msrepl_tran_version which i assume still assigns the row for replication.
Is this how SQL-Server works?
Is there a way to tell sql only to relicate rows when a colu...
I've the following table structure -
Site: Master tablefor site
Org: Master table for Org
User: Master table for User (each user links to a unique Org via
User.OrgId)
OrgSite: Store some 'Org specific' Site details (OrgId, SiteId, SiteName,
SiteCode). Not ALL sites but only
those which are accessible to Org.
...
I have to divide the rows equally,
so here, for example, there are 15 rows. I want to divide equally, which is in three groups, but I want the name to come only in front of the first entry of each group, as shown:
DECLARE @NAMES TABLE
(
[ID] INT IDENTITY,
[NAME] VARCHAR(20)
)
INSERT INTO @NAMES
SELECT 'NAME1' UNION ALL
SELECT 'NAME2' ...
Given the SQL statements below, I would expect the result of the query to be:
|testX|5|
|XXXXX|5|
This is because the column is a char(5) and I would expect it to insert blank trailing spaces to fill the remaining space in the column since the inserted values are less than five characters. However, the query actually produces the fol...
I rencently used the SQL Server Migration Assistant to import a database into SQL Server 2005. I noticed that a number of tables that were imported have been ammended with a new column called SSMA_timestamp.
Can anyone tell me what this is for and how it would be used?
...
I would like to insert an image into this expession instead of True and False
=IIf(Sum(Fields!cont.Value, "DataSet7")<>Sum(Fields!tot.Value,
"DataSet7"), True,False)
i would like to insert a red or green image to compare this two fields
thanks to all who wants to help me
...
I want to ask is there any issues or risks involved in installation of SQL Server 2005 Enterprise Edition on SQL Server 2000 Enterprise Edition in production server?
Please tell me the guidelines in installation...
...
In my new WPF/silverlight app, is it better to directly connect to my remote SQL Server (I'm using linq to sql), or is it better to call a WCF service and have the service connect to the database?
The SQL Server and a Win2k8 web server are both leased and at the same location. If creating a WCF service, I would run it on the web serve...
Is there a way to specify the transaction isolation level when Crystal Reports queries a SQL Server 2005 database without resorting to any of the following:
Encapsulating the report's query in a stored procedure that executes SET TRANSACTION ISOLATION LEVEL... before the query itself
Hand-writing the SQL query in Crystal Reports to exe...
The goal of using a sequential guid is so you can use clustered indexes without the high levels of fragmentation that would normally exist in a clustered index if it was a regular guid, correct?
...
What is the simplest way of doing a recursive self-join in SQL Server? I have a table like this:
PersonID | Initials | ParentID
1 CJ NULL
2 EB 1
3 MB 1
4 SW 2
5 YT NULL
6 IS 5
And I want to be able to get the records only related to a...
We're looking to iron out issues in our different dev/test/prod environments.
Currently we have to remember to change the name of linked servers in stored procedures when we migrate from UAT into Production. For example, in Production, a sproc in SMOLDB calls across a linked server to LS_AUTH.AuthenticationDB.dbo.SomeSproc because Aut...
How do i limit the result of a query (in my case about 60K rows) and select only from the X row to the Y row?
If I use ROW_NUMBER() I don't like my query because it involves 2 select queries .. one to return the rows and one to select the portion I need
Update:
Here's the query I use now:
SELECT *
FROM (
SELECT row_numb...
Hello,
For the longest time, I've been using MySQL servers to handle data (in JAVA, and in C#). But lately, I've been hearing good things about LINQ and SQL Server. I've been thinking of converting, but I don't know much about the SQL Server.
Could anyone who has used SQL Server before, please define how well it is compared to MySQL se...
I'm trying to update a table on several remote servers by iterating over a list of server names and executing some dynamic SQL. See below.
DECLARE @Sql NVARCHAR(4000)
DECLARE @Server_Name VARCHAR(25)
SET @Server_Name='SomeServer'
SET @Sql='UPDATE ' + @Server_Name + '.dba_sandbox.dbo.SomeTable SET SomeCol=''data'''
PRINT @Sql
EXEC @Sql
...
Trying to update a table on a linked server (SQL 2000/2005) but my server name will not be known ahead of time. I'm trying this:
DECLARE @Sql NVARCHAR(4000)
DECLARE @ParamDef NVARCHAR(4000)
DECLARE @SERVER_NAME VARCHAR(35)
SET @Sql = 'UPDATE
@server_name_param.dba_sandbox.dbo.SomeTable
SET SomeCol=''data'''
SET @ParamDef = N'@server_n...
I have a requirement to take a "snapshot" of a current database and clone it into the same database, with new Primary Keys.
The schema in question consists of about 10 tables, but a few of the tables will potentially contain hundreds of thousands to 1 million records that need to be duplicated.
What are my options here?
I'm afraid tha...