Quantcast
Channel: Forum Getting started with SQL Server
Viewing all 6989 articles
Browse latest View live

AUto-renaming mdf & ldf filenames when restoring a database with SQL Management Studio

$
0
0

Hi!

I am using SQL Management Studio 2014 and I am experiencing some problems when restoring a database backup.

I have a SQL Server 2008R2 & SQL Server 2012 instances.

On the 2012 instance, when I restore a database and rename it into a new name, the mdf and ldf files get automatically renamed into the new database name : Great, this is the behavior that I expect.

On the 2008R2 instance, the mdf and ldf files don't automatically get renamed to match the new database name and I have to perform the renaming manually - pretty annoying.

Has anybody experienced this problem ? If yes, do you know of a fix ?

Thank you

Frederic


New install of older version on new machine questions (2008 R2 Express)

$
0
0

Hi,

I want to setup SQL Server 2008 R2 Express to an i5 machine running window 8.1. This should include ssis, ssrs, ssas, and the management studio. The instructions say to:

Step 1: Install Microsoft .NET Framework 2.0 or later from theDownload center

Step 2: Download SQL Server Express by clicking the SQLEXPR.EXE or SQLEXPR32.EXE link on this page. To start the installation immediately, click Run. To install SQL Server Express at a later time, click Save.
Note: SQLEXPR32.EXE is a smaller package that can be used to install SQL Server Express on 32-bit operating systems only. The SQLEXPR.EXE package supports installing onto both 32-bit and 64-bit (WOW install) operating systems. There is no other difference between these packages.

Step 3: Follow the installation instructions provided in the Readme. Known issues may be found in the release notes.

How do I do this on a new operating system without messing up the operation of other programs?

Is there any downside to loading the 64 bit version?

There are 9 files in the download section, none exactly the same name?

Does this also require installation of Visual Studio? If so which ver.?

I could not find a way in 8.1 to see the version of .net framework but is it likely higher than the required 2.0?

Sorry for my lack of understanding these basics, I have been siloed doing VBA for Access and Excel. The last I wrote any T-SQL was ver. 2000 about 8 years ago and need to expand my skills for a new assignment.

Thanks for any assistance,

alr0

Is there a way to get long running SQL Agent jobs information using powershell?

$
0
0

Hi All,

Is there a way to get long running SQL Agent jobs information using powershell for multiple SQL servers in the environment?

Thanks in Advance.

--Hunt

Unable to login to sa account

$
0
0

Hi,

I inherited database admin duties from a previous employee who is no longer with us. The program currently used is SQL Server Manager and it has a database that I need to back up. Problem is, he never left the password. I have tried all combinations I could think of and doesn't help. I have tried to login as local administrator but this fails.

I can login with Windows Auth but this doesn't give me the ability to do anything.

What are my options? At this point when I have to run DB repairs etc I just have our Windows guy take a snapshot of the VM. I rather be able to backup to disk or some other storage but this requires the sa account.

IT Tech

Transactional Server Replication

$
0
0

Hi,

I created Publisher on instance "A" and Subscriber on instance "A/alternate".

Strange thing is that replication copy all tables but without data... Here is a error that occurs, can anybody suggest what to do in this situation?

Error:

CREATE TABLE [Sales].[Customer](
    [CustomerID] [int] IDENTITY(1,1) NOT FOR REPLICATION NOT NULL,
    [PersonID] [int] NULL,
    [StoreID] [int] NULL,
    [TerritoryID] [int] NULL,
    [AccountNumber]  AS (isnull('AW'+[dbo].[ufnLeadingZeros]([CustomerID]),'')),
    [rowguid] [uniqueidentifier] ROWGUIDCOL  NOT NULL,
    [ModifiedDate] [datetime] NOT NULL
)


(Transaction sequence number: 0x000000D100001D4400CE00000000, Command ID: 289)

Error messages:
Cannot find either column "dbo" or the user-defined function or aggregate "dbo.ufnLeadingZeros", or the name is ambiguous. (Source: MSSQLServer, Error number: 4121)
Get help: http://help/4121
Cannot find either column "dbo" or the user-defined function or aggregate "dbo.ufnLeadingZeros", or the name is ambiguous. (Source: MSSQLServer, Error number: 4121)
Get help: http://help/4121

Chart Vertical Access keeps growing

$
0
0

hi everyone!

I am using a range chart and I keep expanding the chart to give more room to the data... but instead the vertical labels just keep getting more room.

How do I stop the vertical axis labels from expanding so that I can stretch the chart area to show enough data?

Thanks!

Allana


Installation of SQL Server device client accesses

$
0
0

Hello,

Please help me out for the below query.

Actually I don't have an idea of User & Device CAL Licenses. I joined newly in a company as SQL DBA but I don't know about the licensing part. So, In my present company they are having SQL Server 2008 R2 Standard Edition with 5 SQL Device CAL's. I need to install device CAL's for the Developers. I had checked in Licensing details. So, it is showing 5 SQL Device CAL's. When I go to download it is showing many files and basically it is not showing the CAL application. I need to know which file exactly I should download and install. All applications are showing the same but it is not confirming about the device CAL Application.

Kindly let me know which file I need to download and install and how to manage device cal licenses. I searched in internet a lot but I didn't found the correct answer.

Thanks

Sainath 

Wildcard certificate in mssql 2008R2

$
0
0

Hello, 

I have installed wildcard certificate in Certificates(Local Computer)\Personal in  sql server. We are using Windows 2008R2 server and 2008 R2 SQL server. Certificate is issued by StartCom. With certificate everything is ok (I have used it in IIS), but it didnt appeared in sql configuration manager protocols dropdown list. So i followed microsoft article:

http://support2.microsoft.com/kb/316898

and added certificate thumbrint in registry. Restarted SQL service.

Then I am trying to connect to sql server using SMSS I am getting error:

"A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: SSL Provider, error: 0 - The certificate's CN name does not match the passed value.) (Microsoft SQL Server, Error: -2146762481)"

So obviously problem is wildcard certificate, because it is issued to *.domain.com and server name is server.domain.com.

By this article, microsoft sais that "SQL Server 2008 R2 and the SQL Server 2008 R2 Native Client support wildcard certificates."

http://technet.microsoft.com/en-us/library/ms189067(v=sql.105).aspx

So question would be: Sql 2008 r2 supports or does not support wildcard certificates. If supports, so there is problem? Why i am getting this error?


Mantas


Importing schema+ data using a text file containing sql commands

$
0
0

I have the 2012 SQL SVR Mgmt Studio installed. I received a file--snippet below... from an export of our current DB provider, Advantage. I know I have to edit a lot of commands, but my question is quite simple--how do I use a text file with commands in it like below to create tables, columns and load data into SQL SVR.

---data.txt file contents----

-- Table Type of Beneficiary is ADT
Create Table Beneficiary(
   PlanId Char( 9 ),
   Hash Integer,
   Line1 Char( 128 ),
   Line2 Char( 128 ),
   Batch Char( 16 ) );

EXECUTE PROCEDURE sp_CreateIndex90( 'Beneficiary', 'LAC_LACV1_Beneficiary.adi', 'KEY1', 'Hash;PlanId', '', 2051, 4096, NULL );

INSERT INTO "Beneficiary" VALUES( 'LACV1', 983, 'Judith Pursifull~Spouse~100~~~', 'Michael Pursifull~Son~50~Thomas Pursifull~Son~50', '761011042' );
INSERT INTO "Beneficiary" VALUES( 'LACV1', 996, 'Anna Brownlow~Spouse~100~~~', 'Kaitlin Brownlow~Daughter~85~Lawanda Brownlow~Mother~15', '49036615' );
INSERT INTO "Beneficiary" VALUES( 'LACV1', 1005, 'Weldon Shelton~Other~50~Star Shelton~Other~50', 'Danica Shelton~Sister~50~Ryan Shelton~brother~50', '109075816' );
INSERT INTO "Beneficiary" VALUES( 'LACV1', 1031, 'Donald D Duffy~Spouse~100~~~', 'Brandon M Duffy~Son~100~~~', '219979254' );
INSERT INTO "Beneficiary" VALUES( 'LACV1', 1063, 'Lynne Roffino~Other~50~John Roffino~Other~50', 'Katy Roffino~Sister~50~Margaret Roffino~Sister~50', '604232358' );
INSERT INTO "Beneficiary" VALUES( 'LACV1', 1062, 'John Teaven Redstone~Spouse~100~~~', '~~~~~', '482024691' );
INSERT INTO "Beneficiary" VALUES( 'LACV1', 1032, 'Judith Anne Brown (for cat care)~Other~50~Judith Ann (Kappler) Barklage~Other~50', 'LaVerne Cocke (for cat care)~Friend-PantegoBibl~50~~~', '358324107' );

-- Table Type of Date is ADT
Create Table Date(
   Hash Integer,
   PlanId Char( 9 ),
   Type Char( 24 ),
   Date Date,
   Override Logical,
   Batch Char( 32 ) );

EXECUTE PROCEDURE sp_CreateIndex90( 'Date', 'LAC_LACV1_Date.adi', 'KEY1', 'Hash;Date;PlanId;Type', '', 2051, 4096, NULL );

INSERT INTO "Date" VALUES( 1018, 'LACV1', 'HARDSHIPEND', '2010-02-20', False, '20090820-9414719' );
INSERT INTO "Date" VALUES( 1018, 'LACV1', 'HARDSHIPSTART', '2009-08-20', False, '20090820-9414719' );
INSERT INTO "Date" VALUES( 1001, 'LACV1', 'HARDSHIPEND', '2010-02-06', False, '20090806-9371968' );
INSERT INTO "Date" VALUES( 1001, 'LACV1', 'HARDSHIPSTART', '2009-08-06', False, '20090806-9371968' );
INSERT INTO "Date" VALUES( 1022, 'LACV1', 'LUMPSUMDISTRIBUTION', '2009-07-21', False, '20090721-9337640' );


charles.leggette

SSIS Package failure

$
0
0

Message
Executed as user: ABC\abcprod. Microsoft (R) SQL Server Execute Package Utility  Version 9.00.5292.00 for 32-bit  Copyright (C) Microsoft Corp 1984-2005. All rights reserved.    Started:  12:00:00 AM  Progress: 2014-11-09 00:00:40.48    Source: {50E2FC2E-7266-46D3-9D9A-6034DEB03BEE}      Executing query "DECLARE @Guid UNIQUEIDENTIFIER      EXECUTE msdb..sp".: 100% complete  End Progress  Progress: 2014-11-09 00:09:39.69    Source: Execute T-SQL Statement Task      Executing query "-- Cursor updates usage for all non system databas".: 100% complete  End Progress  DTExec: The package execution returned DTSER_FAILURE (1).  Started: 12:00:00 AM  Finished: 12:09:41 AM  Elapsed:  581.156 seconds.  The package execution failed.  The step failed.

Upon research in google I found to change run value to "0" where as when I checked sp_configure"allow updates" it shows "0" so I don't think it is an issue.

I am running User Databases Optimization and Index Check Plan 

SQL Version is:

Microsoft SQL Server 2005 - 9.00.5292.00 (Intel X86)   Apr 13 2011 15:56:31   Copyright (c) 1988-2005 Microsoft Corporation  Standard Edition on Windows NT 5.2 (Build 3790: Service Pack 2) 

Thanks in advance.

xp_logevent permission

$
0
0

Hi,

I am getting below error

The SELECT permission was denied on the object 'ServiceAgent', database 'HOFHUB', schema 'dbo'. 

The EXECUTE permission was denied on the object 'xp_logevent', database 'mssqlsystemresource', schema 'sys'.

Can anyone please help how to solve it?

Thanks

how much memory each instance is currently using during the business day

$
0
0

how to find out how much memory each instance is currently using during the business day?

Thanks in advance.

Cannot Log in locally to SQL Server 2008 R2 SP2, Can log in remotly.

$
0
0

Hello, Domain Admins has been added to the sysadmin group.  My domain account is a member of Domain Admins.  I can log into the database engine via Managment Studio from a remote computer however i cannot log into the Managment Studio locally on the server unless i add my actual account  to Security > Logins.  

Running on Windows Server 2012 Std.

Your help is appriciated.


SSDT/VisualStudio requirements for SQL Server 2014

$
0
0

Hi

What is the minimum version of SSDT (VS Shell) is required for the creation of BI solutions in SQL Server 2014?

I have VS2010 (was installed from SQL Server 2012 installation media) but this will not work with SQL Server 2014.


Store stored procedure values in temp table

$
0
0

I am using stored procedure to get the values but column headers are not fixed..since I am using pivot function.

So is it possible to create temp table according to the random header and store values to temp table


Abhinav


Export data using stored procedure to excel

$
0
0

How to export and save data from SQL Server to MS Excel using stored procedure.

Thanks in advance


Abhinav

Run as different domain user.

$
0
0

Hi, 

Need to test a new Windows login in SSMS.  

I setup a shortcut as below but I seem access SSMS using the domain account I specified in the shortcut, even though I have been prompted for the password. 

C:\Windows\System32\runas.exe /netonly /user:rkh\sqlmonitor "C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\Ssms.exe" 

Any ideas? 

Make the database drop down wider?

$
0
0
I've tried grabbing this and dragging it left/right to see if it would increase in size, but I could only move it side to side.  Is there a way to make the drop down in SSMS that displays the databases attached to the current instance wider?

Intellisense Stopped Working

$
0
0

A day or two ago, IntelliSense stopped working on my computer. Specifically, it doesn't capitalize built-in function names and it doesn't list the available tables in the same way. I am using MS SQL Server Management Studio 2008 R2. I've tried the following fixes:

  • In Tools > Options > Text Editor > Transact-SQL > IntellisSense, every box has a check in it and "Casing for built-in function names" says "Upper case".
  • IntelliSense is enabled (Query > IntelliSense enabled).
  • I ran Edit > IntelliSense > Refresh local cache several times.

Can anyone help me? Thanks!

How to find what app server the database is connected to in Mgmt Studio

$
0
0

Hi all,

First time using this forum...I have question for SQL Mgmt Studio...forgive my ignorance I know nothing about SQL other a few basics.  Anyway, I have been tasked with setting up documentation to show which database is connected to which application server.  Some of these my DB admin does not even know as it was there before them.  So my question is...is there a way within the Mgmt Studio gui (which I DO have proper access) to find this out?  When I click on a DB and go to properties it tells me alot about the db itself but there is nothing about where the front end is that's connecting to it. 

Any help would be great, thanks!  BTW using SQL server 2008 Mgmt Studio version 10

Viewing all 6989 articles
Browse latest View live


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