A database / table I'm working it saves all its date values as datetime (without a timezone).
How can I find out which timezone that date was in?
For instance, the Central European Summer Time (+02) ...

I am reading Remus Rusanu article on tlog.In that article he demoed on how to read log payload by using dbcc page option .My question is ,is there a way to read logrecord output of fn_dblog(null,null) ...

I'm trying to execute a query across around 200 servers using openrowset function.
This function needs to execute in a loop - the query is sucessfull in SQL Server 2012 environments, but failing in ...

So my DBA don't want developers to give Alter table permission. Now one of the procedure that we created requires to Truncate tables (since apparently delete only removes records, but truncate frees ...

i need some help with creating a trigger to run a qf.stored_procedure when a qf.table is created. AT the moment, i have a job t run the stored procedure every 15 minutes but changing that is not an ...

I have a table that contains 320,071,712 number of records, the report that I am currently working on can filter the records by date, after which the number of records come down to 145,878,852. The ...

I am playing around with some stuff in SSMS to learn a little more as I study for my 70-461 exam and I came across a little hangup. I am trying to create a table to play around with so I don't have to ...

I have a seemingly easy question. How can I move a xxx.bak file to another location with T-sql?
I have a job that takes a copy from database a to c:mycopy/copy1/a.bak and I want to create a step that ...

I want to check check if backup plans are set up correctly and need to query different servers, mostly SQL Server 2008, but also 2012.
Is there any way to query the maintenance plans for databases, ...

I would appreciate confirmation on the answer I found digging through T-SQL's documentation.
I have a stored procedure that references a view twice. Once in the procedure and then a second time when ...

As a background to this question the details can be found at this link.
In a nutshell: I have 2 SQL statements that are almost identical except for the RIGHT table. The LEFT JOIN is the same and the ...

I have a temp table that has a SecurityCode column. This SecurityCode column gets updated based off value from a CrossReference table.
The value selected from the CrossReference table depends on how ...

A number of tools exist which are designed to facilitate formatting the T-SQL in an inherited script or stored procedure to match one's personal preferences.
One feature I would like to see in such ...

Developing an application that is using Google Maps. Lagitude and Longitude values are stored in the table as the correct value. However when they are pulled into a view the value is rounded to the ...

Hi we have to delete between 40 and 55% of records from several tables that have between 40 million and 100 million rows.
Is it better to copy the rows we want to keep to a new table, drop the source ...

I am trying to update a table with an array of values. Each item in the array contains information that matches a row in a table in the SQL db. If the row already exists in the table, we update that ...

I'm attempting to alter a sproc that needs the line added : grant exec on dbo.sproc_name to exec_proc. I believe the admin setup the exec_proc as a group. I added this grant line following the final ...

I want to export a varbinary column to a file system. I can use BCP command to export data from a varbinary column, which requires username and password being sent along with BCP command. I can use ...

I am trying to use table-valued parameter to bulk upsert some data into my table. I have the following stored procedure. This setup seems to agree with the intellisense. I am not getting any errors ...

So I've been working on this for quite some time but I run into so many obstacles that I am beginning to wonder if I am using the right tool for the job.
My problem is pretty simple: I have several ...

I have recently learned about sp_tableoption which gives you the ability to store "large value types out of row" for particular table.
A colleague of me told me if I enabled it, each field is stored ...

I need to copy a TDE-encrypted SQL Server database to a separate, non-encrypted, SQL Server instance using T-SQL, but only by reading the schema of the source database. This is because I'm going to ...

Small question here. I found some answer close to it but not exactly what I'm looking for.
Here is the situation: I have a SQL Server trigger on a table. Its task is to record the username (logon id) ...

I'm not sure how else to explain this so here is an example of what I am trying to accomplish. The problem with this, as you will quickly notice, is that there are repeats in the results.
and there ...

I am trying to extract all the variable from the following string;
string = 'factor1|factor2|factor3'
This is just a test string. In real string, I do not know the number of factors. What I want is ...

I have some daily and weekly tasks where I run a script to get the required information. What is the way to running this code once and hitting all the servers without having to log into each one of ...