Quantcast
Channel: Transact-SQL forum
Browsing all 23857 articles
Browse latest View live

select all data of a column starting with A to E

How to select data from a table starting with A to E.eg. I want to provide two parameter say A  and E. I want to select all the data starting with A to E

View Article


Problem with restore database - sql server

hii try to backup and restore database using sql-server 2008 and got error.to backup i done this: `BACKUP DATABASE MyDB TO DISK='d:\MyDB.BAK'` (and its work fine)to restore i done this: `USE MASTER...

View Article


Is it possible to force a value in at least one of several columns?

Is it possible to define a constraint that says at least one of a set of columns must have a value?I have a table of securities.  There are three types of security identifiers that I am recording:...

View Article

How to use try cache in nested call of stored precedure, if i want other sp...

I have to call few strored precedure like sp1 sp2 sp3 from spmain.spmain will be scheduled and it will run on time basis. i want to trap each kind of error for loging so that i can check latter. and at...

View Article

Help with Converting an Access query

Hello:First time poster and would appreciate some help in converting this Access query into T-SQL so I can use in a Stored Procedure. I don't need help in resolving the syntax for the variables as...

View Article


SQL server Backup

Hi All,Today I observed one thing that i was taking backup for one of my app database.First time when i was taken that time the size of back up file is 1.25 GB After 5 min I have again take the backup...

View Article

Question on sql statistics

We have in our database nearly 3000 tablesand statistics are created according to default setting of Sql Server i.e Sampled (and not full scan) should i delete all statistics and rebuild it Full...

View Article

UNION Query - text and date time formatting issue

HiI have a union query where the column is not available in the first data set, but is on the second.  The second data type is datetime.  The scripts run perfectly individually, but when I union, I get...

View Article


Latest Exam Result

Hi ,I need to bring the latest exam result for each class and subject . Student might attended the same class and subjects multiple times. Table structuretblClassSubjectClassIdSubjectId Pk...

View Article


how to find existence of a file in a folder on ftp from stored procedure.

Dear all,         I have to add a column  in stored procedure, to show exist or not exist as a value in it,based on existence of any file in a given folder on ftp.please tel suggest ,how it can be done...

View Article

How to find out who installed SQL Server in Big orgnization?

Hi all,,, I want to find out who installed SQL server in their computers/servers. The internet is open and it's easy to install SQL server EXPRESS. Iam not looking for the command which will results...

View Article

SQL queries for finding values in 4 different tables

I need to have certain queries to find specific data in this table, this is just an example table, but I will use the same ideas for my actual website and database.customers (customerID: integer,...

View Article

Select daily data group by weekly in sql server 2008

hi friend i have following my table structure and data        CREATE TABLE [dbo].[Pairs_Details](       [sno] [int] IDENTITY(1,1) NOT NULL,       [userid] [nvarchar](50) NULL,       [date] [datetime]...

View Article


limiting data in sum() over partition by

limiting data in sum() over partition bySELECT atttibute1, attribute2, attribute3, month, year sum( rate) as Measure1, sum(rate) over ( partition by atttibute1, attribute2, attribute3, month, year...

View Article

Need to include duplicate records in sub query

Hi All,         I am using the following query and i am getting error message that your sub query return dupliate records and throwing error. Actually i need these duplicate records for my report. I...

View Article


OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)"...

I am trying to execute this Select against my excel fileSELECT * FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0', 'Excel 12.0; HDR=NO; IMEX=1; Database=C:\Temp\test.xlsx', 'SELECT * FROM [Sheet1$]')I have...

View Article

Case statement issue

I am using following query. My target is to achieve data between specific dates depending upon sites. But when i am using my query with this condition it is not giving me accurate resultsselect...

View Article


Total and percentage in the same row

Hi guys, sorry for suach a stupid question but I'm loosing all my skill trying to understand a discrepancy between two big table ( 100 millions rows, one table SQL 2008 and the other Oracle...funny)....

View Article

Problem using T-SQL for Excel Import

In SSMS, working with SQL Server 2008 R2, I can choose Database, Tasks, Import which launches the SQL Server Import and Export Wizard. I can use the Wizard to create and save a SSIS package to import...

View Article

Help needed with NewId() As CustomerId

I would like to generate Guid for each customerName with Insert statement.I have problem that following statement would create Guid for each single row. This is problem because same customer have...

View Article
Browsing all 23857 articles
Browse latest View live