SQL Server Admin 2014 :: Select Certain Column To CSV File

Jun 25, 2014

I have a database it is 50 gb with hundreds of columns. I would like to choose a certain column and convert the data in it to .csv or excel file. How can I do that I am very new to MSSQL...

View 1 Replies


ADVERTISEMENT

SQL Server Admin 2014 :: Creating Additional Data File For A Particular File Group?

Jul 6, 2015

For a database, we have 4 data files in a particular file group and the file sizes are almost 70 GB each.

Do I come across any performance issues if I create/pre-allocate an additional data file in the same file group so that the existing files don't grow too much?

View 5 Replies View Related

SQL Server Admin 2014 :: Can Delete A Data-file Or File-group

Apr 27, 2015

In a server we had File Growth,And then We had to Add New Hard Drive And New File On It.And Now We have New server with a Huge Hard Drive.But all files remaind.Can I Reduce This files to One data file or not ?

View 3 Replies View Related

SQL Server Admin 2014 :: Add New Column To A Table

Aug 24, 2015

I am new in SQL Server, What to check ,what action do i need to take while adding a new column to a table.

View 5 Replies View Related

SQL Server Admin 2014 :: How To Restore MDF File

Mar 21, 2014

My sql databases in SQL Server 2014 has the status "suspend" as I saw in SQL Management Studio. I can't restore to serviceable condition sql databases through standard procedures. I need to restore .mdf file.

View 9 Replies View Related

SQL Server Admin 2014 :: OST File Is Not Accessible

Feb 26, 2015

my 4 GB .OST file is corrupted and i am not able to access my mails and contacts.

View 2 Replies View Related

SQL Server Admin 2014 :: Log File Growth

Nov 7, 2015

A log file size of a production database has been increase from 4gb to 150 gb initial size.Now i want to find when it will grow & how much it grow & which transaction is responsible for this.

View 6 Replies View Related

SQL Server Admin 2014 :: Crystal Report Cannot Select Into Temp Table

Jul 30, 2015

I know select * into ##tmp1 should work but I get a database connection error.

View 9 Replies View Related

SQL Server Admin 2014 :: Rebuild CMS Tables From XML File?

Jul 23, 2014

I had to reinstall my local copy of SQL a few weeks ago, which naturally overwrote the

msdb.dbo.sysmanagement_shared_server_groups_internal and
msdb.dbo.sysmanagement_shared_registered_servers_internal tables.

However I still have the local XML file that SSMS reads so I can still access the groups, I just get weird errors when trying to re-register my install as the new CMS. How to rebuilt those tables from the XML file or know of a way to repopulate?

View 3 Replies View Related

SQL Server Admin 2014 :: Create Format File For BCP

Nov 10, 2014

We have one table where we store all documents in one of the column called "Doc" with varbinary(max) data type.

We want to download those documents from sql table to windows explorer and i wrote BCP in sql 2005. And things were fine.

The format file I used there looks like this,

9.0
1
1 SQLBINARY 0 0 "" 1 Doc ""

Now we are in 2014 and when I try the same code with same format file, it hangs in the middle. So I changed the file to 12.0 instead of 9.0 but still not working.

View 0 Replies View Related

SQL Server Admin 2014 :: Way To Restore All File Groups Except One?

Oct 19, 2015

is there a way to restore all file groups except one? example: Database A has 10 filegroups, but 1 of them is defunct, so i cant delete it and there's no backup for restore it.Can I create a new DB restoring the 9 good FGs from a database A's backup?

View 9 Replies View Related

SQL Server Admin 2014 :: Put A Clustered Index On A Date Column

May 18, 2015

I would like to put a Clustered Index on a date column in a current heap, but one question/concern.This heap every month has thousands of rows deleted and even more added later. How much of an issue will this cause the Clustered Index as far as page splits? I was thinking Fill Factor of 70%.I would normally just test and still will on Dev box, but my Dev box is much smaller than production as far as power.

View 6 Replies View Related

SQL Server Admin 2014 :: Column Level Data Encryption

Jun 17, 2015

I need to encrypt some column level data in multiple tables in SQL server 2014. I've never tried encryption in SQL server 2014. How can I achieve it?

View 4 Replies View Related

SQL Server Admin 2014 :: Using Column Encryption With Symmetric Keys

Jun 25, 2015

I am trying to implement the column encryption on one of the tables, have used the below link as the reference and got stuck at the last step.

[URL] ....

I have completed the following steps so far.

- CREATE MASTER KEY ENCRYPTION BY PASSWORD = ‘myStrongPassword’

- CREATE CERTIFICATE MyCertificateName
WITH SUBJECT = 'A label for this certificate'

- CREATE SYMMETRIC KEY MySymmetricKeyName WITH
IDENTITY_VALUE = 'a fairly secure name',
ALGORITHM = AES_256,

[Code] .....

Example by using the function

EXEC OpenKeys

-- Encrypting
SELECT Encrypt(myColumn) FROM myTable

-- Decrypting
SELECT Decrypt(myColumn) FROM myTable

When I ran the last command :

-- Decrypting
SELECT Decrypt(myColumn) FROM myTable

I get the following error :

Msg 257, Level 16, State 3, Line 2
Implicit conversion from data type nvarchar to varbinary is not allowed. Use the CONVERT function to run this query.

Where will I use the convert function, in decrypt function or in select statement?

View 9 Replies View Related

SQL Server Admin 2014 :: How To Convert Float To Timestamp In Single Select Query

Mar 18, 2015

How to convert float to timestamp in single select query

E.g., i have float as 1.251152515236 ,

I want to convert this to datetime and from datetime to timestamp... i.e. 26:11:00

View 1 Replies View Related

SQL Server Admin 2014 :: What Is The Use Of Creating Manifest File In SSIS

Apr 8, 2014

What is the use of creating manifest file in SSIS... because I was schedule a job and its not needed and manifest file then why we are creating this.

View 4 Replies View Related

SQL Server Admin 2014 :: BAK File Does Not Show In Restore Window

Jan 10, 2015

I have a windows 8 pc that I just got and installed sqlexpress 2014. My buddy haw windows 7 and installed sqlexpress on his pc. We create a db on his pc, did a backup, copied the backup to my pc. In ssms I right click on "database" > restore database. click device and the button to find my file. I navigate to the folder where the file shows in file explorer but the .bak file does not show in ssms to restore from. This is probably a windows thing but I have don't know what to look at.

View 4 Replies View Related

SQL Server Admin 2014 :: How To Identify Empty Data File

Jan 21, 2015

I was running an operation to shrink file/emptyfile a data file, and then remove it.

It blocked and caused a huge mess, I suspect on the removal part. But I want to confirm that the emptyfile completed (and that the engine isn't going to try to put more data in there for when I schedule the removal part again a week or more from now).

How does the engine know not to put any more data in there, and how long does that situation last?

View 3 Replies View Related

SQL Server Admin 2014 :: Log File Size And Log Space Used (Percentage)

Jul 7, 2015

While i execute dbcc sqlperf(logspace); I get following values.

Database NameLog Size (MB)Log Space Used (%)
master 16.17969 13.30275
tempdb 7.429688 61.7245
model 0.7421875 45.78947
msdb 5.554688 25.87904
distribution 2808.93 0.8172179
BANKDB 23438.87 48.20037
WSMIRSDB 109.7422 4.839111

For database BANKDB , Log Space used(%) is 48.83% and Log size is about 23438.87 where as my database size of BANKDB is 60 GB. FULL database and Log back is done every day night one time. My database is performing slow now.

Do we need to take log backup frequently like once a 1 hour so that Log space used will be less. Same query is taking more time to execute than before in same database is it because of log file has increased.

I do index organize and rebuild once a week and stats apply nightly.

Is it correct once log space size is increasing more than 10%. Do we need to take log backup?

View 4 Replies View Related

SQL Server Admin 2014 :: Create Temporary Table With Dynamics Column

Jun 10, 2014

I have created a stored procedure for retrieving column name, as shown below

CM_id, CM_Name, [Transaction_Month], [Transaction_Year], [Invoice raised date],[Payment Received date],[Payout date],[Payroll lock date]

Now I am trying to create a temporary table using the above generated coluimns from Stored Procedure with datatype.

View 3 Replies View Related

SQL Server Admin 2014 :: Recover Value Of Column In Database Hosted Online

Jun 3, 2015

SQL server, by-mistake I updated values of a column in a database hosted online, is there any way undo the transaction. I didn't created any backup of the database. I read that still it can be recovered through the .ldf (log file) but unable to access it. Is there anyway to get access of the Log file or is there any way to recover the data.

View 1 Replies View Related

SQL Server Admin 2014 :: Column Store Indexes Ignored When Run Test Queries

Aug 25, 2015

I had an existing table with lots of indexes.

As a test (fro speed) - I added a non clustered column-store index.

When I run test queries it always ignores my new column-store index. Why?

Should I remove the old indexes, leaving just the column store?

View 2 Replies View Related

SQL Server Admin 2014 :: Database File Placement And Number Of Files

Feb 2, 2015

Database File Placement Layout? We are planning to implement a new SQL Server 2014 OLTP Database with a 1 TB Data file and 1 TB Log File. I am looking at the possible layout of the database files and trying to determine the best possible configuration. My knowledge/research tells me that items which need separate storage due to constant simultaneous access are:

Data files – should go on the fastest reading storage.
Log files – should go on the fastest writing storage.
TempDb – involves a lot of writing at the same time the data files are being read.
Indexes - (including full text indexes) - involves a lot of writing at the same time the data files are being read.

Also, are there any benefit to having multiple OLTP Database Log files? Because SQL Server writes to the log file sequentially, I do not see any advantages to having multiple database log files. In a SQL Server 2012 Class I took last summer, under “Determining File Placement and Number of Files”, it states “Use a single log file in most situations as log files are written sequentially.”

View 9 Replies View Related

SQL Server Admin 2014 :: Cannot Open Data File When Running Agent Job

Apr 30, 2015

I recently installed standalone version of SQL 2014 Standard on my work computer. I used Access before but I want to use a SQL server instead.

We have a shared drive that a file gets deposited every day at midnight. I want to be able to get this file and import it to the server (its basically a list of names).

Here what I have done so far:

I created the database

Created the file and successfully imported data into it using the Import Data feature.

I saved the SSIS package

Scheduled an Agent Job for this package to run at certain time,daily

At first the jobs would fail with a Access is Denied. I added a user under Credentials with my network account ( have admin rights on the work computer).Also added a Proxy for the Credential user I made.

Jobs fail with a “Cannot open data file” error. I tried changing things here and there, but I can’t get it to work.

View 9 Replies View Related

SQL Server Admin 2014 :: Import Excel File On Database Failing

May 14, 2015

I have installed SQL 2014 (Evaluation Version) on testing machine. We want to import some excel files on database. I manually created one Test Database and now trying to import excel file. Import completed successfully but I am not able to see any table created as result of Import. I tried it 3-4 times and even restarted sql services but no luck.

View 3 Replies View Related

SQL Server Admin 2014 :: Check If UNC Path Exists (It Is Folder - Not File)

Oct 29, 2015

usual way to check if file exists

DECLARE @File_Exists INT
EXEC Master.dbo.xp_fileexist 'serverBSQL_Backupfile.bak', @File_Exists OUT
print @File_Exists
1

And if check folder, can use "nul", but it doesn't work for UNC path

DECLARE @File_Exists INT
EXEC Master.dbo.xp_fileexist 'serverBSQL_Backupul', @File_Exists OUT
print @File_Exists
0

If use xp_subdirs like:

EXEC master.dbo.xp_subdirs 'serverBSQL_Backups'

If the folder doesn't exists, Msg 22006, Level 16, State 1, Line 3 xp_subdirs could not access 'ServerBSQL_Backups*.*': FindFirstFile() returned error 67, 'The network name cannot be found.'

how to check if UNC folder exists in Backup? in my code I want to check if the unc folder exists before doing backup, the unc path is retrieved from other table or backup history.

View 6 Replies View Related

SQL Server Admin 2014 :: Get Average Of Two Largest Number Amount Three Column For Particular Identity

May 3, 2015

ID A B C AVG
------------------------
1 08 09 10 -
------------------------
2 10 25 26 -
------------------------
3 09 15 16 -
------------------------

I want to calculate the average of the larges two number from the column A,B & C for particular identity and store that average in the AVG column....

View 9 Replies View Related

SQL Server Admin 2014 :: How To Configure File Share Storage For Windows Clustering

Dec 18, 2014

I want to setuo AlwaysON that requires Node and FileShare Majority Quorum settings..

I want to know how to configure File share for windows clustering ????

View 2 Replies View Related

SQL Server Admin 2014 :: How To Allocate The File Sizes (Disk Partition Alignment For Tempdb)

Jun 29, 2015

I have question about tempdb needs to be configured 100GB 64kb block size.its fresh installation.

how to allocate the file sizes.still im not sure how many log files needs to be created with 100GB equals to 64KB block size.

what is 64KB block size and how to divide the logfiles 64KB into the 100gb or 50GB?

what is 64 KB cluster has 128 sectors?

tempdb drives should be formatted with a 64K allocation? how many files needs to created for good performance with 50GB or 100GB? ot 1TB

View 3 Replies View Related

SQL Server Admin 2014 :: Re-balancing Blob And Lob Data In Multiple Files On Primary File Group

May 7, 2014

A little background on what I am trying to achieve first. We are moving to Azure virtual machines and we will have 8 disks on the SQL Server box. I am adding more files to the primary file group and each file will go on its own drive. I am then rebalancing data across these files by rebuilding all of the indexes on the tables which is working fine. No problems so far all is good.

I now have an additional problem. If there is a lob or blob column on the table, rebuilding the clustered index and all the non clustered indexes doesn't rebalance the blob or lob data across the disks such as it does with in row data.

I cannot find any articles on rebalancing lob or blob data because all the articles say to move to a new file group. I do not want a new file group, I just want to use the primary file group where the data already resides, and just redistribute it evenly in the same way that I can in row data which is working fine.

One solution I thought about was to BCP data out of the table, truncate the table and then BCP back into the table which I imagine would have the desired effect of distributing the data evenly over the files.

View 2 Replies View Related

SQL Server Admin 2014 :: Does Security-admin Role Plus Deny Alter Any Login Cancel Each Other Out

Aug 27, 2015

I want to set up a database role so that users can use sp_readerrorlog through SSMS. It does a check on membership in the securityadmin role.

I have tested it and can see you can grant execute on xp_readerrorlog but the SSMS GUI uses sp_readerrorlog.

I thought I could create a user/certificate and add the signature to sp_readerrorlog but it's not permitted (likely because it's not a normal database object).

So the other solution is to add the users to the securityadmin role but then explicitly deny alter any login (best done with a custom server role in 2012+ but otherwise just manually in 2008). I tested this out and it works, I'm not able to alter any logins or increase my own permissions, I also did a check of what's reported from fn_my_permissions(null, null) and it shows minimal permissions like I'd expect.

View 0 Replies View Related

SQL Server Admin 2014 :: Restore Lost Transaction From Transaction Log File

Jun 10, 2015

I have Full database backup upto previous day and transaction logfile of Today transaction. my database has crashed. I have restored previous day's Full backup. I have faced difficulty to restore today's transaction from today's transaction log. What are the steps to restore full database back and one day's transaction log file. Note: there is no differential database backup and transaction backup.

View 8 Replies View Related

SQL Server 2014 :: Adding One More Column For SubTotal In Select Statement?

Feb 13, 2014

We have a table with 2 columns 'OrderNo' and 'Amount' as below

ORDERNO | AMOUNT
1D1ZX000 | 9262.5
1D1ZX001 | 9000.0
1D1ZX001 | 9000.0
1D1ZX002 | 10000
1D1ZX003 | 1000
1D1ZX003 | 200.50
1D1ZX003 | 100.50
1D1ZX004 | 500.0
1D1ZX004 | 1000
1D1ZX004 | 2000
1D1ZX004 | 1000

as per my client requirement we need subtotal of 'Amount' group by 'OrderNo'. column so am writing a select statement with WHERE condition and I would like to have another column called SUBTOTAL in the result set (select statement result) with subtotals for that order Number as below

ORDERNO | AMOUNT | SubTotal
1D1ZX000 | 9262.5 | 9262.5
1D1ZX001 | 9000.0 | 18000
1D1ZX001 | 9000.0 | 18000
1D1ZX002 | 10000 | 10000
1D1ZX003 | 1000.0 | 3001
1D1ZX003 | 2000.5 | 3001
1D1ZX003 | 1000.5 | 3001
1D1ZX004 | 500.00 | 4500
1D1ZX004 | 1000.0 | 4500
1D1ZX004 | 2000.0 | 4500
1D1ZX004 | 1000.0 | 4500

View 7 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved