Quantcast
Channel: Forum Getting started with SQL Server
Browsing all 7129 articles
Browse latest View live

sorting tables

What different ways could you sort a list of data into a specific order, i.e.:Smallest to largest? Cheapest and most expensive by group?sukai

View Article


Creating a new database using an MDF file

My database saves as MDF. I want to know what are the steps to restore or create a new database using a MDF file? I tried to restore as usual but it shows an error. Please help.

View Article


How to Avoid Redundant Indexes on Indexed Views

Let's say I have an indexed view - so far it only has a clustered index. I want to avoid redundant indexes. So let's say the view joins Customers and Orders. If I've already put a nonclustered index on...

View Article

Syntax question - columns noted in parentheses?

I found this query somewhere on the web, copied it to my notebook but part of it I never understood - why the two columns in parentheses? What does that accomplish?select x.employeeid, y.thecount...

View Article

Index job failed with this error Msg 1222, Lock request time out period...

HI All,I am using Ola index optimization for rebuild\reorganise indexes and update stats. but it is failing continuously with this error.Msg 1222, Lock request time out period exceeded. [SQLSTATE...

View Article


How to write procedure or SQL select query

Hello AllI want to make procedure or select query where same PID(Permanent ID) admitted to the hospital at different date. If the date difference(day) is equal 7 days  then 1 and it will search next...

View Article

How to email result of a select from SQL

Hi All,Our application does not have notification feature when certain customers missed their payments. Is it possible to schedule a job in SQL server to send an email to the account manager when ever...

View Article

System database Backups

Should I backup my system databases?

View Article


How to merge 3 different query results using full outer join?

 Hi all This is my my query for 2 resultswith t1 as ( select trans.crAcc_id,trans.cr_amt,row_number() over (order by trans.head_id) rn from Acttrans trans, Acttranhead head where trans.head_id...

View Article


Login failed for user

I have a SharePoint server which is using service account "spsharepoint".For some reason this user has started giving 'Login failed for user spsharepoint' when I checked SQL Server logs. Turns out it...

View Article

does non clustered index contain clustered index

hi all,  i want to create a non clustered-index(say cover index) for the below queryQuestion : does non clustered index contain clustered index, please let me know which index would be the bestCREATE...

View Article

file growth settings basics

I am pretty new to MSSQL (not a DBA), and trying to understand the basics of filegrowth settings. None of the databases have a max size set, so presumably they will keep growing as long as their is...

View Article

sys.database_files

How can you convert the "size" value of the database in sys.database_files into GB? (unsure what size metric it is currently stored as).

View Article


Fetching data based on parent_id recursively

Following is the sampletable:FolderIDFolderNameParentID 1 Fruit NULL 2 Vegetables NULL 3 Meats NULL 4 Spices NULL 5 Apples 1 6 Granny Smith 5 7 Golden Delicious 5 8 Fuji 5 9 Pink Lady 5 10 Oranges 1 11...

View Article

Use a cursor to insert unique field into table

I have never used a cursor before so I am new to this. I'm wondering if someone could point me in the right direction.I have a table in my database that already contains some data. There are only 5...

View Article


Slow connection

Hi Guys – I’d like to ask a quick question: We have a domain network and we are experiencing a slow data transfer. In other words what took 0.8 sec to return, it takes 5 sec. This happens when the...

View Article

is there a utility or a simple import a few columns from a flat file onto a...

I have a big flat file of over 2600 columns; but I only want to import columns 40 to 49 onto a sql table.Could you please advise what should I do.Thanks,Sally

View Article


SQL Server only using 4 out of 6 cores

Hi,I noticed that SQL server only appears to be using 4 out of 6 cores.I was doing a bit of reading around this and I think the solution may be to change some of the processor affinity settings. Has...

View Article

blank password for sa user in SQL server

i have already checked and confirmed that checkboxes in the SA login properties does not have a tick mark and also saved the properties window after leaving the password blankbut when I'm unable to...

View Article

How can I reduce the size of my DB and my nightly backups?

One of my SQL databases is growing out of control and its required nightly backups (FULL) are sucking disk space at a rapid rate.  The backups are now at 120GB a pop and the DB itself is somewhere at...

View Article
Browsing all 7129 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>