i m having two databases 'lstock' and 'lstockhh' both the database contain tables with same names. the following query is for only one table present in the both databases'T_buffalow'. now there are more tables in both the database and when i m try to include
those tables it is showing an error"such as i m having tables like T_camel,T_cow etc"in both the database with same coulmn names with each table how can i perform the following operation with the other tables.
please help me sort out this problem.
View Complete Post
There might be an easier way to perform it, if so, please advise. I am looking for a scriptable solution (preferably TSQL).
I want to code a tsql procedure to restore a database from a backup file (.bak). The procedure must allow to restore a backup from a database to a different database.
When performing it through the SSMS interface, I see all the files in the .bak file. From there, I can associate the files in the backup to the appropriate files in my destination database. when generating TSQL, this translates to MOVE
statements for the files.
Can I translate the whole process in TSQL? In order to know how to map my files, I must first gather the information on which files are present in my bak file. Can one read the definition of the files contained in a backup file before performing
the restore. Preferably using TSQL?
Is there is any way to get current logged in user and password using a TSQL?
Sajid P K
I need to write a automatic query. Please see below for example.
Date: 4/4/2010 (Monday), 4/5/2010 (Tuesday), 4/6/2010 (Wednesday)
So from every Monday - Sunday (End of the week) the result = Week of October 4th 2010
Date Day Wanted Result
4/4/2010 Mon Week of Oct 4 2010
4/5/2010 Tue Week of Oct 4 2010
4/6/2010 Wed Week of Oct 4 2010
4/7/2010 Thur Week of Oct 4 2010
4/8/2010 Fri Week of Oct 4 2010
4/9/2010 Sat Week of Oct 4 2010
4/10/2010 Sun Week of Oct 4 2010
4/11/2010 Mon Week of Oct 11 2010
Thanks loadzzz in advancee
Could please tell me best way to replace first occurrence of word in Tsql ?
SET @SQL = 'select 1 as X, 1 as Y, 3 as z from
Select * from Table1
I need to replace first “select” to another word.