|
Могут ли 2 разных пользователя создать временную таблицу с одним и темже именем?
|
|||
---|---|---|---|
#18+
Проблема: для выборки данных необходимо создовать временную табл. после выборки она удоляется... Не возникнет ли проблеммы если 2 пользователя одновременно выполнят процедуру и тем самым создадут 2 таблици с одинаковым именем (например #TempTable) ? Зарание благодарен NetMinion) ... |
|||
:
Нравится:
Не нравится:
|
|||
20.01.2001, 01:26 |
|
Могут ли 2 разных пользователя создать временную таблицу с одним и темже именем?
|
|||
---|---|---|---|
#18+
Я тут поэксперементировал одно время с Query Analyzer`ом. Конфликтов не обнаружил. Вроде бы временная таблица (#) "живет" только в ДАННОМ подключении. Остальные сессии ее не видят. Даже, если входили под тем же логином. "Умирает" она сама, как только к ней пропадает обращение. Однако это не касается ГЛОБАЛЬНЫХ временных таблиц (##). Эти штуки видны ВСЕМ пользователям. И живут они пока к ним есть хоть одно обращение любой сессии. Все это является плодом собственных экспериментов, и того, что "где-то когда-то читал". Может, я в чем-то не прав, и уважаемые коллеги меня поправят. Желаю удачи! ... |
|||
:
Нравится:
Не нравится:
|
|||
20.01.2001, 14:27 |
|
Могут ли 2 разных пользователя создать временную таблицу с одним и темже именем?
|
|||
---|---|---|---|
#18+
Документальное подтверждение слов AnKa: You can also create temporary tables. Temporary tables are similar to permanent tables, except temporary tables are stored in tempdb and are deleted automatically when no longer in use. The two types of temporary tables, local and global, differ from each other in their names, their visibility, and their lifetimes. Local temporary tables have a single number sign (#) as the first character of their names; they are visible only to the current connection for the user; and they are deleted when the user disconnects from computers running Microsoft® SQL Server™. Global temporary tables have two number signs (##) as the first characters of their names; they are visible to any user after they are created; and they are deleted when all users referencing the table disconnect from SQL Server. For example, if you create a table named employees, it can be used by any person who has the security permissions in the database to use it, until it is deleted. If you create a local temporary table named #employees, you are the only person who can work with the table, and it is deleted when you disconnect. If you create a global temporary table named ##employees, any user in the database can work with this table. If no other user works with this table after you create it, the table is deleted when you disconnect. If another user works with the table after you create it, SQL Server deletes it when both of you disconnect. ... |
|||
:
Нравится:
Не нравится:
|
|||
22.01.2001, 10:34 |
|
|
start [/forum/topic.php?desktop=1&fid=46&tid=1827434]: |
0ms |
get settings: |
9ms |
get forum list: |
14ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
38ms |
get topic data: |
9ms |
get forum data: |
2ms |
get page messages: |
43ms |
get tp. blocked users: |
2ms |
others: | 270ms |
total: | 393ms |
0 / 0 |