• SQL select loop list?

    Say I want to derive the following: Select ID, F1 from table Union Select ID, F2 from table Union Select ID, F3 from table Union … etc until F10. Is there smart and easy way so that I can just provide a list: F1,F2,F3,…,F10 and somehow be able to have the select statement loop through it? Also,...

    Vinical5 pointsBadges:
  • T-SQL query to ACESS 2007 database

    I need examples of T-SQL queries running on SQL Server 2005 that retrieve data from a MS ACCESS 2007 Table. Any explanations are appreciated. Thanks

    DamMan5 pointsBadges:
  • Variables in T-SQL

    Hi, I want to know y does the following script run in SQL and not in T-SQL DECLARE @tblName varchar(30) SET @tblName = CONVERT(VARCHAR(20),GETDATE(),112) + 'Table' DECLARE @sql nvarchar(4000) SELECT @sql = 'CREATE TABLE "' + @tblName + '" ( ID VARCHAR(15), Name VARCHAR(15) )' EXEC(@sql) go it gives...

    Babar198220 pointsBadges:
  • Capitalize First Character

    How can ensure that when certain columns in a row are INSERTed/UPDATEd, the first letter of the value is capitalized and the rest are lower case? For example "QUESTION" or "question" should be converted to "Question".

    VelameLaCosa110 pointsBadges:
  • Transact SQL stored executed from AS/400 CL program.

    How can I execute a Transact SQL stored procedure (actually in the database) on a SQL 2000 database from an AS/400 CL program.

    Jcorzine20 pointsBadges:
  • DBCC CHECKDB

    before runing DBCC CHECKDB WITH repair_allow_data_loss, How can i know what table and data that will be deleted

    Sreenu125 pointsBadges:
  • DATEDIFF – 1 year off

    I need to figure out age from a birthday. When I use the DATEDIFF function for year, the number of years is one year ahead if the birthday hasn't passed yet for this year. How can I get the accurate age based on the day and month of the birthday.

    Bananahead60 pointsBadges:
  • Drop Database Connections

    Hi,How can I drop all connections of a database through TSQL commands.(NOT SMO)

    Javad5 pointsBadges:
  • How can I correct sCaller errors in T-SQL?

    How can I correct generic sCaller errors in T-SQL?

    SQL Server Ask the Experts2,585 pointsBadges:
  • What is the difference between SQL and T-SQL?

    What is the difference between SQL and T-SQL?

    SQL Server Ask the Experts2,585 pointsBadges:
  • Searching for a T-SQL query to find data from multiple SQL 2005 servers

    I need a T-SQL query to find a list of all database names and sizes from multiple SQL 2005 servers that are connected in a local network. Does one exist?

    SQL Server Ask the Experts2,585 pointsBadges:
  • SQL Cursor to use or not to use

    Hi, I've been told to never use cursor in SQL, because of possibility of memory leak, etc. But I have no idea of how to implement my script without them. My script doesn't execute anything on the database, it simply use cursor to create another TSQL script that does the execution. EG. open cursor...

    Db23290 pointsBadges:
  • issue sp_helprotect

    if i give sp_helprotect on one table. it shows the list of access few tables permissions including given table. can i know why it is happens

    Sqlhnd30 pointsBadges:
  • Error in SQL Server 2005 with passing a variable

    In T-SQL code on SQL Server 2005, the variable :t_id is being passed from other pages and works in other statements, but it is not parsing within this statement: define("TF_T_INFO_INSERET", " insert into TFT (WG_ID,task_id,tf_id) SELECT (select WGID from LU_T where TID= :t_id ), :t_id , (select...

    SQL Server Ask the Experts2,585 pointsBadges:
  • How to enable a trace for SQL Server Analysis Services using T-SQL?

    Hi I want to enable a trace on analysis services Filter only the errors and notifications log them in a table and send a mail. I am right now doing using sql profiler, but i dont want to do this using profiler as i have to log on the server continuously. I need to do this in T-sql like an SP or a...

    GIG240 pointsBadges:
  • How to generate a column name in a table dynamically

    hi, I have to generate dynamic columns for a temp table. I have a temp table with column a, the column b should be generated based on a condition. B conditions are if value> 10 i have to genrate the column as 10 and if the value >20 the column name should be 20 etc....n values.... If i select...

    GIG240 pointsBadges:
  • T-SQL Query- how to explode XML fragment stored as NText into table?

    I'm using a commercial storefront software that offers "extension data" fields as NText to store custom data. I am storing an xml fragment that looks like this: <priceSplit xmlns="http://tempuri.org/priceSplit.xsd"> <split> <type>Credit Processing Fee</type>...

    Lambrite5 pointsBadges:
  • CASE sintaxis error in SELECT

    In the middle of a large storage procedure I have a working SELECT 01 (see below) which at a couple of points uses CASE statement. I need to expand the most inner CASE to get SQL Server check for several values instead of one. Currently CASE I am talking about looks like (it is in the middle of...

    Jzurbo775 pointsBadges:
  • Concatenate Two Fields t-sql

    I need to concatenate two fields one varchar(50) and the other varchar(12) The result I need is to see the full 50 characters of the first field even though all 50 may not be filled. Thanks

    Jp52825 pointsBadges:
  • Problem converting Access SQL query to T-SQL 2005

    I have a SQL Server 2005 database. One of my co-workers has put a MS Access front-end on it, because of the ease of designing queries in Access. I need to convert an existing query from Access SQL to T-SQL to put it into production. So far, I have removed all the obvious differences between the 2,...

    Chunkydrew15 pointsBadges:

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following