Thursday, November 8, 2007

how to change user/schema in SQL query on MSSQL 200*

Thanks to my friend Oleksy who is the champion in googling :)

Here is how to change user/schema in SQL query on MSSQL 200*
For instance I connected with "sa" and my schema is "dbo". I want to query tables from schema "teamworks", but don't want to specify "teamworks" prefix.

SETUSER 'teamworks'

SELECT
MY_TABLE.GROUP_ID
FROM
MY_TABLE

SETUSER

1 comment:

nashfahnestock said...

Online gambling sites in Maryland - Dr.MCD
Online gambling sites in Maryland. Online gambling sites 서산 출장마사지 in Maryland. Online gambling sites in Maryland. Online 하남 출장마사지 gambling 계룡 출장마사지 sites in Maryland. 고양 출장안마 Online gambling sites  Rating: 3.2 · ‎9 reviews 여주 출장안마