Quantcast
Channel: Microsoft SQL Server
Browsing all 4871 articles
Browse latest View live

Truncate SQL 2008 R2 database log file

I've been looking about trying to work out how to truncate a db log file on SQL 2008 R2.I've seen a lot of examples, but I'm not clear on what to do. The most simple example is this:DBCC...

View Article


Getting error message 8946 in SQL Server

When I run DBCC CHECKDB on one of my important database getting below error message:Msg 8946, Level 16, State 12, Line 3 Table error: Allocation page (3:140310) has invalid PFS_PAGE page header...

View Article


sql Need total time worked and total volume sold from two tables

Thanks in advance for any help.I have two tables, login and sales in. I need to get total time worked from the login table and total volume sold form the sales table.SELECT L.AGENT, SUM (DATEDIFF(ss,...

View Article

Can’t release space of temdb

tempdb on a server is at 206 GB with 99% free space.I tried shrinking the file, the database and using the ALTER Database command.I tried shrinking the data file from the GUI and eventually I lose my...

View Article

SQL Server 2014 Express Drive Type Error on 2012 Hyper-V Server

I am trying to install SQL 2014 Express with advanced features on a new 2012 Hyper-V server.  I have told the installer to install the instance root directory onto the D: drive and I am receiving the...

View Article


Joining Across 3 Tables Returning Null Values

I am trying to write a query that will give me name, #of sales, #of contacts, %sales to contacts, volume sold, hours...etc.I have to pull this information from three different tables, but for some...

View Article

how to hide store procedures from users?

How can I allow a user to run a stored procedure, but deny them the ability to see it in SSMS? I don't mean 'view def' permissions, I mean the actual procedure.I read about encryption, which mask the...

View Article

SQL Question

Hello everyone.i have 10 computers i have to install SQl on However i dont really have the time to do so,,mysql 2008is there a script i can use to auto install it, if so how??thanks

View Article


Transactional Replication w/o Key

I don't think there is much I can do, but figured I'd pose the issue to the community.We have a SQL database that is not developed by us and part of an application that is very highly used. I have been...

View Article


MS SQL 2005 configured for specific server name

Hello,My Microsoft SQL 2005 is experience is pretty much non existent. It's running off IIS and I'm trying to move both IIS and SQL 2005 to another server. The problem is, is that it seems like there...

View Article

From int to date and back to int - can I make this more efficient?

Hi,We hold various date codes in a table in int format. I need to be able to add an amount of months and then return the output as anint. We hold it in YYYYMM format. I've created the below, which...

View Article

Return rows with sting that contains one of a list of other strings

I am trying find a function in MSSQL that will allow me to search if a string  contains one of a list of codes that I have.  Is the best way just to loop through the second list until I get a hit with...

View Article

DSN / DSN-Less Connection

Hi,I am after the best way to achieve something. I want import some SQL data into an Excel table and force a refresh each time the user I am setting it up for (not me) opens the spreadsheet.This is to...

View Article


Speed up refresh of BI reports pulling from SQL 2012

I have a BI server that generates reports from data on an SQL 2012 server.   When you refresh the reports to update the data it may take up to 15 to 20 minutes.    Is there a way to increase the speed...

View Article

Need to run SQL query, dump to CSV, then rename CSV and upload via FTP

Ok... here it goes...We have a need to create a job that will essentially run a SQL query and dump the data into a CSV file. I then need the file renamed to the following format:...

View Article


Cannot execute database backup as maintence task

We recently moved our database to a new physical box and virtualized server.  I can backup the database by right clicking on the instance and selecting backup.  It backs up locally and across our...

View Article

SSRS - Querying a dataset

Hi,I have a dataset "Production" attached to my SSRS report. This contains the total income for our organisation in this financial year.I need to now extract (and summarise) the total of our income...

View Article


SQL Failover Cluster - Problems with access and services question

So, quick setup overview...1: Quorum/Witness server: zz-sql-Quorum2: 2 x SQL Servers: zz-sql-1 and zz-sql-23: Windows Cluster name: ll-sql4: SQL Cluster Name: ll-sql-c5: Cluster database/data stored on...

View Article

Image may be NSFW.
Clik here to view.

How often do you use scripts for your SQL Server?

SQL can be tough to manage, even with all of the tools available to you. Sometimes, you have to get your hands dirty and write up your own scripts, or even pull from scripts made by previous DBAs. (You...

View Article

SQL Total sales and contacts made by state

I am trying to run a query that will return the total number of contacts and the total number of sales made in each state. This is as close as I have been able to get, but is returning 31 total sales...

View Article
Browsing all 4871 articles
Browse latest View live


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