I notice that the sql to create the SQL server database (InstallPersistSqlState.sql) basically creates the database ASPState. If I wanted to name that different, can I just replace that with my prefered database name? I understand the script, I just wanted to make sure that ASPState didn't have to be the database name. Thanks!
...
Hi there
I have 3 tables: Customer, CustomerTypes, CustomerCustomerTypes. CustomerCustomerTypes is basically is a bridge table between the Customer and CustomerTypes.
Table structure:
Customers:
CustomerID
CustomerName
CustomerTypes:
CustomerTypeID
CusctomerTypeName
CustomerCustomerTypeID
CustomerID
CustomerTypeID
Sample Data:
Custo...
I am trying to do some basic maintenance on a sql server 2005 database. It's fairly small (10gb in size, 50 tables or so).
I am first doing the following on all tables:
update statistics [table name] with fullscan
followed by reindexing all tables.
DBCC REINDEX ([table name], ...)
Is this correct? Is the sequence right? Do I ne...
Hi all,
I have two xml variable say @res, @student in a stored proc in SQL server 2005.
@res contains
<Subject>English</Subject>
<Marks>67</Marks>
<Subject>Science</Subject>
<Marks>75</Marks>
@student contains:
<Student>
<Name>XYZ</Name>
<Roll>15</Roll>
<Result />
<Attendance>50</Attendance>
</Student>
I need to in...
Hello, I have a problem with a stored procedure of a transactional table, the user have a web form to find transactions by several values.
The process is taking too long and I don't know how to set proper index.
here is my stored procedure:
CREATE PROCEDURE dbo.cg_searchTransactions
(
@id_Ent tinyint,
@transactionTypeID int = ...
Here's the output code from my stored proc:
SELECT *
FROM
(
select q.ccypair, q.vega, t.label
from #parallel q
LEFT JOIN TPRR_vega_weights t ON q.Tenor = t.Tenor
) a
PIVOT
(
Sum(Vega)
for a.label in ([t1],[t2],[t3],[t4],[t5],[t6],[t7],[t8],[t9],[t10],[t11],[t12],[t13],[t14],[t15],[t16],[t17],[t18])
)p
order b...
Hey all,
So we have a .bat file that runs SQL scripts, e.g.
@ECHO --- 03_Case6395_Publication.sql --- >> dbupt.log
sqlcmd -U %1 -P %2 -S %3 -d %4 -i 03_Case6395_Publication.sql -k -b >> dbupt.log
IF ERRORLEVEL 1 GOTO ErrorTag
The script runs and gives no errors, but the script doesn't actually affect the database. In the example abo...
I'm trying to import data from a Progress database into a MS SQL 2005 Server database.
On SQL Server, I'm right clicking on my schema name and going Tasks > Import Data... and running through the wizard.
I have an ODBC Connection to progress setup, no issues there, I also test my queries using ODBC Explorer first to ensure I have no sy...
Hey,
I've been tasked with hooking in our product with another third party product. One of the things I need to do is mimic some of the third-party's product functionality when adding new "projects" - which can touch several database tables. Is there any way to add some kind of global hook to a database that would record all changes mad...
Does cardinality play a role in composite indexes? If so, what?
I was running a query that was joining on two columns and it used what I thought to be a sup-optimal index, so it's making me rethink how I design indexes...
Let's say we had a table that listed all of the Cities in the United States. My first instinct here is to make a cl...
Hi, I want to return the date and ID for the latest added record in on of our tables.
can anyone suggest right query for that plz. We are using sqlServer
SELECT [BGArx_ID], [BGArx_PUBLISHED_DATE]
FROM TECH_ARTICLES
WHERE [BGArx_PUBLISHED_DATE] = ???
...
I am trying to use pivot on a table to rotate(Transpose) the table but i m not getting how to do that.
I want to know how it actually works.
i found many egs but i was not able to understant how those work.
Check this, e.g.
How tis is working, i just want to transpose my rows into cols and cols into rows
Say i have 31 cols for day1 da...
Im working on something incredibly unique..... a property listings website. ;)
It displays a list of properties. For each property a teaser image and some caption data is displayed. If the teaser image and caption takes a site visitors interest, they can click on it and get a full property profile. All very standard.
The customer wants...
Hi,
I've SQL Server 2008 Express installed. I've just download and installed SQL Server 2005 Express, but I changed the name of instance into SQLEXPRESS2005 (I added 2005 at the end to avoid conflicting names).
Unfortunately, when I try to access the 2005 instance either using the SQL Server Management Studio or the VWD 2008 Express (...
SELECT @Tax = SUM(QuoteItem.SalesPrice) * TOP (1) Tax.Amount
FROM Tax INNER JOIN
Job ON Tax.TaxId = Job.TaxId INNER JOIN
Quote ON Job.JobId = Quote.JobId INNER JOIN
QuoteItem INNER JOIN
Room ON QuoteItem.RoomId = Room.RoomId ON Quote.QuoteId = Room.QuoteId
WHERE (Room.QuoteId = @QuoteId) AND (QuoteItem.UnitId = @...
I am wondering if something along the lines of the following is possible in ms-sql (2005)
SELECT (expiry < getdate()) AS Expired
FROM MyTable
WHERE (ID = 1)
I basically want to evaluate the date compare to a boolean, is that possible in the select part of the statement?
...
i have deployed my application on jboss 3.I have restored a database back up of sql server 2000 on sql server 2005.then i have downloaded the jr file jdbc connection to sql server 2005.My connection string setting is as below.
<datasources>
<local-tx-datasource>
<jndi-name>SLBDataSource</jndi-name>
<connection-url>jdbc:sqlserver:...
Hi,
I hava a sqlite3 database placed in the documents folder. I need to sync this database with the sql server 2005, which is running at our server.
Is there a possibility that i can do a Replication between a sqlite3 database and a MSSql server 2005.
--
Regards,
Syed Yusuf
...
Hello!
I have some computed-columns of two types:
Computed columns based on columns in current table (i.e. Price * Tax)
Computed columns based on other columnes (i.e. Price * fn_GetTax(OrderId))
Would you say it's better to use these columns in CLR on the client only and then save from the server the calculation and transferring per...
delete all rows from all tables in a SQL Server database
...