Home » Microsoft

how to use defualt sorting in SQl Server 2005 View (without ORDER BY clause )

Question:
Hi
I want to sort the data according to BirthDate in the following example View
(ID , Name , BirthDate , TelNumber)
without using the ORDER BY clause , meaning that whenever the view is opened or used , the defualt sorting schema will be by the BirthDate
thanx
Solution:
hi..
go through this link..
http://sqlblog.com/blogs/kalen_delaney/archive/2008/12/02/using-a-nonclustered-index-to-avoid-a-sort.aspx
to create non clustered index go through this..
http://www.java2s.com/Code/SQLServer/Index/Createanonclusteredindex.htm

SQL Server object encryption

Question:
What are the objects in sql server 2005 or later can be encrypted? Is the stored procedure or view encyrption is save? As per my findings over the internet, its easy to decrypt the stored procedure.
Please suggest.
Solution:
>> Is the stored procedure or view encyrption is save? As per my findings over the internet, its easy [...]

display the amount of the last record of a page in the top of next page?

Question:
Hi:
I have a report with these data, three rows only at each page
Page1
Leave start date       Leave end date        period      accumulate period
===========       ===========        =====     =============
1/2/2009                    15/2/2009                 15                      15
1/4/2009                    15/4/2009                  15                      30
1/10/2009                  17/10/2009                17                      47
Page2
Leave start date       Leave end date        period      accumulate period
===========       ===========        =====     =============
1/2/2010                    15/2/2010                 15                      62
1/4/2010                    15/4/2010                  15                      92
1/10/2010                  17/10/2010                17                      109
Page2
Leave start date       [...]

MS SQL2005 sys* optimization #2

Question:
This query runs find under MSSQL2000, but very slow under SQL2005.  Any ideas?
SELECT convert(varchar(255),t.name) LocalTablename,
convert(varchar(255),o.name) Keyname,
convert(varchar(255),ft.name) RemoteTablename
–INTO :fkList
FROM sysobjects o,
sysobjects t,
sysforeignkeys fk,
sysconstraints cn,
sysobjects ft
WHERE cn.constid = o.id
AND cn.constid = fk.constid
AND o.type = ‘F’
AND o.parent_obj = T.id
AND fk.rkeyid = ft.id
Solution:
Joining parameters, please refer sql INNER JOIN.

SQL installation I installed Sql server 2008 Express

Question:
but when I try to connect with studio it doesn’t find any server
in sql server configuration services the list of service’s is empty.
Solution:
seems like you just installed the client tools . make sure that you select the servers during the installation

Format the Connection String

Question:
Hi Experts,
I am using SSRS 2005. I am trying to write an expression for the connection string of the Data source as I don’t want to hard code. I belive that i have not formatted the expression correctly. Please correct my expression below.
Expression :
Provider=IBMDASQL.DataSource.1;Data Source=” & Parameters!MvxServer.Value & “;Default Collection=” &Parameters!MvxLibrary.Value & ”
Regards,
Sreekanth.
Solution:
try:
“Provider=IBMDASQL.DataSource.1;Data Source=” & [...]

Access 2007

Question:
I am trying to create a report that includes data from combo boxes.  When I display the report, it shows the number of the underlying data and not the corresponding text.  For example, my combo box shows three cities (Milwaukee, Madison, Green Bay) but my report shows “1″, “2″ or “3.”  Is there some way [...]

Datetime Timestamp Problem

Question:
I have a tracking table.  In this table there is a trackingTimestamp field which is datetime datatype.  When a record is inserted into this table, the current date time is inserted into the trackingTimestamp field.
Since these records are in EST, I want a SQL statement that will return the correct dates and times in PST [...]

SQl server 2000 – tempdb– continually refresh service….

Question:
my transaction logs, continually  fill up I get this error
Server was unable to process request. —> The log file for database ‘mass_texter’ is full. Back up the transaction log for the database to free up some log space.
I refresh the services continually, but I need a more perm solution….
Solution:
Yes.. Full backups can be done on [...]

VB6 Access 2003 Parse a CSV file

Question:
Need some code that can open a text flat file.
Read record by record
Parse each field.
Strips the “” from around the text fields.
Add the records to a table.
Here is my record.
“GFA-5400″,”ADCGFA5400″,”2 X 125W AMPLIFIER”,”3″,”679.15″,”ADCOM”,”31.8500″,”HOME AUDIO”,”811900010002″,”ADCOM GFA-5400 2-CHANNEL, 125-WATT AMPLIFIER”,”2-CHANNEL, 125-WATT AMPLIFIER”,”150W PER CHANNEL, 8_; 200W PER CHANNEL, 4_; MOSFET™ OUTPUT CIRCUITRY; TREMENDOUS 1.7 DB HEADROOM”,”CUSTOM INSTALL”,””,”N”,”21.34″,”16.30″,”7.87″,”799.00″,”Y”,”31.92″,””,”AMPLIFIERS”,”AMPLIFIERS”,”799.00″,””,”FIVE [...]